re base code
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / PropertyDefinitionTest.java
1 package org.openecomp.sdc.be.model;
2
3 import org.junit.Test;
4 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
5 import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames;
6
7 import java.util.LinkedList;
8 import java.util.List;
9
10
11 public class PropertyDefinitionTest {
12
13         private PropertyDefinition createTestSubject() {
14                 return new PropertyDefinition();
15         }
16         
17         @Test
18         public void testCtor() throws Exception {
19                 new PropertyDefinition(new PropertyDefinition());
20                 new PropertyDefinition(new PropertyDataDefinition());
21         }
22         
23         @Test
24         public void testPropertyNames() throws Exception {
25                 PropertyNames availabiltyZoneCount = PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT;
26         }
27         
28         @Test
29         public void testPropertyNames_GetPropertyName() throws Exception {
30                 PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getPropertyName();
31         }
32         
33         @Test
34         public void testPropertyNames_GetUpdateBehavior() throws Exception {
35                 PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getUpdateBehavior();
36         }
37         
38         @Test
39         public void testPropertyNames_FindName() throws Exception {
40                 PropertyDefinition.PropertyNames.findName(null);
41                 PropertyDefinition.PropertyNames.findName(PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getPropertyName());
42         }
43         
44         @Test
45         public void testGroupInstancePropertyValueUpdateBehavior_GetLevelName() throws Exception {
46                 PropertyDefinition.GroupInstancePropertyValueUpdateBehavior.NOT_RELEVANT.getLevelName();
47         }
48         
49         @Test
50         public void testGroupInstancePropertyValueUpdateBehavior_GetLevelNumber() throws Exception {
51                 PropertyDefinition.GroupInstancePropertyValueUpdateBehavior.NOT_RELEVANT.getLevelNumber();
52         }
53         
54         @Test
55         public void testGetConstraints() throws Exception {
56                 PropertyDefinition testSubject;
57                 List<PropertyConstraint> result;
58
59                 // default test
60                 testSubject = createTestSubject();
61                 result = testSubject.getConstraints();
62         }
63
64         @Test
65         public void testSetConstraints() throws Exception {
66                 PropertyDefinition testSubject;
67                 List<PropertyConstraint> constraints = null;
68
69                 // default test
70                 testSubject = createTestSubject();
71                 testSubject.setConstraints(constraints);
72         }
73
74         @Test
75         public void testToString() throws Exception {
76                 PropertyDefinition testSubject;
77                 String result;
78
79                 // default test
80                 testSubject = createTestSubject();
81                 result = testSubject.toString();
82         }
83
84         @Test
85         public void testIsDefinition() throws Exception {
86                 PropertyDefinition testSubject;
87                 boolean result;
88
89                 // default test
90                 testSubject = createTestSubject();
91                 result = testSubject.isDefinition();
92         }
93
94         @Test
95         public void testSetDefinition() throws Exception {
96                 PropertyDefinition testSubject;
97                 boolean definition = false;
98
99                 // default test
100                 testSubject = createTestSubject();
101                 testSubject.setDefinition(definition);
102         }
103
104         @Test
105         public void testHashCode() throws Exception {
106                 PropertyDefinition testSubject;
107                 int result;
108
109                 // default test
110                 testSubject = createTestSubject();
111                 result = testSubject.hashCode();
112         }
113
114         @Test
115         public void testEquals() throws Exception {
116                 PropertyDefinition testSubject;
117                 Object obj = null;
118                 boolean result;
119
120                 // default test
121                 testSubject = createTestSubject();
122                 result = testSubject.equals(obj);
123                 
124                 result = testSubject.equals(new Object());
125                 result = testSubject.equals(testSubject);
126                 PropertyDefinition testSubject2 = createTestSubject();
127                 result = testSubject.equals(testSubject2);
128                 testSubject2.setConstraints(new LinkedList<>());
129                 result = testSubject.equals(testSubject2);
130                 testSubject.setConstraints(new LinkedList<>());
131                 result = testSubject.equals(testSubject2);
132                 testSubject2.setName("mock");
133                 result = testSubject.equals(testSubject2);
134                 testSubject.setName("mock");
135                 result = testSubject.equals(testSubject2);
136         }
137 }