1 package org.openecomp.sdc.be.model;
4 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
5 import org.openecomp.sdc.be.model.PropertyDefinition.PropertyNames;
7 import java.util.LinkedList;
11 public class PropertyDefinitionTest {
13 private PropertyDefinition createTestSubject() {
14 return new PropertyDefinition();
18 public void testCtor() throws Exception {
19 new PropertyDefinition(new PropertyDefinition());
20 new PropertyDefinition(new PropertyDataDefinition());
24 public void testPropertyNames() throws Exception {
25 PropertyNames availabiltyZoneCount = PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT;
29 public void testPropertyNames_GetPropertyName() throws Exception {
30 PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getPropertyName();
34 public void testPropertyNames_GetUpdateBehavior() throws Exception {
35 PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getUpdateBehavior();
39 public void testPropertyNames_FindName() throws Exception {
40 PropertyDefinition.PropertyNames.findName(null);
41 PropertyDefinition.PropertyNames.findName(PropertyDefinition.PropertyNames.AVAILABILTY_ZONE_COUNT.getPropertyName());
45 public void testGroupInstancePropertyValueUpdateBehavior_GetLevelName() throws Exception {
46 PropertyDefinition.GroupInstancePropertyValueUpdateBehavior.NOT_RELEVANT.getLevelName();
50 public void testGroupInstancePropertyValueUpdateBehavior_GetLevelNumber() throws Exception {
51 PropertyDefinition.GroupInstancePropertyValueUpdateBehavior.NOT_RELEVANT.getLevelNumber();
55 public void testGetConstraints() throws Exception {
56 PropertyDefinition testSubject;
57 List<PropertyConstraint> result;
60 testSubject = createTestSubject();
61 result = testSubject.getConstraints();
65 public void testSetConstraints() throws Exception {
66 PropertyDefinition testSubject;
67 List<PropertyConstraint> constraints = null;
70 testSubject = createTestSubject();
71 testSubject.setConstraints(constraints);
75 public void testToString() throws Exception {
76 PropertyDefinition testSubject;
80 testSubject = createTestSubject();
81 result = testSubject.toString();
85 public void testIsDefinition() throws Exception {
86 PropertyDefinition testSubject;
90 testSubject = createTestSubject();
91 result = testSubject.isDefinition();
95 public void testSetDefinition() throws Exception {
96 PropertyDefinition testSubject;
97 boolean definition = false;
100 testSubject = createTestSubject();
101 testSubject.setDefinition(definition);
105 public void testHashCode() throws Exception {
106 PropertyDefinition testSubject;
110 testSubject = createTestSubject();
111 result = testSubject.hashCode();
115 public void testEquals() throws Exception {
116 PropertyDefinition testSubject;
121 testSubject = createTestSubject();
122 result = testSubject.equals(obj);
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);