2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.datatypes.elements;
23 import org.junit.Assert;
24 import org.junit.Test;
26 import java.util.List;
29 public class RequirementDataDefinitionTest {
31 private RequirementDataDefinition createTestSubject() {
32 return new RequirementDataDefinition();
36 public void testCopyConstructor() throws Exception {
37 RequirementDataDefinition testSubject;
41 testSubject = createTestSubject();
42 new RequirementDataDefinition(testSubject);
46 public void testGetUniqueId() throws Exception {
47 RequirementDataDefinition testSubject;
51 testSubject = createTestSubject();
52 result = testSubject.getUniqueId();
57 public void testSetUniqueId() throws Exception {
58 RequirementDataDefinition testSubject;
62 testSubject = createTestSubject();
63 testSubject.setUniqueId(uniqueId);
68 public void testGetName() throws Exception {
69 RequirementDataDefinition testSubject;
73 testSubject = createTestSubject();
74 result = testSubject.getName();
79 public void testSetName() throws Exception {
80 RequirementDataDefinition testSubject;
84 testSubject = createTestSubject();
85 testSubject.setName(name);
90 public void testGetParentName() throws Exception {
91 RequirementDataDefinition testSubject;
95 testSubject = createTestSubject();
96 result = testSubject.getParentName();
101 public void testSetParentName() throws Exception {
102 RequirementDataDefinition testSubject;
103 String parentName = "";
106 testSubject = createTestSubject();
107 testSubject.setParentName(parentName);
112 public void testGetCapability() throws Exception {
113 RequirementDataDefinition testSubject;
117 testSubject = createTestSubject();
118 result = testSubject.getCapability();
123 public void testSetCapability() throws Exception {
124 RequirementDataDefinition testSubject;
125 String capability = "";
128 testSubject = createTestSubject();
129 testSubject.setCapability(capability);
134 public void testGetNode() throws Exception {
135 RequirementDataDefinition testSubject;
139 testSubject = createTestSubject();
140 result = testSubject.getNode();
145 public void testSetNode() throws Exception {
146 RequirementDataDefinition testSubject;
150 testSubject = createTestSubject();
151 testSubject.setNode(node);
156 public void testGetRelationship() throws Exception {
157 RequirementDataDefinition testSubject;
161 testSubject = createTestSubject();
162 result = testSubject.getRelationship();
167 public void testSetRelationship() throws Exception {
168 RequirementDataDefinition testSubject;
169 String relationship = "";
172 testSubject = createTestSubject();
173 testSubject.setRelationship(relationship);
178 public void testGetOwnerId() throws Exception {
179 RequirementDataDefinition testSubject;
183 testSubject = createTestSubject();
184 result = testSubject.getOwnerId();
189 public void testSetOwnerId() throws Exception {
190 RequirementDataDefinition testSubject;
194 testSubject = createTestSubject();
195 testSubject.setOwnerId(ownerId);
200 public void testGetOwnerName() throws Exception {
201 RequirementDataDefinition testSubject;
205 testSubject = createTestSubject();
206 result = testSubject.getOwnerName();
211 public void testSetOwnerName() throws Exception {
212 RequirementDataDefinition testSubject;
213 String ownerName = "";
216 testSubject = createTestSubject();
217 testSubject.setOwnerName(ownerName);
222 public void testGetMinOccurrences() throws Exception {
223 RequirementDataDefinition testSubject;
227 testSubject = createTestSubject();
228 result = testSubject.getMinOccurrences();
233 public void testSetMinOccurrences() throws Exception {
234 RequirementDataDefinition testSubject;
235 String minOccurrences = "";
238 testSubject = createTestSubject();
239 testSubject.setMinOccurrences(minOccurrences);
244 public void testGetLeftOccurrences() throws Exception {
245 RequirementDataDefinition testSubject;
249 testSubject = createTestSubject();
250 result = testSubject.getLeftOccurrences();
255 public void testSetLeftOccurrences() throws Exception {
256 RequirementDataDefinition testSubject;
257 String leftOccurrences = "";
260 testSubject = createTestSubject();
261 testSubject.setLeftOccurrences(leftOccurrences);
266 public void testGetMaxOccurrences() throws Exception {
267 RequirementDataDefinition testSubject;
271 testSubject = createTestSubject();
272 result = testSubject.getMaxOccurrences();
277 public void testSetMaxOccurrences() throws Exception {
278 RequirementDataDefinition testSubject;
279 String maxOccurrences = "";
282 testSubject = createTestSubject();
283 testSubject.setMaxOccurrences(maxOccurrences);
288 public void testSetPath() throws Exception {
289 RequirementDataDefinition testSubject;
290 List<String> path = null;
293 testSubject = createTestSubject();
294 testSubject.setPath(path);
299 public void testGetPath() throws Exception {
300 RequirementDataDefinition testSubject;
304 testSubject = createTestSubject();
305 result = testSubject.getPath();
310 public void testSetSource() throws Exception {
311 RequirementDataDefinition testSubject;
315 testSubject = createTestSubject();
316 testSubject.setSource(source);
321 public void testGetSource() throws Exception {
322 RequirementDataDefinition testSubject;
326 testSubject = createTestSubject();
327 result = testSubject.getSource();
332 public void testAddToPath() throws Exception {
333 RequirementDataDefinition testSubject;
334 String elementInPath = "";
337 testSubject = createTestSubject();
338 testSubject.addToPath(elementInPath);
343 public void testHashCode() throws Exception {
344 RequirementDataDefinition testSubject;
348 testSubject = createTestSubject();
349 result = testSubject.hashCode();
354 public void testEquals() throws Exception {
355 RequirementDataDefinition testSubject;
360 testSubject = createTestSubject();
362 result = testSubject.equals(obj);
363 Assert.assertEquals(false, result);
364 result = testSubject.equals(testSubject);
365 Assert.assertEquals(true, result);
366 result = testSubject.equals(createTestSubject());
367 Assert.assertEquals(true, result);
372 public void testToString() throws Exception {
373 RequirementDataDefinition testSubject;
377 testSubject = createTestSubject();
378 result = testSubject.toString();