1 package org.openecomp.sdc.be.model;
4 import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
5 import org.openecomp.sdc.be.datatypes.enums.ComponentFieldsEnum;
6 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
8 import java.util.LinkedList;
10 import static org.junit.Assert.assertSame;
12 public class ComponentParametersViewTest {
14 private ComponentParametersView createTestSubject() {
15 return new ComponentParametersView();
19 public void testCtor() throws Exception {
20 new ComponentParametersView(true);
22 LinkedList<String> linkedList = new LinkedList<>();
23 for (ComponentFieldsEnum iterable_element : ComponentFieldsEnum.values()) {
24 linkedList.add(iterable_element.getValue());
26 new ComponentParametersView(linkedList);
30 public void testFilter() throws Exception {
31 ComponentParametersView testSubject;
32 Component component = null;
33 ComponentTypeEnum componentType = ComponentTypeEnum.RESOURCE;
37 testSubject = createTestSubject();
38 result = testSubject.filter(component, componentType);
39 testSubject.disableAll();
40 result = testSubject.filter(new Resource(), componentType);
45 public void testDisableAll() throws Exception {
46 ComponentParametersView testSubject;
49 testSubject = createTestSubject();
50 testSubject.disableAll();
55 public void testIsIgnoreGroups() throws Exception {
56 ComponentParametersView testSubject;
60 testSubject = createTestSubject();
61 result = testSubject.isIgnoreGroups();
66 public void testSetIgnoreGroups() throws Exception {
67 ComponentParametersView testSubject;
68 boolean ignoreGroups = false;
71 testSubject = createTestSubject();
72 testSubject.setIgnoreGroups(ignoreGroups);
77 public void testIsIgnoreComponentInstances() throws Exception {
78 ComponentParametersView testSubject;
82 testSubject = createTestSubject();
83 result = testSubject.isIgnoreComponentInstances();
88 public void testSetIgnoreComponentInstances() throws Exception {
89 ComponentParametersView testSubject;
90 boolean ignoreComponentInstances = false;
93 testSubject = createTestSubject();
94 testSubject.setIgnoreComponentInstances(ignoreComponentInstances);
99 public void testIsIgnoreProperties() throws Exception {
100 ComponentParametersView testSubject;
104 testSubject = createTestSubject();
105 result = testSubject.isIgnoreProperties();
110 public void testSetIgnoreProperties() throws Exception {
111 ComponentParametersView testSubject;
112 boolean ignoreProperties = false;
115 testSubject = createTestSubject();
116 testSubject.setIgnoreProperties(ignoreProperties);
121 public void testIsIgnoreCapabilities() throws Exception {
122 ComponentParametersView testSubject;
126 testSubject = createTestSubject();
127 result = testSubject.isIgnoreCapabilities();
132 public void testSetIgnoreCapabilities() throws Exception {
133 ComponentParametersView testSubject;
134 boolean ignoreCapabilities = false;
137 testSubject = createTestSubject();
138 testSubject.setIgnoreCapabilities(ignoreCapabilities);
143 public void testIsIgnoreRequirements() throws Exception {
144 ComponentParametersView testSubject;
148 testSubject = createTestSubject();
149 result = testSubject.isIgnoreRequirements();
154 public void testSetIgnoreRequirements() throws Exception {
155 ComponentParametersView testSubject;
156 boolean ignoreRequirements = false;
159 testSubject = createTestSubject();
160 testSubject.setIgnoreRequirements(ignoreRequirements);
165 public void testIsIgnoreCategories() throws Exception {
166 ComponentParametersView testSubject;
170 testSubject = createTestSubject();
171 result = testSubject.isIgnoreCategories();
176 public void testSetIgnoreCategories() throws Exception {
177 ComponentParametersView testSubject;
178 boolean ignoreCategories = false;
181 testSubject = createTestSubject();
182 testSubject.setIgnoreCategories(ignoreCategories);
187 public void testIsIgnoreAllVersions() throws Exception {
188 ComponentParametersView testSubject;
192 testSubject = createTestSubject();
193 result = testSubject.isIgnoreAllVersions();
198 public void testSetIgnoreAllVersions() throws Exception {
199 ComponentParametersView testSubject;
200 boolean ignoreAllVersions = false;
203 testSubject = createTestSubject();
204 testSubject.setIgnoreAllVersions(ignoreAllVersions);
209 public void testIsIgnoreAdditionalInformation() throws Exception {
210 ComponentParametersView testSubject;
214 testSubject = createTestSubject();
215 result = testSubject.isIgnoreAdditionalInformation();
220 public void testIsIgnoreArtifacts() throws Exception {
221 ComponentParametersView testSubject;
225 testSubject = createTestSubject();
226 result = testSubject.isIgnoreArtifacts();
231 public void testSetIgnoreArtifacts() throws Exception {
232 ComponentParametersView testSubject;
233 boolean ignoreArtifacts = false;
236 testSubject = createTestSubject();
237 testSubject.setIgnoreArtifacts(ignoreArtifacts);
242 public void testIsIgnoreComponentInstancesProperties() throws Exception {
243 ComponentParametersView testSubject;
247 testSubject = createTestSubject();
248 result = testSubject.isIgnoreComponentInstancesProperties();
253 public void testSetIgnoreComponentInstancesProperties() throws Exception {
254 ComponentParametersView testSubject;
255 boolean ignoreComponentInstancesProperties = false;
258 testSubject = createTestSubject();
259 testSubject.setIgnoreComponentInstancesProperties(ignoreComponentInstancesProperties);
264 public void testIsIgnoreComponentInstancesInputs() throws Exception {
265 ComponentParametersView testSubject;
269 testSubject = createTestSubject();
270 result = testSubject.isIgnoreComponentInstancesInputs();
275 public void testSetIgnoreComponentInstancesInputs() throws Exception {
276 ComponentParametersView testSubject;
277 boolean ignoreComponentInstancesInputs = false;
280 testSubject = createTestSubject();
281 testSubject.setIgnoreComponentInstancesInputs(ignoreComponentInstancesInputs);
286 public void testIsIgnoreInterfaces() throws Exception {
287 ComponentParametersView testSubject;
291 testSubject = createTestSubject();
292 result = testSubject.isIgnoreInterfaces();
298 public void testIsIgnoreAttributesFrom() throws Exception {
299 ComponentParametersView testSubject;
303 testSubject = createTestSubject();
304 result = testSubject.isIgnoreAttributesFrom();
309 public void testSetIgnoreAttributesFrom() throws Exception {
310 ComponentParametersView testSubject;
311 boolean ignoreAttributesFrom = false;
314 testSubject = createTestSubject();
315 testSubject.setIgnoreAttributesFrom(ignoreAttributesFrom);
320 public void testIsIgnoreComponentInstancesAttributesFrom() throws Exception {
321 ComponentParametersView testSubject;
325 testSubject = createTestSubject();
326 result = testSubject.isIgnoreComponentInstancesAttributesFrom();
332 public void testIsIgnoreDerivedFrom() throws Exception {
333 ComponentParametersView testSubject;
337 testSubject = createTestSubject();
338 result = testSubject.isIgnoreDerivedFrom();
344 public void testIsIgnoreUsers() throws Exception {
345 ComponentParametersView testSubject;
349 testSubject = createTestSubject();
350 result = testSubject.isIgnoreUsers();
355 public void testSetIgnoreUsers() throws Exception {
356 ComponentParametersView testSubject;
357 boolean ignoreUsers = false;
360 testSubject = createTestSubject();
361 testSubject.setIgnoreUsers(ignoreUsers);
366 public void testIsIgnoreInputs() throws Exception {
367 ComponentParametersView testSubject;
371 testSubject = createTestSubject();
372 result = testSubject.isIgnoreInputs();
377 public void testSetIgnoreInputs() throws Exception {
378 ComponentParametersView testSubject;
379 boolean ignoreInputs = false;
382 testSubject = createTestSubject();
383 testSubject.setIgnoreInputs(ignoreInputs);
388 public void testIsIgnoreCapabiltyProperties() throws Exception {
389 ComponentParametersView testSubject;
393 testSubject = createTestSubject();
394 result = testSubject.isIgnoreCapabiltyProperties();
399 public void testSetIgnoreCapabiltyProperties() throws Exception {
400 ComponentParametersView testSubject;
401 boolean ignoreCapabiltyProperties = false;
404 testSubject = createTestSubject();
405 testSubject.setIgnoreCapabiltyProperties(ignoreCapabiltyProperties);
410 public void testIsIgnoreForwardingPath() throws Exception {
411 ComponentParametersView testSubject;
415 testSubject = createTestSubject();
416 result = testSubject.isIgnoreForwardingPath();
421 public void testSetIgnoreForwardingPath() throws Exception {
422 ComponentParametersView testSubject;
423 boolean ignoreServicePath = false;
426 testSubject = createTestSubject();
427 testSubject.setIgnoreForwardingPath(ignoreServicePath);
432 public void testIsIgnorePolicies() throws Exception {
433 ComponentParametersView testSubject;
437 testSubject = createTestSubject();
438 result = testSubject.isIgnorePolicies();
443 public void testSetIgnorePolicies() throws Exception {
444 ComponentParametersView testSubject;
445 boolean ignorePolicies = false;
448 testSubject = createTestSubject();
449 testSubject.setIgnorePolicies(ignorePolicies);
454 public void testIsIgnoreNodeFilterWithTrue() throws Exception {
455 ComponentParametersView testSubject;
457 testSubject = createTestSubject();
458 testSubject.setIgnoreNodeFilter(true);
459 assertSame(testSubject.isIgnoreNodeFilter(), true);
464 public void testIsIgnoreNodeFilterWithFalse() throws Exception {
465 ComponentParametersView testSubject;
467 testSubject = createTestSubject();
468 testSubject.setIgnoreNodeFilter(false);
469 assertSame(testSubject.isIgnoreNodeFilter(), false);
474 public void testDetectParseFlag() throws Exception {
475 ComponentParametersView testSubject;
476 JsonParseFlagEnum result;
479 testSubject = createTestSubject();
480 result = testSubject.detectParseFlag();