c45a5aca7bce423643663c4df645a3f3244b589d
[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  * 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.onap.policy.std.test;
22
23 import java.util.Hashtable;
24 import java.util.Map;
25
26 import org.junit.*;
27 import org.onap.policy.api.UpdateType;
28 import org.onap.policy.std.StdLoadedPolicy;
29
30 import static org.junit.Assert.*;
31
32 /**
33  * The class <code>StdLoadedPolicyTest</code> contains tests for the class <code>{@link StdLoadedPolicy}</code>.
34  *
35  * @generatedBy CodePro at 6/1/16 1:40 PM
36  * @version $Revision: 1.0 $
37  */
38 public class StdLoadedPolicyTest {
39         /**
40          * Run the StdLoadedPolicy() constructor test.
41          *
42          * @generatedBy CodePro at 6/1/16 1:40 PM
43          */
44         @Test
45         public void testStdLoadedPolicy_1()
46                 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()
61                 throws Exception {
62                 StdLoadedPolicy fixture = new StdLoadedPolicy();
63                 fixture.setPolicyName("");
64                 fixture.setVersionNo("");
65                 fixture.setUpdateType(UpdateType.NEW);
66                 fixture.setMatches(new Hashtable<String, String>());
67
68                 Map<String, String> result = fixture.getMatches();
69
70                 // add additional test code here
71                 assertNotNull(result);
72                 assertEquals(0, result.size());
73         }
74
75         /**
76          * Run the String getPolicyName() method test.
77          *
78          * @throws Exception
79          *
80          * @generatedBy CodePro at 6/1/16 1:40 PM
81          */
82         @Test
83         public void testGetPolicyName_1()
84                 throws Exception {
85                 StdLoadedPolicy fixture = new StdLoadedPolicy();
86                 fixture.setPolicyName("");
87                 fixture.setVersionNo("");
88                 fixture.setUpdateType(UpdateType.NEW);
89                 fixture.setMatches(new Hashtable<String, String>());
90
91                 String result = fixture.getPolicyName();
92
93                 // add additional test code here
94                 assertEquals("", result);
95         }
96
97         /**
98          * Run the String getPolicyName() method test.
99          *
100          * @throws Exception
101          *
102          * @generatedBy CodePro at 6/1/16 1:40 PM
103          */
104         @Test
105         public void testGetPolicyName_2()
106                 throws Exception {
107                 StdLoadedPolicy fixture = new StdLoadedPolicy();
108                 fixture.setPolicyName((String) null);
109                 fixture.setVersionNo("");
110                 fixture.setUpdateType(UpdateType.NEW);
111                 fixture.setMatches(new Hashtable<String, String>());
112
113                 String result = fixture.getPolicyName();
114
115                 // add additional test code here
116                 assertEquals(null, result);
117         }
118
119         /**
120          * Run the String getPolicyName() method test.
121          *
122          * @throws Exception
123          *
124          * @generatedBy CodePro at 6/1/16 1:40 PM
125          */
126         @Test
127         public void testGetPolicyName_3()
128                 throws Exception {
129                 StdLoadedPolicy fixture = new StdLoadedPolicy();
130                 fixture.setPolicyName("");
131                 fixture.setVersionNo("");
132                 fixture.setUpdateType(UpdateType.NEW);
133                 fixture.setMatches(new Hashtable<String, String>());
134
135                 String result = fixture.getPolicyName();
136
137                 // add additional test code here
138                 assertEquals("", result);
139         }
140
141         /**
142          * Run the UpdateType getUpdateType() method test.
143          *
144          * @throws Exception
145          *
146          * @generatedBy CodePro at 6/1/16 1:40 PM
147          */
148         @Test
149         public void testGetUpdateType_1()
150                 throws Exception {
151                 StdLoadedPolicy fixture = new StdLoadedPolicy();
152                 fixture.setPolicyName("");
153                 fixture.setVersionNo("");
154                 fixture.setUpdateType(UpdateType.NEW);
155                 fixture.setMatches(new Hashtable<String, String>());
156
157                 UpdateType result = fixture.getUpdateType();
158
159                 // add additional test code here
160                 assertNotNull(result);
161                 assertEquals("new", result.toString());
162                 assertEquals("NEW", result.name());
163                 assertEquals(1, result.ordinal());
164         }
165
166         /**
167          * Run the String getVersionNo() method test.
168          *
169          * @throws Exception
170          *
171          * @generatedBy CodePro at 6/1/16 1:40 PM
172          */
173         @Test
174         public void testGetVersionNo_1()
175                 throws Exception {
176                 StdLoadedPolicy fixture = new StdLoadedPolicy();
177                 fixture.setPolicyName("");
178                 fixture.setVersionNo("");
179                 fixture.setUpdateType(UpdateType.NEW);
180                 fixture.setMatches(new Hashtable<String, String>());
181
182                 String result = fixture.getVersionNo();
183
184                 // add additional test code here
185                 assertEquals("", result);
186         }
187
188         /**
189          * Run the void setMatches(Map<String,String>) method test.
190          *
191          * @throws Exception
192          *
193          * @generatedBy CodePro at 6/1/16 1:40 PM
194          */
195         @Test
196         public void testSetMatches_1()
197                 throws Exception {
198                 StdLoadedPolicy fixture = new StdLoadedPolicy();
199                 fixture.setPolicyName("");
200                 fixture.setVersionNo("");
201                 fixture.setUpdateType(UpdateType.NEW);
202                 fixture.setMatches(new Hashtable<String, String>());
203                 Map<String, String> matches = new Hashtable<String, String>();
204
205                 fixture.setMatches(matches);
206
207                 // add additional test code here
208         }
209
210         /**
211          * Run the void setPolicyName(String) method test.
212          *
213          * @throws Exception
214          *
215          * @generatedBy CodePro at 6/1/16 1:40 PM
216          */
217         @Test
218         public void testSetPolicyName_1()
219                 throws Exception {
220                 StdLoadedPolicy fixture = new StdLoadedPolicy();
221                 fixture.setPolicyName("");
222                 fixture.setVersionNo("");
223                 fixture.setUpdateType(UpdateType.NEW);
224                 fixture.setMatches(new Hashtable<String, String>());
225                 String policyName = "";
226
227                 fixture.setPolicyName(policyName);
228
229                 // add additional test code here
230         }
231
232         /**
233          * Run the void setUpdateType(UpdateType) method test.
234          *
235          * @throws Exception
236          *
237          * @generatedBy CodePro at 6/1/16 1:40 PM
238          */
239         @Test
240         public void testSetUpdateType_1()
241                 throws Exception {
242                 StdLoadedPolicy fixture = new StdLoadedPolicy();
243                 fixture.setPolicyName("");
244                 fixture.setVersionNo("");
245                 fixture.setUpdateType(UpdateType.NEW);
246                 fixture.setMatches(new Hashtable<String, String>());
247                 UpdateType updateType = UpdateType.NEW;
248
249                 fixture.setUpdateType(updateType);
250
251                 // add additional test code here
252         }
253
254         /**
255          * Run the void setVersionNo(String) method test.
256          *
257          * @throws Exception
258          *
259          * @generatedBy CodePro at 6/1/16 1:40 PM
260          */
261         @Test
262         public void testSetVersionNo_1()
263                 throws Exception {
264                 StdLoadedPolicy fixture = new StdLoadedPolicy();
265                 fixture.setPolicyName("");
266                 fixture.setVersionNo("");
267                 fixture.setUpdateType(UpdateType.NEW);
268                 fixture.setMatches(new Hashtable<String, String>());
269                 String versionNo = "";
270
271                 fixture.setVersionNo(versionNo);
272
273                 // add additional test code here
274         }
275
276         /**
277          * Perform pre-test initialization.
278          *
279          * @throws Exception
280          *         if the initialization fails for some reason
281          *
282          * @generatedBy CodePro at 6/1/16 1:40 PM
283          */
284         @Before
285         public void setUp()
286                 throws Exception {
287                 // add additional set up code here
288         }
289
290         /**
291          * Perform post-test clean-up.
292          *
293          * @throws Exception
294          *         if the clean-up fails for some reason
295          *
296          * @generatedBy CodePro at 6/1/16 1:40 PM
297          */
298         @After
299         public void tearDown()
300                 throws Exception {
301                 // Add additional tear down code here
302         }
303
304         /**
305          * Launch the test.
306          *
307          * @param args the command line arguments
308          *
309          * @generatedBy CodePro at 6/1/16 1:40 PM
310          */
311         public static void main(String[] args) {
312                 new org.junit.runner.JUnitCore().run(StdLoadedPolicyTest.class);
313         }
314 }