Initial OpenECOMP policy/engine commit
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / openecomp / policy / std / test / ManualClientEndTest.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 javax.websocket.Session;
24
25 import org.junit.*;
26 import org.mockito.Mockito;
27 import org.openecomp.policy.api.NotificationScheme;
28 import org.openecomp.policy.api.PDPNotification;
29 import org.openecomp.policy.std.ManualClientEnd;
30
31 import static org.junit.Assert.*;
32
33 /**
34  * The class <code>ManualClientEndTest</code> contains tests for the class <code>{@link ManualClientEnd}</code>.
35  *
36  * @generatedBy CodePro at 6/1/16 1:41 PM
37  * @version $Revision: 1.0 $
38  */
39 public class ManualClientEndTest {
40         /**
41          * Run the ManualClientEnd() constructor test.
42          *
43          * @generatedBy CodePro at 6/1/16 1:41 PM
44          */
45         @Test
46         public void testManualClientEnd_1()
47                 throws Exception {
48                 ManualClientEnd result = new ManualClientEnd();
49                 assertNotNull(result);
50                 // add additional test code here
51         }
52
53         /**
54          * Run the void onClose(Session) method test.
55          *
56          * @throws Exception
57          *
58          * @generatedBy CodePro at 6/1/16 1:41 PM
59          */
60         @Test
61         public void testOnClose()
62                 throws Exception {
63                 ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
64                 Session mockSession = Mockito.mock(Session.class);
65
66                 fixture.onClose(mockSession);
67
68         }
69
70         /**
71          * Run the void onError(Session,Throwable) method test.
72          *
73          * @throws Exception
74          *
75          * @generatedBy CodePro at 6/1/16 1:41 PM
76          */
77         @Test
78         public void testOnError()
79                 throws Exception {
80                 ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
81                 Session mockSession = Mockito.mock(Session.class);
82                 Throwable e = new Throwable();
83
84                 fixture.onError(mockSession, e);
85         }
86
87         /**
88          * Run the void onMessage(String,Session) method test.
89          *
90          * @throws Exception
91          *
92          * @generatedBy CodePro at 6/1/16 1:41 PM
93          */
94         @Test
95         public void testOnMessage()
96                 throws Exception {
97                 ManualClientEnd fixture = new ManualClientEnd();
98                 ManualClientEnd mockclient = Mockito.mock(ManualClientEnd.class);
99                 String message = "";
100                 Session mockSession = Mockito.mock(Session.class);
101                 
102                 Mockito.doNothing().when(mockclient).onMessage(message,mockSession);
103                 mockclient.onMessage(message,mockSession);
104         }
105
106         /**
107          * Run the void onOpen(Session) method test.
108          *
109          * @throws Exception
110          *
111          * @generatedBy CodePro at 6/1/16 1:41 PM
112          */
113         @Test
114         public void testOnOpen()
115                 throws Exception {
116                 ManualClientEnd fixture = Mockito.mock(ManualClientEnd.class);
117                 Session mockSession = Mockito.mock(Session.class);
118
119                 fixture.onOpen(mockSession);
120
121         }
122
123         /**
124          * Run the PDPNotification result(NotificationScheme) method test.
125          *
126          * @throws Exception
127          *
128          * @generatedBy CodePro at 6/1/16 1:41 PM
129          */
130         @Test
131         public void testResult_1()
132                 throws Exception {
133                 NotificationScheme scheme = NotificationScheme.AUTO_ALL_NOTIFICATIONS;
134
135                 PDPNotification result = ManualClientEnd.result(scheme);
136
137                 assertNull(result);
138         }
139
140
141         /**
142          * Run the void start(String) method test.
143          *
144          * @throws Exception
145          *
146          * @generatedBy CodePro at 6/1/16 1:41 PM
147          */
148         @Test
149         public void testStart_1()
150                 throws Exception {
151                 String url = "";
152
153                 ManualClientEnd.start(url);
154
155         }
156
157         /**
158          * Perform pre-test initialization.
159          *
160          * @throws Exception
161          *         if the initialization fails for some reason
162          *
163          * @generatedBy CodePro at 6/1/16 1:41 PM
164          */
165         @Before
166         public void setUp()
167                 throws Exception {
168                 // add additional set up code here
169         }
170
171         /**
172          * Perform post-test clean-up.
173          *
174          * @throws Exception
175          *         if the clean-up fails for some reason
176          *
177          * @generatedBy CodePro at 6/1/16 1:41 PM
178          */
179         @After
180         public void tearDown()
181                 throws Exception {
182                 // Add additional tear down code here
183         }
184
185         /**
186          * Launch the test.
187          *
188          * @param args the command line arguments
189          *
190          * @generatedBy CodePro at 6/1/16 1:41 PM
191          */
192         public static void main(String[] args) {
193                 new org.junit.runner.JUnitCore().run(ManualClientEndTest.class);
194         }
195 }