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