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 static org.junit.Assert.assertNotNull;
25 import org.junit.After;
26 import org.junit.Before;
27 import org.junit.Test;
28 import org.onap.policy.api.NotificationHandler;
29 import org.onap.policy.api.NotificationScheme;
30 import org.onap.policy.std.AutoClientEnd;
31 import org.onap.policy.std.StdPolicyEngine;
34 * The class <code>AutoClientEndTest</code> contains tests for the class <code>{@link AutoClientEnd}</code>.
36 * @generatedBy CodePro at 6/1/16 1:40 PM
37 * @version $Revision: 1.0 $
39 public class AutoClientEndTest {
42 * Run the boolean getStatus() method test.
46 * @generatedBy CodePro at 6/1/16 1:40 PM
49 public void testGetStatus_1()
52 boolean result = AutoClientEnd.getStatus();
54 assertNotNull(result);
58 * Run the String getURL() method test.
62 * @generatedBy CodePro at 6/1/16 1:40 PM
65 public void testGetURL_1()
68 String result = AutoClientEnd.getURL();
70 // add additional test code here
71 // An unexpected exception was thrown in user code while executing this test:
72 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
73 assertNotNull(result);
78 * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
82 * @generatedBy CodePro at 6/1/16 1:40 PM
85 public void testSetAuto()
87 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
88 NotificationHandler handler = null;
90 AutoClientEnd.setAuto(scheme, handler);
92 // add additional test code here
93 // An unexpected exception was thrown in user code while executing this test:
94 // java.lang.ExceptionInInitializerError
95 // at org.apache.log4j.Logger.getLogger(Logger.java:104)
96 // at org.onap.policy.std.AutoClientEnd.<clinit>(AutoClientEnd.java:39)
100 * Run the void setScheme(NotificationScheme) method test.
104 * @generatedBy CodePro at 6/1/16 1:40 PM
107 public void testSetScheme()
110 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
111 AutoClientEnd.setScheme(scheme);
116 * Run the void start(String) method test.
120 * @generatedBy CodePro at 6/1/16 1:40 PM
123 public void testStart()
125 String url = "http://test.com";
127 AutoClientEnd.start(url);
129 // add additional test code here
130 // An unexpected exception was thrown in user code while executing this test:
131 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
136 * Run the void start(String) method test.
140 * @generatedBy CodePro at 6/1/16 1:40 PM
143 public void testStart_2()
147 AutoClientEnd.start(url);
149 // add additional test code here
150 // An unexpected exception was thrown in user code while executing this test:
151 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
155 * Run the void stop() method test.
159 * @generatedBy CodePro at 6/1/16 1:40 PM
162 public void testStop_1()
165 AutoClientEnd.stop();
167 // add additional test code here
168 // An unexpected exception was thrown in user code while executing this test:
169 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
173 * Perform pre-test initialization.
176 * if the initialization fails for some reason
178 * @generatedBy CodePro at 6/1/16 1:40 PM
183 // add set up code here
184 StdPolicyEngine policyEngine = new StdPolicyEngine("Test/config_pass.properties", (String) null);
186 NotificationHandler handler = policyEngine.getNotificationHandler();
187 AutoClientEnd.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
188 AutoClientEnd.start("http://testurl.com");
193 * Perform post-test clean-up.
196 * if the clean-up fails for some reason
198 * @generatedBy CodePro at 6/1/16 1:40 PM
201 public void tearDown()
203 // Add additional tear down code here
209 * @param args the command line arguments
211 * @generatedBy CodePro at 6/1/16 1:40 PM
213 public static void main(String[] args) {
214 new org.junit.runner.JUnitCore().run(AutoClientEndTest.class);