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.LinkedList;
27 import java.util.List;
30 public class CapabilityDataDefinitionTest {
32 private CapabilityDataDefinition createTestSubject() {
33 return new CapabilityDataDefinition();
37 public void testCopyConstructor() throws Exception {
38 CapabilityDataDefinition testSubject;
41 testSubject = createTestSubject();
42 new CapabilityDataDefinition(testSubject);
43 testSubject.setValidSourceTypes(new LinkedList<>());
44 testSubject.setCapabilitySources(new LinkedList<>());
45 testSubject.setPath(new LinkedList<>());
46 new CapabilityDataDefinition(testSubject);
50 public void testGetOwnerId() throws Exception {
51 CapabilityDataDefinition testSubject;
55 testSubject = createTestSubject();
56 result = testSubject.getOwnerId();
61 public void testSetOwnerId() throws Exception {
62 CapabilityDataDefinition testSubject;
66 testSubject = createTestSubject();
67 testSubject.setOwnerId(ownerId);
72 public void testGetOwnerName() throws Exception {
73 CapabilityDataDefinition testSubject;
77 testSubject = createTestSubject();
78 result = testSubject.getOwnerName();
83 public void testSetOwnerName() throws Exception {
84 CapabilityDataDefinition testSubject;
85 String ownerName = "";
88 testSubject = createTestSubject();
89 testSubject.setOwnerName(ownerName);
94 public void testGetMinOccurrences() throws Exception {
95 CapabilityDataDefinition testSubject;
99 testSubject = createTestSubject();
100 result = testSubject.getMinOccurrences();
105 public void testSetMinOccurrences() throws Exception {
106 CapabilityDataDefinition testSubject;
107 String minOccurrences = "";
110 testSubject = createTestSubject();
111 testSubject.setMinOccurrences(minOccurrences);
116 public void testGetMaxOccurrences() throws Exception {
117 CapabilityDataDefinition testSubject;
121 testSubject = createTestSubject();
122 result = testSubject.getMaxOccurrences();
127 public void testSetMaxOccurrences() throws Exception {
128 CapabilityDataDefinition testSubject;
129 String maxOccurrences = "";
132 testSubject = createTestSubject();
133 testSubject.setMaxOccurrences(maxOccurrences);
138 public void testGetLeftOccurrences() throws Exception {
139 CapabilityDataDefinition testSubject;
143 testSubject = createTestSubject();
144 result = testSubject.getLeftOccurrences();
149 public void testSetLeftOccurrences() throws Exception {
150 CapabilityDataDefinition testSubject;
151 String leftOccurrences = "";
154 testSubject = createTestSubject();
155 testSubject.setLeftOccurrences(leftOccurrences);
160 public void testGetUniqueId() throws Exception {
161 CapabilityDataDefinition testSubject;
165 testSubject = createTestSubject();
166 result = testSubject.getUniqueId();
171 public void testSetUniqueId() throws Exception {
172 CapabilityDataDefinition testSubject;
173 String uniqueId = "";
176 testSubject = createTestSubject();
177 testSubject.setUniqueId(uniqueId);
182 public void testGetDescription() throws Exception {
183 CapabilityDataDefinition testSubject;
187 testSubject = createTestSubject();
188 result = testSubject.getDescription();
193 public void testSetDescription() throws Exception {
194 CapabilityDataDefinition testSubject;
195 String description = "";
198 testSubject = createTestSubject();
199 testSubject.setDescription(description);
204 public void testGetName() throws Exception {
205 CapabilityDataDefinition testSubject;
209 testSubject = createTestSubject();
210 result = testSubject.getName();
215 public void testSetName() throws Exception {
216 CapabilityDataDefinition testSubject;
220 testSubject = createTestSubject();
221 testSubject.setName(name);
226 public void testGetParentName() throws Exception {
227 CapabilityDataDefinition testSubject;
231 testSubject = createTestSubject();
232 result = testSubject.getParentName();
237 public void testSetParentName() throws Exception {
238 CapabilityDataDefinition testSubject;
239 String parentName = "";
242 testSubject = createTestSubject();
243 testSubject.setParentName(parentName);
248 public void testGetType() throws Exception {
249 CapabilityDataDefinition testSubject;
253 testSubject = createTestSubject();
254 result = testSubject.getType();
259 public void testSetType() throws Exception {
260 CapabilityDataDefinition testSubject;
264 testSubject = createTestSubject();
265 testSubject.setType(type);
270 public void testGetValidSourceTypes() throws Exception {
271 CapabilityDataDefinition testSubject;
275 testSubject = createTestSubject();
276 result = testSubject.getValidSourceTypes();
281 public void testSetValidSourceTypes() throws Exception {
282 CapabilityDataDefinition testSubject;
283 List<String> validSourceTypes = null;
286 testSubject = createTestSubject();
287 testSubject.setValidSourceTypes(validSourceTypes);
292 public void testGetCapabilitySources() throws Exception {
293 CapabilityDataDefinition testSubject;
297 testSubject = createTestSubject();
298 result = testSubject.getCapabilitySources();
303 public void testSetCapabilitySources() throws Exception {
304 CapabilityDataDefinition testSubject;
305 List<String> capabilitySources = null;
308 testSubject = createTestSubject();
309 testSubject.setCapabilitySources(capabilitySources);
314 public void testSetPath() throws Exception {
315 CapabilityDataDefinition testSubject;
316 List<String> path = null;
319 testSubject = createTestSubject();
320 testSubject.setPath(path);
325 public void testGetPath() throws Exception {
326 CapabilityDataDefinition testSubject;
330 testSubject = createTestSubject();
331 result = testSubject.getPath();
336 public void testSetSource() throws Exception {
337 CapabilityDataDefinition testSubject;
341 testSubject = createTestSubject();
342 testSubject.setSource(source);
347 public void testGetSource() throws Exception {
348 CapabilityDataDefinition testSubject;
352 testSubject = createTestSubject();
353 result = testSubject.getSource();
358 public void testAddToPath() throws Exception {
359 CapabilityDataDefinition testSubject;
360 String elementInPath = "";
363 testSubject = createTestSubject();
364 testSubject.addToPath(elementInPath);
369 public void testHashCode() throws Exception {
370 CapabilityDataDefinition testSubject;
374 testSubject = createTestSubject();
375 result = testSubject.hashCode();
380 public void testEquals() throws Exception {
381 CapabilityDataDefinition testSubject;
386 testSubject = createTestSubject();
388 result = testSubject.equals(obj);
389 Assert.assertEquals(false, result);
390 result = testSubject.equals(testSubject);
391 Assert.assertEquals(true, result);
392 result = testSubject.equals(createTestSubject());
393 Assert.assertEquals(true, result);
398 public void testToString() throws Exception {
399 CapabilityDataDefinition testSubject;
403 testSubject = createTestSubject();
404 result = testSubject.toString();