2 * ============LICENSE_START=======================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
23 package org.onap.policy.std.test;
25 import java.util.Hashtable;
28 import org.onap.policy.api.UpdateType;
29 import org.onap.policy.std.StdLoadedPolicy;
30 import static org.junit.Assert.*;
33 * The class <code>StdLoadedPolicyTest</code> contains tests for the class
34 * <code>{@link StdLoadedPolicy}</code>.
36 * @generatedBy CodePro at 6/1/16 1:40 PM
37 * @version $Revision: 1.0 $
39 public class StdLoadedPolicyTest {
41 * Run the StdLoadedPolicy() constructor test.
43 * @generatedBy CodePro at 6/1/16 1:40 PM
46 public void testStdLoadedPolicy_1() throws Exception {
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() 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>());
67 Map<String, String> result = fixture.getMatches();
69 // add additional test code here
70 assertNotNull(result);
71 assertEquals(0, result.size());
75 * Run the String getPolicyName() method test.
79 * @generatedBy CodePro at 6/1/16 1:40 PM
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>());
89 String result = fixture.getPolicyName();
91 // add additional test code here
92 assertEquals("", result);
96 * Run the String getPolicyName() method test.
100 * @generatedBy CodePro at 6/1/16 1:40 PM
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>());
110 String result = fixture.getPolicyName();
112 // add additional test code here
113 assertEquals(null, result);
117 * Run the String getPolicyName() method test.
121 * @generatedBy CodePro at 6/1/16 1:40 PM
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>());
131 String result = fixture.getPolicyName();
133 // add additional test code here
134 assertEquals("", result);
138 * Run the UpdateType getUpdateType() method test.
142 * @generatedBy CodePro at 6/1/16 1:40 PM
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>());
152 UpdateType result = fixture.getUpdateType();
154 // add additional test code here
155 assertNotNull(result);
156 assertEquals("new", result.toString());
157 assertEquals("NEW", result.name());
158 assertEquals(1, result.ordinal());
162 * Run the String getVersionNo() method test.
166 * @generatedBy CodePro at 6/1/16 1:40 PM
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>());
176 String result = fixture.getVersionNo();
178 // add additional test code here
179 assertEquals("", result);
183 * Run the void setMatches(Map<String,String>) method test.
187 * @generatedBy CodePro at 6/1/16 1:40 PM
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>();
198 fixture.setMatches(matches);
200 // add additional test code here
204 * Run the void setPolicyName(String) method test.
208 * @generatedBy CodePro at 6/1/16 1:40 PM
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 = "";
219 fixture.setPolicyName(policyName);
221 // add additional test code here
225 * Run the void setUpdateType(UpdateType) method test.
229 * @generatedBy CodePro at 6/1/16 1:40 PM
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;
240 fixture.setUpdateType(updateType);
242 // add additional test code here
246 * Run the void setVersionNo(String) method test.
250 * @generatedBy CodePro at 6/1/16 1:40 PM
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 = "";
261 fixture.setVersionNo(versionNo);
263 // add additional test code here
267 * Perform pre-test initialization.
269 * @throws Exception if the initialization fails for some reason
271 * @generatedBy CodePro at 6/1/16 1:40 PM
274 public void setUp() throws Exception {
275 // add additional set up code here
279 * Perform post-test clean-up.
281 * @throws Exception if the clean-up fails for some reason
283 * @generatedBy CodePro at 6/1/16 1:40 PM
286 public void tearDown() throws Exception {
287 // Add additional tear down code here
293 * @param args the command line arguments
295 * @generatedBy CodePro at 6/1/16 1:40 PM
297 public static void main(String[] args) {
298 new org.junit.runner.JUnitCore().run(StdLoadedPolicyTest.class);