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.openecomp.policy.std.test;
23 import java.util.Collection;
24 import java.util.LinkedList;
27 import org.openecomp.policy.api.LoadedPolicy;
28 import org.openecomp.policy.api.NotificationType;
29 import org.openecomp.policy.api.RemovedPolicy;
30 import org.openecomp.policy.std.StdLoadedPolicy;
31 import org.openecomp.policy.std.StdPDPNotification;
32 import org.openecomp.policy.std.StdRemovedPolicy;
34 import static org.junit.Assert.*;
37 * The class <code>StdPDPNotificationTest</code> contains tests for the class <code>{@link StdPDPNotification}</code>.
39 * @generatedBy CodePro at 6/1/16 1:41 PM
40 * @version $Revision: 1.0 $
42 public class StdPDPNotificationTest {
44 * Run the StdPDPNotification() constructor test.
46 * @generatedBy CodePro at 6/1/16 1:41 PM
49 public void testStdPDPNotification_1()
51 StdPDPNotification result = new StdPDPNotification();
52 assertNotNull(result);
53 // add additional test code here
57 * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
61 * @generatedBy CodePro at 6/1/16 1:41 PM
64 public void testGetLoadedPolicies_1()
66 StdPDPNotification fixture = new StdPDPNotification();
67 fixture.setRemovedPolicies(new LinkedList());
68 fixture.setNotificationType(NotificationType.BOTH);
69 fixture.setLoadedPolicies(new LinkedList());
71 Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
73 // add additional test code here
74 assertNotNull(result);
75 assertEquals(0, result.size());
79 * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
83 * @generatedBy CodePro at 6/1/16 1:41 PM
86 public void testGetLoadedPolicies_2()
88 StdPDPNotification fixture = new StdPDPNotification();
89 fixture.setRemovedPolicies(new LinkedList());
90 fixture.setNotificationType(NotificationType.BOTH);
91 fixture.setLoadedPolicies(new LinkedList());
93 Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
95 // add additional test code here
96 assertNotNull(result);
97 assertEquals(0, result.size());
101 * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
105 * @generatedBy CodePro at 6/1/16 1:41 PM
108 public void testGetLoadedPolicies_3()
110 StdPDPNotification fixture = new StdPDPNotification();
111 fixture.setRemovedPolicies(new LinkedList());
112 fixture.setNotificationType(NotificationType.BOTH);
113 fixture.setLoadedPolicies(null);
115 Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
117 // add additional test code here
118 assertEquals(null, result);
122 * Run the NotificationType getNotificationType() method test.
126 * @generatedBy CodePro at 6/1/16 1:41 PM
129 public void testGetNotificationType_1()
131 StdPDPNotification fixture = new StdPDPNotification();
132 fixture.setRemovedPolicies(new LinkedList());
133 fixture.setNotificationType(NotificationType.BOTH);
134 fixture.setLoadedPolicies(new LinkedList());
136 NotificationType result = fixture.getNotificationType();
138 // add additional test code here
139 assertNotNull(result);
140 assertEquals("both", result.toString());
141 assertEquals("BOTH", result.name());
142 assertEquals(2, result.ordinal());
146 * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
150 * @generatedBy CodePro at 6/1/16 1:41 PM
153 public void testGetRemovedPolicies_1()
155 StdPDPNotification fixture = new StdPDPNotification();
156 fixture.setRemovedPolicies(new LinkedList());
157 fixture.setNotificationType(NotificationType.BOTH);
158 fixture.setLoadedPolicies(new LinkedList());
160 Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
162 // add additional test code here
163 assertNotNull(result);
164 assertEquals(0, result.size());
168 * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
172 * @generatedBy CodePro at 6/1/16 1:41 PM
175 public void testGetRemovedPolicies_2()
177 StdPDPNotification fixture = new StdPDPNotification();
178 fixture.setRemovedPolicies(new LinkedList());
179 fixture.setNotificationType(NotificationType.BOTH);
180 fixture.setLoadedPolicies(new LinkedList());
182 Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
184 // add additional test code here
185 assertNotNull(result);
186 assertEquals(0, result.size());
190 * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
194 * @generatedBy CodePro at 6/1/16 1:41 PM
197 public void testGetRemovedPolicies_3()
199 StdPDPNotification fixture = new StdPDPNotification();
200 fixture.setRemovedPolicies(null);
201 fixture.setNotificationType(NotificationType.BOTH);
202 fixture.setLoadedPolicies(new LinkedList());
204 Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
206 // add additional test code here
207 assertEquals(null, result);
211 * Run the void setNotificationType(NotificationType) method test.
215 * @generatedBy CodePro at 6/1/16 1:41 PM
218 public void testSetNotificationType_1()
220 StdPDPNotification fixture = new StdPDPNotification();
221 fixture.setRemovedPolicies(new LinkedList());
222 fixture.setNotificationType(NotificationType.BOTH);
223 fixture.setLoadedPolicies(new LinkedList());
224 NotificationType notificationType = NotificationType.BOTH;
226 fixture.setNotificationType(notificationType);
228 // add additional test code here
232 * Run the void setRemovedPolicies(Collection<StdRemovedPolicy>) method test.
236 * @generatedBy CodePro at 6/1/16 1:41 PM
239 public void testSetRemovedPolicies_1()
241 StdPDPNotification fixture = new StdPDPNotification();
242 fixture.setRemovedPolicies(new LinkedList());
243 fixture.setNotificationType(NotificationType.BOTH);
244 fixture.setLoadedPolicies(new LinkedList());
245 Collection<StdRemovedPolicy> removedPolicies = new LinkedList();
247 fixture.setRemovedPolicies(removedPolicies);
249 // add additional test code here
253 * Run the void setUpdatedPolicies(Collection<StdLoadedPolicy>) method test.
257 * @generatedBy CodePro at 6/1/16 1:41 PM
260 public void testSetUpdatedPolicies_1()
262 StdPDPNotification fixture = new StdPDPNotification();
263 fixture.setRemovedPolicies(new LinkedList());
264 fixture.setNotificationType(NotificationType.BOTH);
265 fixture.setLoadedPolicies(new LinkedList());
266 Collection<StdLoadedPolicy> updatedPolicies = new LinkedList();
268 fixture.setLoadedPolicies(updatedPolicies);
270 // add additional test code here
274 * Perform pre-test initialization.
277 * if the initialization fails for some reason
279 * @generatedBy CodePro at 6/1/16 1:41 PM
284 // add additional set up code here
288 * Perform post-test clean-up.
291 * if the clean-up fails for some reason
293 * @generatedBy CodePro at 6/1/16 1:41 PM
296 public void tearDown()
298 // Add additional tear down code here
304 * @param args the command line arguments
306 * @generatedBy CodePro at 6/1/16 1:41 PM
308 public static void main(String[] args) {
309 new org.junit.runner.JUnitCore().run(StdPDPNotificationTest.class);