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.onap.policy.std.test;
23 import java.util.LinkedList;
24 import java.util.List;
27 import org.onap.policy.api.NotificationHandler;
28 import org.onap.policy.api.NotificationScheme;
29 import org.onap.policy.std.AutoClientUEB;
31 import static org.junit.Assert.*;
34 * The class <code>AutoClientUEBTest</code> contains tests for the class <code>{@link AutoClientUEB}</code>.
36 * @generatedBy CodePro at 6/1/16 1:40 PM
37 * @version $Revision: 1.0 $
39 public class AutoClientUEBTest {
41 * Run the AutoClientUEB(String,List<String>) constructor test.
45 * @generatedBy CodePro at 6/1/16 1:40 PM
48 public void testAutoClientUEB_1()
52 String apiSecret = "";
53 List<String> uebURLList = new LinkedList<String>();
55 AutoClientUEB result = new AutoClientUEB(url, uebURLList, apiKey, apiSecret);
57 // add additional test code here
58 // An unexpected exception was thrown in user code while executing this test:
59 // java.lang.ExceptionInInitializerError
60 // at org.apache.log4j.Logger.getLogger(Logger.java:104)
61 // at org.onap.policy.std.AutoClientUEB.<clinit>(AutoClientUEB.java:39)
62 assertNotNull(result);
66 * Run the String getNotficationType() method test.
70 * @generatedBy CodePro at 6/1/16 1:40 PM
73 public void testGetNotficationType_1()
76 String result = AutoClientUEB.getNotficationType();
78 // add additional test code here
79 // An unexpected exception was thrown in user code while executing this test:
80 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
85 * Run the boolean getStatus() method test.
89 * @generatedBy CodePro at 6/1/16 1:40 PM
92 public void testGetStatus_1()
95 boolean result = AutoClientUEB.getStatus();
97 // add additional test code here
98 // An unexpected exception was thrown in user code while executing this test:
99 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
104 * Run the String getURL() method test.
108 * @generatedBy CodePro at 6/1/16 1:40 PM
111 public void testGetURL_1()
114 String result = AutoClientUEB.getURL();
116 // add additional test code here
117 // An unexpected exception was thrown in user code while executing this test:
118 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
119 assertNotNull(result);
123 * Run the boolean isRunning() method test.
127 * @generatedBy CodePro at 6/1/16 1:40 PM
130 public void testIsRunning_1()
132 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
133 fixture.isRunning = true;
135 boolean result = fixture.isRunning();
137 // add additional test code here
138 // An unexpected exception was thrown in user code while executing this test:
139 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
144 * Run the void run() method test.
148 * @generatedBy CodePro at 6/1/16 1:40 PM
151 public void testRun_1()
153 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
154 fixture.isRunning = true;
158 // add additional test code here
159 // An unexpected exception was thrown in user code while executing this test:
160 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
164 * Run the void run() method test.
168 * @generatedBy CodePro at 6/1/16 1:40 PM
171 public void testRun_2()
173 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
174 fixture.isRunning = true;
178 // add additional test code here
179 // An unexpected exception was thrown in user code while executing this test:
180 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
184 * Run the void run() method test.
188 * @generatedBy CodePro at 6/1/16 1:40 PM
191 public void testRun_3()
193 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
194 fixture.isRunning = true;
198 // add additional test code here
199 // An unexpected exception was thrown in user code while executing this test:
200 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
204 * Run the void run() method test.
208 * @generatedBy CodePro at 6/1/16 1:40 PM
211 public void testRun_4()
213 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(), "", "");
214 fixture.isRunning = true;
218 // add additional test code here
219 // An unexpected exception was thrown in user code while executing this test:
220 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
224 * Run the void run() method test.
228 * @generatedBy CodePro at 6/1/16 1:40 PM
231 public void testRun_5()
233 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
234 fixture.isRunning = true;
238 // add additional test code here
239 // An unexpected exception was thrown in user code while executing this test:
240 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
244 * Run the void run() method test.
248 * @generatedBy CodePro at 6/1/16 1:40 PM
251 public void testRun_6()
253 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
254 fixture.isRunning = true;
258 // add additional test code here
259 // An unexpected exception was thrown in user code while executing this test:
260 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
264 * Run the void run() method test.
268 * @generatedBy CodePro at 6/1/16 1:40 PM
271 public void testRun_7()
273 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
274 fixture.isRunning = true;
278 // add additional test code here
279 // An unexpected exception was thrown in user code while executing this test:
280 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
284 * Run the void run() method test.
288 * @generatedBy CodePro at 6/1/16 1:40 PM
291 public void testRun_8()
293 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
294 fixture.isRunning = true;
298 // add additional test code here
299 // An unexpected exception was thrown in user code while executing this test:
300 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
304 * Run the void run() method test.
308 * @generatedBy CodePro at 6/1/16 1:40 PM
311 public void testRun_9()
313 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
314 fixture.isRunning = true;
318 // add additional test code here
319 // An unexpected exception was thrown in user code while executing this test:
320 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
324 * Run the void run() method test.
328 * @generatedBy CodePro at 6/1/16 1:40 PM
331 public void testRun_10()
333 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
334 fixture.isRunning = true;
338 // add additional test code here
339 // An unexpected exception was thrown in user code while executing this test:
340 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
344 * Run the void run() method test.
348 * @generatedBy CodePro at 6/1/16 1:40 PM
351 public void testRun_11()
353 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
354 fixture.isRunning = true;
358 // add additional test code here
359 // An unexpected exception was thrown in user code while executing this test:
360 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
364 * Run the void run() method test.
368 * @generatedBy CodePro at 6/1/16 1:40 PM
371 public void testRun_12()
373 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
374 fixture.isRunning = true;
378 // add additional test code here
379 // An unexpected exception was thrown in user code while executing this test:
380 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
384 * Run the void run() method test.
388 * @generatedBy CodePro at 6/1/16 1:40 PM
391 public void testRun_13()
393 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
394 fixture.isRunning = true;
398 // add additional test code here
399 // An unexpected exception was thrown in user code while executing this test:
400 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
404 * Run the void run() method test.
408 * @generatedBy CodePro at 6/1/16 1:40 PM
411 public void testRun_14()
413 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
414 fixture.isRunning = true;
418 // add additional test code here
419 // An unexpected exception was thrown in user code while executing this test:
420 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
424 * Run the void run() method test.
428 * @generatedBy CodePro at 6/1/16 1:40 PM
431 public void testRun_15()
433 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
434 fixture.isRunning = true;
438 // add additional test code here
439 // An unexpected exception was thrown in user code while executing this test:
440 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
444 * Run the void run() method test.
448 * @generatedBy CodePro at 6/1/16 1:40 PM
451 public void testRun_16()
453 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
454 fixture.isRunning = true;
458 // add additional test code here
459 // An unexpected exception was thrown in user code while executing this test:
460 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
464 * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
468 * @generatedBy CodePro at 6/1/16 1:40 PM
471 public void testSetAuto_1()
473 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
474 fixture.isRunning = true;
475 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
476 NotificationHandler handler = null;
478 fixture.setAuto(scheme, handler);
480 // add additional test code here
481 // An unexpected exception was thrown in user code while executing this test:
482 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
486 * Run the void setScheme(NotificationScheme) method test.
490 * @generatedBy CodePro at 6/1/16 1:40 PM
493 public void testSetScheme_1()
495 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
497 AutoClientUEB.setScheme(scheme);
499 // add additional test code here
500 // An unexpected exception was thrown in user code while executing this test:
501 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
505 * Run the void terminate() method test.
509 * @generatedBy CodePro at 6/1/16 1:40 PM
512 public void testTerminate_1()
514 AutoClientUEB fixture = new AutoClientUEB("", new LinkedList<String>(),"","");
515 fixture.isRunning = true;
519 // add additional test code here
520 // An unexpected exception was thrown in user code while executing this test:
521 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientUEB
525 * Perform pre-test initialization.
528 * if the initialization fails for some reason
530 * @generatedBy CodePro at 6/1/16 1:40 PM
535 // add set up code here
536 List<String> urlList = new LinkedList<String>();
537 urlList.add("test2.com");
538 AutoClientUEB client = new AutoClientUEB("test.com", urlList, "testKey", "testSecret");
539 NotificationHandler handler = null;
540 client.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
544 * Perform post-test clean-up.
547 * if the clean-up fails for some reason
549 * @generatedBy CodePro at 6/1/16 1:40 PM
552 public void tearDown()
554 // Add additional tear down code here
560 * @param args the command line arguments
562 * @generatedBy CodePro at 6/1/16 1:40 PM
564 public static void main(String[] args) {
565 new org.junit.runner.JUnitCore().run(AutoClientUEBTest.class);