Added oparent to sdc main
[sdc.git] / common-be / src / test / java / org / openecomp / sdc / be / datatypes / elements / PropertyRuleTest.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.datatypes.elements;
22
23 import org.junit.Assert;
24 import org.junit.Test;
25
26 import java.util.LinkedList;
27 import java.util.List;
28
29 public class PropertyRuleTest {
30
31         private PropertyRule createTestSubject() {
32                 return new PropertyRule();
33         }
34
35         @Test
36         public void testConstructor() throws Exception {
37                 PropertyRule testSubject;
38                 List<String> result;
39
40                 // default test
41                 testSubject = createTestSubject();
42                 new PropertyRule(new LinkedList<>(), "");
43         }
44         
45         @Test
46         public void testGetRule() throws Exception {
47                 PropertyRule testSubject;
48                 List<String> result;
49
50                 // default test
51                 testSubject = createTestSubject();
52                 result = testSubject.getRule();
53         }
54
55         @Test
56         public void testSetRule() throws Exception {
57                 PropertyRule testSubject;
58                 List<String> rule = null;
59
60                 // default test
61                 testSubject = createTestSubject();
62                 testSubject.setRule(rule);
63         }
64
65         @Test
66         public void testGetValue() throws Exception {
67                 PropertyRule testSubject;
68                 String result;
69
70                 // default test
71                 testSubject = createTestSubject();
72                 result = testSubject.getValue();
73         }
74
75         @Test
76         public void testSetValue() throws Exception {
77                 PropertyRule testSubject;
78                 String value = "";
79
80                 // default test
81                 testSubject = createTestSubject();
82                 testSubject.setValue(value);
83         }
84
85         @Test
86         public void testGetFirstToken() throws Exception {
87                 PropertyRule testSubject;
88                 String result;
89
90                 // default test
91                 testSubject = createTestSubject();
92                 result = testSubject.getFirstToken();
93         }
94
95         @Test
96         public void testGetToken() throws Exception {
97                 PropertyRule testSubject;
98                 int tokenNumber = 0;
99                 String result;
100
101                 // default test
102                 testSubject = createTestSubject();
103                 result = testSubject.getToken(tokenNumber);
104         }
105
106         @Test
107         public void testGetRuleSize() throws Exception {
108                 PropertyRule testSubject;
109                 int result;
110
111                 // default test
112                 testSubject = createTestSubject();
113                 result = testSubject.getRuleSize();
114         }
115
116         @Test
117         public void testToString() throws Exception {
118                 PropertyRule testSubject;
119                 String result;
120
121                 // default test
122                 testSubject = createTestSubject();
123                 result = testSubject.toString();
124         }
125
126         @Test
127         public void testCompareRule() throws Exception {
128                 PropertyRule testSubject;
129                 PropertyRule comparedPropertyRule = null;
130                 boolean result;
131
132                 // test 1
133                 testSubject = createTestSubject();
134                 comparedPropertyRule = null;
135                 result = testSubject.compareRule(comparedPropertyRule);
136                 Assert.assertEquals(false, result);
137         }
138
139         @Test
140         public void testReplaceFirstToken() throws Exception {
141                 PropertyRule testSubject;
142                 String token = "";
143
144                 // default test
145                 testSubject = createTestSubject();
146                 testSubject.replaceFirstToken(token);
147         }
148 }