Policy TestSuite Enabled
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / openecomp / 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.openecomp.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.openecomp.policy.api.NotificationHandler;
29 import org.openecomp.policy.api.NotificationScheme;
30 import org.openecomp.policy.std.AutoClientEnd;
31 import org.openecomp.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          * Run the AutoClientEnd() constructor test.
42          *
43          * @generatedBy CodePro at 6/1/16 1:40 PM
44          */
45         @Test
46         public void testAutoClientEnd_1()
47                 throws Exception {
48                 AutoClientEnd result = new AutoClientEnd();
49                 assertNotNull(result);
50                 // add additional test code here
51         }
52
53         /**
54          * Run the boolean getStatus() method test.
55          *
56          * @throws Exception
57          *
58          * @generatedBy CodePro at 6/1/16 1:40 PM
59          */
60         @Test
61         public void testGetStatus_1()
62                 throws Exception {
63
64                 boolean result = AutoClientEnd.getStatus();
65
66                 assertNotNull(result);
67         }
68
69         /**
70          * Run the String getURL() method test.
71          *
72          * @throws Exception
73          *
74          * @generatedBy CodePro at 6/1/16 1:40 PM
75          */
76         @Test
77         public void testGetURL_1()
78                 throws Exception {
79
80                 String result = AutoClientEnd.getURL();
81
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.openecomp.policy.std.AutoClientEnd
85                 assertNotNull(result);
86         }
87
88
89         /**
90          * Run the void setAuto(NotificationScheme,NotificationHandler) method test.
91          *
92          * @throws Exception
93          *
94          * @generatedBy CodePro at 6/1/16 1:40 PM
95          */
96         @Test
97         public void testSetAuto()
98                 throws Exception {
99                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
100                 NotificationHandler handler = null;
101
102                 AutoClientEnd.setAuto(scheme, handler);
103
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.openecomp.policy.std.AutoClientEnd.<clinit>(AutoClientEnd.java:39)
109         }
110
111         /**
112          * Run the void setScheme(NotificationScheme) method test.
113          *
114          * @throws Exception
115          *
116          * @generatedBy CodePro at 6/1/16 1:40 PM
117          */
118         @Test
119         public void testSetScheme()
120                 throws Exception {
121                 
122                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
123                 AutoClientEnd.setScheme(scheme);
124
125         }
126
127         /**
128          * Run the void start(String) method test.
129          *
130          * @throws Exception
131          *
132          * @generatedBy CodePro at 6/1/16 1:40 PM
133          */
134         @Test
135         public void testStart()
136                 throws Exception {
137                 String url = "http://test.com";
138
139                 AutoClientEnd.start(url);
140
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.openecomp.policy.std.AutoClientEnd
144         }
145
146
147         /**
148          * Run the void start(String) method test.
149          *
150          * @throws Exception
151          *
152          * @generatedBy CodePro at 6/1/16 1:40 PM
153          */
154         @Test
155         public void testStart_2()
156                 throws Exception {
157                 String url = null;
158
159                 AutoClientEnd.start(url);
160
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.openecomp.policy.std.AutoClientEnd
164         }
165
166         /**
167          * Run the void stop() method test.
168          *
169          * @throws Exception
170          *
171          * @generatedBy CodePro at 6/1/16 1:40 PM
172          */
173         @Test
174         public void testStop_1()
175                 throws Exception {
176
177                 AutoClientEnd.stop();
178
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.openecomp.policy.std.AutoClientEnd
182         }
183
184         /**
185          * Perform pre-test initialization.
186          *
187          * @throws Exception
188          *         if the initialization fails for some reason
189          *
190          * @generatedBy CodePro at 6/1/16 1:40 PM
191          */
192         @Before
193         public void setUp()
194                 throws Exception {
195                 // add set up code here
196                 StdPolicyEngine policyEngine = new StdPolicyEngine("Test/config_pass.properties", (String) null);
197                 
198                 NotificationHandler handler = policyEngine.getNotificationHandler();
199                 AutoClientEnd.setAuto(NotificationScheme.AUTO_ALL_NOTIFICATIONS, handler);
200                 AutoClientEnd.start("http://testurl.com");
201                 
202         }
203
204         /**
205          * Perform post-test clean-up.
206          *
207          * @throws Exception
208          *         if the clean-up fails for some reason
209          *
210          * @generatedBy CodePro at 6/1/16 1:40 PM
211          */
212         @After
213         public void tearDown()
214                 throws Exception {
215                 // Add additional tear down code here
216         }
217
218         /**
219          * Launch the test.
220          *
221          * @param args the command line arguments
222          *
223          * @generatedBy CodePro at 6/1/16 1:40 PM
224          */
225         public static void main(String[] args) {
226                 new org.junit.runner.JUnitCore().run(AutoClientEndTest.class);
227         }
228 }