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