2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.std.test;
23 import java.util.Hashtable;
27 import org.onap.policy.api.UpdateType;
28 import org.onap.policy.std.StdLoadedPolicy;
30 import static org.junit.Assert.*;
33 * The class <code>StdLoadedPolicyTest</code> contains tests for the class <code>{@link StdLoadedPolicy}</code>.
35 * @generatedBy CodePro at 6/1/16 1:40 PM
36 * @version $Revision: 1.0 $
38 public class StdLoadedPolicyTest {
40 * Run the StdLoadedPolicy() constructor test.
42 * @generatedBy CodePro at 6/1/16 1:40 PM
45 public void testStdLoadedPolicy_1()
47 StdLoadedPolicy result = new StdLoadedPolicy();
48 assertNotNull(result);
49 // add additional test code here
53 * Run the Map<String, String> getMatches() method test.
57 * @generatedBy CodePro at 6/1/16 1:40 PM
60 public void testGetMatches_1()
62 StdLoadedPolicy fixture = new StdLoadedPolicy();
63 fixture.setPolicyName("");
64 fixture.setVersionNo("");
65 fixture.setUpdateType(UpdateType.NEW);
66 fixture.setMatches(new Hashtable<String, String>());
68 Map<String, String> result = fixture.getMatches();
70 // add additional test code here
71 assertNotNull(result);
72 assertEquals(0, result.size());
76 * Run the String getPolicyName() method test.
80 * @generatedBy CodePro at 6/1/16 1:40 PM
83 public void testGetPolicyName_1()
85 StdLoadedPolicy fixture = new StdLoadedPolicy();
86 fixture.setPolicyName("");
87 fixture.setVersionNo("");
88 fixture.setUpdateType(UpdateType.NEW);
89 fixture.setMatches(new Hashtable<String, String>());
91 String result = fixture.getPolicyName();
93 // add additional test code here
94 assertEquals("", result);
98 * Run the String getPolicyName() method test.
102 * @generatedBy CodePro at 6/1/16 1:40 PM
105 public void testGetPolicyName_2()
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>());
113 String result = fixture.getPolicyName();
115 // add additional test code here
116 assertEquals(null, result);
120 * Run the String getPolicyName() method test.
124 * @generatedBy CodePro at 6/1/16 1:40 PM
127 public void testGetPolicyName_3()
129 StdLoadedPolicy fixture = new StdLoadedPolicy();
130 fixture.setPolicyName("");
131 fixture.setVersionNo("");
132 fixture.setUpdateType(UpdateType.NEW);
133 fixture.setMatches(new Hashtable<String, String>());
135 String result = fixture.getPolicyName();
137 // add additional test code here
138 assertEquals("", result);
142 * Run the UpdateType getUpdateType() method test.
146 * @generatedBy CodePro at 6/1/16 1:40 PM
149 public void testGetUpdateType_1()
151 StdLoadedPolicy fixture = new StdLoadedPolicy();
152 fixture.setPolicyName("");
153 fixture.setVersionNo("");
154 fixture.setUpdateType(UpdateType.NEW);
155 fixture.setMatches(new Hashtable<String, String>());
157 UpdateType result = fixture.getUpdateType();
159 // add additional test code here
160 assertNotNull(result);
161 assertEquals("new", result.toString());
162 assertEquals("NEW", result.name());
163 assertEquals(1, result.ordinal());
167 * Run the String getVersionNo() method test.
171 * @generatedBy CodePro at 6/1/16 1:40 PM
174 public void testGetVersionNo_1()
176 StdLoadedPolicy fixture = new StdLoadedPolicy();
177 fixture.setPolicyName("");
178 fixture.setVersionNo("");
179 fixture.setUpdateType(UpdateType.NEW);
180 fixture.setMatches(new Hashtable<String, String>());
182 String result = fixture.getVersionNo();
184 // add additional test code here
185 assertEquals("", result);
189 * Run the void setMatches(Map<String,String>) method test.
193 * @generatedBy CodePro at 6/1/16 1:40 PM
196 public void testSetMatches_1()
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>();
205 fixture.setMatches(matches);
207 // add additional test code here
211 * Run the void setPolicyName(String) method test.
215 * @generatedBy CodePro at 6/1/16 1:40 PM
218 public void testSetPolicyName_1()
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 = "";
227 fixture.setPolicyName(policyName);
229 // add additional test code here
233 * Run the void setUpdateType(UpdateType) method test.
237 * @generatedBy CodePro at 6/1/16 1:40 PM
240 public void testSetUpdateType_1()
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;
249 fixture.setUpdateType(updateType);
251 // add additional test code here
255 * Run the void setVersionNo(String) method test.
259 * @generatedBy CodePro at 6/1/16 1:40 PM
262 public void testSetVersionNo_1()
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 = "";
271 fixture.setVersionNo(versionNo);
273 // add additional test code here
277 * Perform pre-test initialization.
280 * if the initialization fails for some reason
282 * @generatedBy CodePro at 6/1/16 1:40 PM
287 // add additional set up code here
291 * Perform post-test clean-up.
294 * if the clean-up fails for some reason
296 * @generatedBy CodePro at 6/1/16 1:40 PM
299 public void tearDown()
301 // Add additional tear down code here
307 * @param args the command line arguments
309 * @generatedBy CodePro at 6/1/16 1:40 PM
311 public static void main(String[] args) {
312 new org.junit.runner.JUnitCore().run(StdLoadedPolicyTest.class);