Reduce technical debt and add JUnit
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / onap / policy / std / test / AutoClientEndTest.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 static org.junit.Assert.assertNotNull;
24
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;
32
33 /**
34  * The class <code>AutoClientEndTest</code> contains tests for the class <code>{@link AutoClientEnd}</code>.
35  *
36  * @generatedBy CodePro at 6/1/16 1:40 PM
37  * @version $Revision: 1.0 $
38  */
39 public class AutoClientEndTest {
40
41         /**
42          * Run the boolean getStatus() method test.
43          *
44          * @throws Exception
45          *
46          * @generatedBy CodePro at 6/1/16 1:40 PM
47          */
48         @Test
49         public void testGetStatus_1()
50                 throws Exception {
51
52                 boolean result = AutoClientEnd.getStatus();
53
54                 assertNotNull(result);
55         }
56
57         /**
58          * Run the String getURL() method test.
59          *
60          * @throws Exception
61          *
62          * @generatedBy CodePro at 6/1/16 1:40 PM
63          */
64         @Test
65         public void testGetURL_1()
66                 throws Exception {
67
68                 String result = AutoClientEnd.getURL();
69
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);
74         }
75
76
77         /**
78          * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
79          *
80          * @throws Exception
81          *
82          * @generatedBy CodePro at 6/1/16 1:40 PM
83          */
84         @Test
85         public void testSetAuto()
86                 throws Exception {
87                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
88                 NotificationHandler handler = null;
89
90                 AutoClientEnd.setAuto(scheme, handler);
91
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)
97         }
98
99         /**
100          * Run the void setScheme(NotificationScheme) method test.
101          *
102          * @throws Exception
103          *
104          * @generatedBy CodePro at 6/1/16 1:40 PM
105          */
106         @Test
107         public void testSetScheme()
108                 throws Exception {
109                 
110                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
111                 AutoClientEnd.setScheme(scheme);
112
113         }
114
115         /**
116          * Run the void start(String) method test.
117          *
118          * @throws Exception
119          *
120          * @generatedBy CodePro at 6/1/16 1:40 PM
121          */
122         @Test
123         public void testStart()
124                 throws Exception {
125                 String url = "http://test.com";
126
127                 AutoClientEnd.start(url);
128
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
132         }
133
134
135         /**
136          * Run the void start(String) method test.
137          *
138          * @throws Exception
139          *
140          * @generatedBy CodePro at 6/1/16 1:40 PM
141          */
142         @Test
143         public void testStart_2()
144                 throws Exception {
145                 String url = null;
146
147                 AutoClientEnd.start(url);
148
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
152         }
153
154         /**
155          * Run the void stop() method test.
156          *
157          * @throws Exception
158          *
159          * @generatedBy CodePro at 6/1/16 1:40 PM
160          */
161         @Test
162         public void testStop_1()
163                 throws Exception {
164
165                 AutoClientEnd.stop();
166
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
170         }
171
172         /**
173          * Perform pre-test initialization.
174          *
175          * @throws Exception
176          *         if the initialization fails for some reason
177          *
178          * @generatedBy CodePro at 6/1/16 1:40 PM
179          */
180         @Before
181         public void setUp()
182                 throws Exception {
183                 // add set up code here
184                 StdPolicyEngine policyEngine = new StdPolicyEngine("Test/config_pass.properties", (String) null);
185                 
186                 NotificationHandler handler = policyEngine.getNotificationHandler();
187                 AutoClientEnd.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
188                 AutoClientEnd.start("http://testurl.com");
189                 
190         }
191
192         /**
193          * Perform post-test clean-up.
194          *
195          * @throws Exception
196          *         if the clean-up fails for some reason
197          *
198          * @generatedBy CodePro at 6/1/16 1:40 PM
199          */
200         @After
201         public void tearDown()
202                 throws Exception {
203                 // Add additional tear down code here
204         }
205
206         /**
207          * Launch the test.
208          *
209          * @param args the command line arguments
210          *
211          * @generatedBy CodePro at 6/1/16 1:40 PM
212          */
213         public static void main(String[] args) {
214                 new org.junit.runner.JUnitCore().run(AutoClientEndTest.class);
215         }
216 }