aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/java/org/openecomp/sdc/be/model/ComponentParametersViewTest.java
blob: ec3604498bd79a0bf48c61a28350b9e3168986b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.openecomp.sdc.be.model;

import org.junit.Test;
import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentFieldsEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;

import java.util.LinkedList;

import static org.junit.Assert.assertSame;

public class ComponentParametersViewTest {

	private ComponentParametersView createTestSubject() {
		return new ComponentParametersView();
	}

	@Test
	public void testCtor() throws Exception {
		new ComponentParametersView(true);
		
		LinkedList<String> linkedList = new LinkedList<>();
		for (ComponentFieldsEnum iterable_element : ComponentFieldsEnum.values()) {
			linkedList.add(iterable_element.getValue());
		}
		new ComponentParametersView(linkedList);
	}
	
	@Test
	public void testFilter() throws Exception {
		ComponentParametersView testSubject;
		Component component = null;
		ComponentTypeEnum componentType = ComponentTypeEnum.RESOURCE;
		Component result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.filter(component, componentType);
		testSubject.disableAll();
		result = testSubject.filter(new Resource(), componentType);
	}

	
	@Test
	public void testDisableAll() throws Exception {
		ComponentParametersView testSubject;

		// default test
		testSubject = createTestSubject();
		testSubject.disableAll();
	}

	
	@Test
	public void testIsIgnoreGroups() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreGroups();
	}

	
	@Test
	public void testSetIgnoreGroups() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreGroups = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreGroups(ignoreGroups);
	}

	
	@Test
	public void testIsIgnoreComponentInstances() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreComponentInstances();
	}

	
	@Test
	public void testSetIgnoreComponentInstances() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreComponentInstances = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreComponentInstances(ignoreComponentInstances);
	}

	
	@Test
	public void testIsIgnoreProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreProperties();
	}

	
	@Test
	public void testSetIgnoreProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreProperties = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreProperties(ignoreProperties);
	}

	
	@Test
	public void testIsIgnoreCapabilities() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreCapabilities();
	}

	
	@Test
	public void testSetIgnoreCapabilities() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreCapabilities = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreCapabilities(ignoreCapabilities);
	}

	
	@Test
	public void testIsIgnoreRequirements() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreRequirements();
	}

	
	@Test
	public void testSetIgnoreRequirements() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreRequirements = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreRequirements(ignoreRequirements);
	}

	
	@Test
	public void testIsIgnoreCategories() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreCategories();
	}

	
	@Test
	public void testSetIgnoreCategories() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreCategories = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreCategories(ignoreCategories);
	}

	
	@Test
	public void testIsIgnoreAllVersions() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreAllVersions();
	}

	
	@Test
	public void testSetIgnoreAllVersions() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreAllVersions = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreAllVersions(ignoreAllVersions);
	}

	
	@Test
	public void testIsIgnoreAdditionalInformation() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreAdditionalInformation();
	}

	
	@Test
	public void testIsIgnoreArtifacts() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreArtifacts();
	}

	
	@Test
	public void testSetIgnoreArtifacts() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreArtifacts = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreArtifacts(ignoreArtifacts);
	}

	
	@Test
	public void testIsIgnoreComponentInstancesProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreComponentInstancesProperties();
	}

	
	@Test
	public void testSetIgnoreComponentInstancesProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreComponentInstancesProperties = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreComponentInstancesProperties(ignoreComponentInstancesProperties);
	}

	
	@Test
	public void testIsIgnoreComponentInstancesInputs() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreComponentInstancesInputs();
	}

	
	@Test
	public void testSetIgnoreComponentInstancesInputs() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreComponentInstancesInputs = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreComponentInstancesInputs(ignoreComponentInstancesInputs);
	}

	
	@Test
	public void testIsIgnoreInterfaces() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreInterfaces();
	}


	
	@Test
	public void testIsIgnoreAttributesFrom() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreAttributesFrom();
	}

	
	@Test
	public void testSetIgnoreAttributesFrom() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreAttributesFrom = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreAttributesFrom(ignoreAttributesFrom);
	}

	
	@Test
	public void testIsIgnoreComponentInstancesAttributesFrom() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreComponentInstancesAttributesFrom();
	}


	
	@Test
	public void testIsIgnoreDerivedFrom() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreDerivedFrom();
	}


	
	@Test
	public void testIsIgnoreUsers() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreUsers();
	}

	
	@Test
	public void testSetIgnoreUsers() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreUsers = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreUsers(ignoreUsers);
	}

	
	@Test
	public void testIsIgnoreInputs() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreInputs();
	}

	
	@Test
	public void testSetIgnoreInputs() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreInputs = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreInputs(ignoreInputs);
	}

	
	@Test
	public void testIsIgnoreCapabiltyProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreCapabiltyProperties();
	}

	
	@Test
	public void testSetIgnoreCapabiltyProperties() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreCapabiltyProperties = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreCapabiltyProperties(ignoreCapabiltyProperties);
	}

	
	@Test
	public void testIsIgnoreForwardingPath() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnoreForwardingPath();
	}

	
	@Test
	public void testSetIgnoreForwardingPath() throws Exception {
		ComponentParametersView testSubject;
		boolean ignoreServicePath = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnoreForwardingPath(ignoreServicePath);
	}

	
	@Test
	public void testIsIgnorePolicies() throws Exception {
		ComponentParametersView testSubject;
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isIgnorePolicies();
	}

	
	@Test
	public void testSetIgnorePolicies() throws Exception {
		ComponentParametersView testSubject;
		boolean ignorePolicies = false;

		// default test
		testSubject = createTestSubject();
		testSubject.setIgnorePolicies(ignorePolicies);
	}

	
	@Test
	public void testIsIgnoreNodeFilterWithTrue() throws Exception {
		ComponentParametersView testSubject;

		testSubject = createTestSubject();
		testSubject.setIgnoreNodeFilter(true);
		assertSame(testSubject.isIgnoreNodeFilter(), true);
	}

	
	@Test
	public void testIsIgnoreNodeFilterWithFalse() throws Exception {
		ComponentParametersView testSubject;

		testSubject = createTestSubject();
		testSubject.setIgnoreNodeFilter(false);
		assertSame(testSubject.isIgnoreNodeFilter(), false);
	}


	@Test
	public void testDetectParseFlag() throws Exception {
		ComponentParametersView testSubject;
		JsonParseFlagEnum result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.detectParseFlag();
	}
}