Reformat PolicyEngineAPI test cases
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / std / test / StdLoadedPolicyTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * PolicyEngineAPI
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Modifications Copyright (C) 2019 Samsung
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.policy.std.test;
24
25 import java.util.Hashtable;
26 import java.util.Map;
27 import org.junit.*;
28 import org.onap.policy.api.UpdateType;
29 import org.onap.policy.std.StdLoadedPolicy;
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>StdLoadedPolicyTest</code> contains tests for the class
34  * <code>{@link StdLoadedPolicy}</code>.
35  *
36  * @generatedBy CodePro at 6/1/16 1:40 PM
37  * @version $Revision: 1.0 $
38  */
39 public class StdLoadedPolicyTest {
40     /**
41      * Run the StdLoadedPolicy() constructor test.
42      *
43      * @generatedBy CodePro at 6/1/16 1:40 PM
44      */
45     @Test
46     public void testStdLoadedPolicy_1() throws Exception {
47         StdLoadedPolicy result = new StdLoadedPolicy();
48         assertNotNull(result);
49         // add additional test code here
50     }
51
52     /**
53      * Run the Map<String, String> getMatches() method test.
54      *
55      * @throws Exception
56      *
57      * @generatedBy CodePro at 6/1/16 1:40 PM
58      */
59     @Test
60     public void testGetMatches_1() throws Exception {
61         StdLoadedPolicy fixture = new StdLoadedPolicy();
62         fixture.setPolicyName("");
63         fixture.setVersionNo("");
64         fixture.setUpdateType(UpdateType.NEW);
65         fixture.setMatches(new Hashtable<String, String>());
66
67         Map<String, String> result = fixture.getMatches();
68
69         // add additional test code here
70         assertNotNull(result);
71         assertEquals(0, result.size());
72     }
73
74     /**
75      * Run the String getPolicyName() method test.
76      *
77      * @throws Exception
78      *
79      * @generatedBy CodePro at 6/1/16 1:40 PM
80      */
81     @Test
82     public void testGetPolicyName_1() throws Exception {
83         StdLoadedPolicy fixture = new StdLoadedPolicy();
84         fixture.setPolicyName("");
85         fixture.setVersionNo("");
86         fixture.setUpdateType(UpdateType.NEW);
87         fixture.setMatches(new Hashtable<String, String>());
88
89         String result = fixture.getPolicyName();
90
91         // add additional test code here
92         assertEquals("", result);
93     }
94
95     /**
96      * Run the String getPolicyName() method test.
97      *
98      * @throws Exception
99      *
100      * @generatedBy CodePro at 6/1/16 1:40 PM
101      */
102     @Test
103     public void testGetPolicyName_2() throws Exception {
104         StdLoadedPolicy fixture = new StdLoadedPolicy();
105         fixture.setPolicyName((String) null);
106         fixture.setVersionNo("");
107         fixture.setUpdateType(UpdateType.NEW);
108         fixture.setMatches(new Hashtable<String, String>());
109
110         String result = fixture.getPolicyName();
111
112         // add additional test code here
113         assertEquals(null, result);
114     }
115
116     /**
117      * Run the String getPolicyName() method test.
118      *
119      * @throws Exception
120      *
121      * @generatedBy CodePro at 6/1/16 1:40 PM
122      */
123     @Test
124     public void testGetPolicyName_3() throws Exception {
125         StdLoadedPolicy fixture = new StdLoadedPolicy();
126         fixture.setPolicyName("");
127         fixture.setVersionNo("");
128         fixture.setUpdateType(UpdateType.NEW);
129         fixture.setMatches(new Hashtable<String, String>());
130
131         String result = fixture.getPolicyName();
132
133         // add additional test code here
134         assertEquals("", result);
135     }
136
137     /**
138      * Run the UpdateType getUpdateType() method test.
139      *
140      * @throws Exception
141      *
142      * @generatedBy CodePro at 6/1/16 1:40 PM
143      */
144     @Test
145     public void testGetUpdateType_1() throws Exception {
146         StdLoadedPolicy fixture = new StdLoadedPolicy();
147         fixture.setPolicyName("");
148         fixture.setVersionNo("");
149         fixture.setUpdateType(UpdateType.NEW);
150         fixture.setMatches(new Hashtable<String, String>());
151
152         UpdateType result = fixture.getUpdateType();
153
154         // add additional test code here
155         assertNotNull(result);
156         assertEquals("new", result.toString());
157         assertEquals("NEW", result.name());
158         assertEquals(1, result.ordinal());
159     }
160
161     /**
162      * Run the String getVersionNo() method test.
163      *
164      * @throws Exception
165      *
166      * @generatedBy CodePro at 6/1/16 1:40 PM
167      */
168     @Test
169     public void testGetVersionNo_1() throws Exception {
170         StdLoadedPolicy fixture = new StdLoadedPolicy();
171         fixture.setPolicyName("");
172         fixture.setVersionNo("");
173         fixture.setUpdateType(UpdateType.NEW);
174         fixture.setMatches(new Hashtable<String, String>());
175
176         String result = fixture.getVersionNo();
177
178         // add additional test code here
179         assertEquals("", result);
180     }
181
182     /**
183      * Run the void setMatches(Map<String,String>) method test.
184      *
185      * @throws Exception
186      *
187      * @generatedBy CodePro at 6/1/16 1:40 PM
188      */
189     @Test
190     public void testSetMatches_1() throws Exception {
191         StdLoadedPolicy fixture = new StdLoadedPolicy();
192         fixture.setPolicyName("");
193         fixture.setVersionNo("");
194         fixture.setUpdateType(UpdateType.NEW);
195         fixture.setMatches(new Hashtable<String, String>());
196         Map<String, String> matches = new Hashtable<String, String>();
197
198         fixture.setMatches(matches);
199
200         // add additional test code here
201     }
202
203     /**
204      * Run the void setPolicyName(String) method test.
205      *
206      * @throws Exception
207      *
208      * @generatedBy CodePro at 6/1/16 1:40 PM
209      */
210     @Test
211     public void testSetPolicyName_1() throws Exception {
212         StdLoadedPolicy fixture = new StdLoadedPolicy();
213         fixture.setPolicyName("");
214         fixture.setVersionNo("");
215         fixture.setUpdateType(UpdateType.NEW);
216         fixture.setMatches(new Hashtable<String, String>());
217         String policyName = "";
218
219         fixture.setPolicyName(policyName);
220
221         // add additional test code here
222     }
223
224     /**
225      * Run the void setUpdateType(UpdateType) method test.
226      *
227      * @throws Exception
228      *
229      * @generatedBy CodePro at 6/1/16 1:40 PM
230      */
231     @Test
232     public void testSetUpdateType_1() throws Exception {
233         StdLoadedPolicy fixture = new StdLoadedPolicy();
234         fixture.setPolicyName("");
235         fixture.setVersionNo("");
236         fixture.setUpdateType(UpdateType.NEW);
237         fixture.setMatches(new Hashtable<String, String>());
238         UpdateType updateType = UpdateType.NEW;
239
240         fixture.setUpdateType(updateType);
241
242         // add additional test code here
243     }
244
245     /**
246      * Run the void setVersionNo(String) method test.
247      *
248      * @throws Exception
249      *
250      * @generatedBy CodePro at 6/1/16 1:40 PM
251      */
252     @Test
253     public void testSetVersionNo_1() throws Exception {
254         StdLoadedPolicy fixture = new StdLoadedPolicy();
255         fixture.setPolicyName("");
256         fixture.setVersionNo("");
257         fixture.setUpdateType(UpdateType.NEW);
258         fixture.setMatches(new Hashtable<String, String>());
259         String versionNo = "";
260
261         fixture.setVersionNo(versionNo);
262
263         // add additional test code here
264     }
265
266     /**
267      * Perform pre-test initialization.
268      *
269      * @throws Exception if the initialization fails for some reason
270      *
271      * @generatedBy CodePro at 6/1/16 1:40 PM
272      */
273     @Before
274     public void setUp() throws Exception {
275         // add additional set up code here
276     }
277
278     /**
279      * Perform post-test clean-up.
280      *
281      * @throws Exception if the clean-up fails for some reason
282      *
283      * @generatedBy CodePro at 6/1/16 1:40 PM
284      */
285     @After
286     public void tearDown() throws Exception {
287         // Add additional tear down code here
288     }
289
290     /**
291      * Launch the test.
292      *
293      * @param args the command line arguments
294      *
295      * @generatedBy CodePro at 6/1/16 1:40 PM
296      */
297     public static void main(String[] args) {
298         new org.junit.runner.JUnitCore().run(StdLoadedPolicyTest.class);
299     }
300 }