Reformat PolicyEngineAPI test cases
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / std / test / StdPDPNotificationTest.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.Collection;
26 import java.util.Collections;
27 import java.util.LinkedList;
28 import org.junit.*;
29 import org.onap.policy.api.LoadedPolicy;
30 import org.onap.policy.api.NotificationType;
31 import org.onap.policy.api.RemovedPolicy;
32 import org.onap.policy.std.StdLoadedPolicy;
33 import org.onap.policy.std.StdPDPNotification;
34 import org.onap.policy.std.StdRemovedPolicy;
35 import static org.junit.Assert.*;
36
37 /**
38  * The class <code>StdPDPNotificationTest</code> contains tests for the class
39  * <code>{@link StdPDPNotification}</code>.
40  *
41  * @generatedBy CodePro at 6/1/16 1:41 PM
42  * @version $Revision: 1.0 $
43  */
44 public class StdPDPNotificationTest {
45     /**
46      * Run the StdPDPNotification() constructor test.
47      *
48      * @generatedBy CodePro at 6/1/16 1:41 PM
49      */
50     @Test
51     public void testStdPDPNotification_1() throws Exception {
52         StdPDPNotification result = new StdPDPNotification();
53         assertNotNull(result);
54         // add additional test code here
55     }
56
57     /**
58      * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
59      *
60      * @throws Exception
61      *
62      * @generatedBy CodePro at 6/1/16 1:41 PM
63      */
64     @Test
65     public void testGetLoadedPolicies_1() throws Exception {
66         StdPDPNotification fixture = new StdPDPNotification();
67         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
68         fixture.setNotificationType(NotificationType.BOTH);
69         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
70
71         Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
72
73         // add additional test code here
74         assertNotNull(result);
75         assertEquals(0, result.size());
76     }
77
78     /**
79      * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
80      *
81      * @throws Exception
82      *
83      * @generatedBy CodePro at 6/1/16 1:41 PM
84      */
85     @Test
86     public void testGetLoadedPolicies_2() throws Exception {
87         StdPDPNotification fixture = new StdPDPNotification();
88         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
89         fixture.setNotificationType(NotificationType.BOTH);
90         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
91
92         Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
93
94         // add additional test code here
95         assertNotNull(result);
96         assertEquals(0, result.size());
97     }
98
99     /**
100      * Run the Collection<LoadedPolicy> getLoadedPolicies() method test.
101      *
102      * @throws Exception
103      *
104      * @generatedBy CodePro at 6/1/16 1:41 PM
105      */
106     @Test
107     public void testGetLoadedPolicies_3() throws Exception {
108         StdPDPNotification fixture = new StdPDPNotification();
109         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
110         fixture.setNotificationType(NotificationType.BOTH);
111         fixture.setLoadedPolicies(null);
112
113         Collection<LoadedPolicy> result = fixture.getLoadedPolicies();
114
115         // add additional test code here
116         assertEquals(Collections.EMPTY_LIST, result);
117     }
118
119     /**
120      * Run the NotificationType getNotificationType() method test.
121      *
122      * @throws Exception
123      *
124      * @generatedBy CodePro at 6/1/16 1:41 PM
125      */
126     @Test
127     public void testGetNotificationType_1() throws Exception {
128         StdPDPNotification fixture = new StdPDPNotification();
129         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
130         fixture.setNotificationType(NotificationType.BOTH);
131         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
132
133         NotificationType result = fixture.getNotificationType();
134
135         // add additional test code here
136         assertNotNull(result);
137         assertEquals("both", result.toString());
138         assertEquals("BOTH", result.name());
139         assertEquals(2, result.ordinal());
140     }
141
142     /**
143      * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
144      *
145      * @throws Exception
146      *
147      * @generatedBy CodePro at 6/1/16 1:41 PM
148      */
149     @Test
150     public void testGetRemovedPolicies_1() throws Exception {
151         StdPDPNotification fixture = new StdPDPNotification();
152         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
153         fixture.setNotificationType(NotificationType.BOTH);
154         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
155
156         Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
157
158         // add additional test code here
159         assertNotNull(result);
160         assertEquals(0, result.size());
161     }
162
163     /**
164      * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
165      *
166      * @throws Exception
167      *
168      * @generatedBy CodePro at 6/1/16 1:41 PM
169      */
170     @Test
171     public void testGetRemovedPolicies_2() throws Exception {
172         StdPDPNotification fixture = new StdPDPNotification();
173         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
174         fixture.setNotificationType(NotificationType.BOTH);
175         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
176
177         Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
178
179         // add additional test code here
180         assertNotNull(result);
181         assertEquals(0, result.size());
182     }
183
184     /**
185      * Run the Collection<RemovedPolicy> getRemovedPolicies() method test.
186      *
187      * @throws Exception
188      *
189      * @generatedBy CodePro at 6/1/16 1:41 PM
190      */
191     @Test
192     public void testGetRemovedPolicies_3() throws Exception {
193         StdPDPNotification fixture = new StdPDPNotification();
194         fixture.setRemovedPolicies(null);
195         fixture.setNotificationType(NotificationType.BOTH);
196         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
197
198         Collection<RemovedPolicy> result = fixture.getRemovedPolicies();
199
200         // add additional test code here
201         assertEquals(Collections.EMPTY_LIST, result);
202     }
203
204     /**
205      * Run the void setNotificationType(NotificationType) method test.
206      *
207      * @throws Exception
208      *
209      * @generatedBy CodePro at 6/1/16 1:41 PM
210      */
211     @Test
212     public void testSetNotificationType_1() throws Exception {
213         StdPDPNotification fixture = new StdPDPNotification();
214         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
215         fixture.setNotificationType(NotificationType.BOTH);
216         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
217         NotificationType notificationType = NotificationType.BOTH;
218
219         fixture.setNotificationType(notificationType);
220
221         // add additional test code here
222     }
223
224     /**
225      * Run the void setRemovedPolicies(Collection<StdRemovedPolicy>) method test.
226      *
227      * @throws Exception
228      *
229      * @generatedBy CodePro at 6/1/16 1:41 PM
230      */
231     @Test
232     public void testSetRemovedPolicies_1() throws Exception {
233         StdPDPNotification fixture = new StdPDPNotification();
234         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
235         fixture.setNotificationType(NotificationType.BOTH);
236         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
237         Collection<StdRemovedPolicy> removedPolicies = new LinkedList<StdRemovedPolicy>();
238
239         fixture.setRemovedPolicies(removedPolicies);
240
241         // add additional test code here
242     }
243
244     /**
245      * Run the void setUpdatedPolicies(Collection<StdLoadedPolicy>) method test.
246      *
247      * @throws Exception
248      *
249      * @generatedBy CodePro at 6/1/16 1:41 PM
250      */
251     @Test
252     public void testSetUpdatedPolicies_1() throws Exception {
253         StdPDPNotification fixture = new StdPDPNotification();
254         fixture.setRemovedPolicies(new LinkedList<StdRemovedPolicy>());
255         fixture.setNotificationType(NotificationType.BOTH);
256         fixture.setLoadedPolicies(new LinkedList<StdLoadedPolicy>());
257         Collection<StdLoadedPolicy> updatedPolicies = new LinkedList<StdLoadedPolicy>();
258
259         fixture.setLoadedPolicies(updatedPolicies);
260
261         // add additional test code here
262     }
263
264     /**
265      * Perform pre-test initialization.
266      *
267      * @throws Exception if the initialization fails for some reason
268      *
269      * @generatedBy CodePro at 6/1/16 1:41 PM
270      */
271     @Before
272     public void setUp() throws Exception {
273         // add additional set up code here
274     }
275
276     /**
277      * Perform post-test clean-up.
278      *
279      * @throws Exception if the clean-up fails for some reason
280      *
281      * @generatedBy CodePro at 6/1/16 1:41 PM
282      */
283     @After
284     public void tearDown() throws Exception {
285         // Add additional tear down code here
286     }
287
288     /**
289      * Launch the test.
290      *
291      * @param args the command line arguments
292      *
293      * @generatedBy CodePro at 6/1/16 1:41 PM
294      */
295     public static void main(String[] args) {
296         new org.junit.runner.JUnitCore().run(StdPDPNotificationTest.class);
297     }
298 }