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