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 {
41 * Run the AutoClientEnd() constructor test.
43 * @generatedBy CodePro at 6/1/16 1:40 PM
46 public void testAutoClientEnd_1()
48 AutoClientEnd result = new AutoClientEnd();
49 assertNotNull(result);
50 // add additional test code here
54 * Run the boolean getStatus() method test.
58 * @generatedBy CodePro at 6/1/16 1:40 PM
61 public void testGetStatus_1()
64 boolean result = AutoClientEnd.getStatus();
66 assertNotNull(result);
70 * Run the String getURL() method test.
74 * @generatedBy CodePro at 6/1/16 1:40 PM
77 public void testGetURL_1()
80 String result = AutoClientEnd.getURL();
82 // add additional test code here
83 // An unexpected exception was thrown in user code while executing this test:
84 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
85 assertNotNull(result);
90 * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
94 * @generatedBy CodePro at 6/1/16 1:40 PM
97 public void testSetAuto()
99 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
100 NotificationHandler handler = null;
102 AutoClientEnd.setAuto(scheme, handler);
104 // add additional test code here
105 // An unexpected exception was thrown in user code while executing this test:
106 // java.lang.ExceptionInInitializerError
107 // at org.apache.log4j.Logger.getLogger(Logger.java:104)
108 // at org.onap.policy.std.AutoClientEnd.<clinit>(AutoClientEnd.java:39)
112 * Run the void setScheme(NotificationScheme) method test.
116 * @generatedBy CodePro at 6/1/16 1:40 PM
119 public void testSetScheme()
122 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
123 AutoClientEnd.setScheme(scheme);
128 * Run the void start(String) method test.
132 * @generatedBy CodePro at 6/1/16 1:40 PM
135 public void testStart()
137 String url = "http://test.com";
139 AutoClientEnd.start(url);
141 // add additional test code here
142 // An unexpected exception was thrown in user code while executing this test:
143 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
148 * Run the void start(String) method test.
152 * @generatedBy CodePro at 6/1/16 1:40 PM
155 public void testStart_2()
159 AutoClientEnd.start(url);
161 // add additional test code here
162 // An unexpected exception was thrown in user code while executing this test:
163 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
167 * Run the void stop() method test.
171 * @generatedBy CodePro at 6/1/16 1:40 PM
174 public void testStop_1()
177 AutoClientEnd.stop();
179 // add additional test code here
180 // An unexpected exception was thrown in user code while executing this test:
181 // java.lang.NoClassDefFoundError: Could not initialize class org.onap.policy.std.AutoClientEnd
185 * Perform pre-test initialization.
188 * if the initialization fails for some reason
190 * @generatedBy CodePro at 6/1/16 1:40 PM
195 // add set up code here
196 StdPolicyEngine policyEngine = new StdPolicyEngine("Test/config_pass.properties", (String) null);
198 NotificationHandler handler = policyEngine.getNotificationHandler();
199 AutoClientEnd.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
200 AutoClientEnd.start("http://testurl.com");
205 * Perform post-test clean-up.
208 * if the clean-up fails for some reason
210 * @generatedBy CodePro at 6/1/16 1:40 PM
213 public void tearDown()
215 // Add additional tear down code here
221 * @param args the command line arguments
223 * @generatedBy CodePro at 6/1/16 1:40 PM
225 public static void main(String[] args) {
226 new org.junit.runner.JUnitCore().run(AutoClientEndTest.class);