Changes for checkstyle 8.32
[policy/apex-pdp.git] / testsuites / integration / integration-uservice-test / src / test / java / org / onap / policy / apex / testsuites / integration / uservice / adapt / jms / TestContext.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.testsuites.integration.uservice.adapt.jms;
22
23 import static org.onap.policy.apex.testsuites.integration.uservice.adapt.jms.TestJms2Jms.HOST;
24 import static org.onap.policy.apex.testsuites.integration.uservice.adapt.jms.TestJms2Jms.JMS_TOPIC_APEX_IN;
25 import static org.onap.policy.apex.testsuites.integration.uservice.adapt.jms.TestJms2Jms.JMS_TOPIC_APEX_OUT;
26 import static org.onap.policy.apex.testsuites.integration.uservice.adapt.jms.TestJms2Jms.PORT;
27 import static org.onap.policy.apex.testsuites.integration.uservice.adapt.jms.TestJms2Jms.connectionFactory;
28
29 import java.util.HashMap;
30 import java.util.Hashtable;
31 import java.util.Map;
32 import java.util.Properties;
33 import javax.naming.Binding;
34 import javax.naming.Context;
35 import javax.naming.Name;
36 import javax.naming.NameClassPair;
37 import javax.naming.NameParser;
38 import javax.naming.NamingEnumeration;
39 import javax.naming.NamingException;
40 import org.apache.activemq.command.ActiveMQTopic;
41 import org.onap.policy.apex.model.basicmodel.concepts.ApexRuntimeException;
42
43 /**
44  * The Class TestContext.
45  *
46  * @author Liam Fallon (liam.fallon@ericsson.com)
47  */
48 public class TestContext implements Context {
49
50     private Properties testProperties;
51
52     /**
53      * Instantiates a new test context.
54      */
55     public TestContext() {
56         try {
57             testProperties = new Properties();
58
59             final Map<String, Object> params = new HashMap<String, Object>();
60             params.put("host", HOST);
61             params.put("port", PORT);
62             testProperties.put("ConnectionFactory", connectionFactory);
63             testProperties.put(JMS_TOPIC_APEX_IN, new ActiveMQTopic(JMS_TOPIC_APEX_IN));
64             testProperties.put(JMS_TOPIC_APEX_OUT, new ActiveMQTopic(JMS_TOPIC_APEX_OUT));
65         } catch (final Exception e) {
66             e.printStackTrace();
67             throw new ApexRuntimeException("Context initiation failed", e);
68         }
69     }
70
71     /**
72      * {@inheritDoc}.
73      */
74     @Override
75     public Object lookup(final Name name) throws NamingException {
76         return null;
77     }
78
79     /**
80      * {@inheritDoc}.
81      */
82     @Override
83     public Object lookup(final String name) throws NamingException {
84         return testProperties.get(name);
85     }
86
87     /**
88      * {@inheritDoc}.
89      */
90     @Override
91     public void bind(final Name name, final Object obj) throws NamingException {
92         // Not used here
93     }
94
95     /**
96      * {@inheritDoc}.
97      */
98     @Override
99     public void bind(final String name, final Object obj) throws NamingException {
100         // Not used here
101     }
102
103     /**
104      * {@inheritDoc}.
105      */
106     @Override
107     public void rebind(final Name name, final Object obj) throws NamingException {
108         // Not used here
109     }
110
111     /**
112      * {@inheritDoc}.
113      */
114     @Override
115     public void rebind(final String name, final Object obj) throws NamingException {
116         // Not used here
117     }
118
119     /**
120      * {@inheritDoc}.
121      */
122     @Override
123     public void unbind(final Name name) throws NamingException {
124         // Not used here
125     }
126
127     /**
128      * {@inheritDoc}.
129      */
130     @Override
131     public void unbind(final String name) throws NamingException {
132         // Not used here
133     }
134
135     /**
136      * {@inheritDoc}.
137      */
138     @Override
139     public void rename(final Name oldName, final Name newName) throws NamingException {
140         // Not used here
141     }
142
143     /**
144      * {@inheritDoc}.
145      */
146     @Override
147     public void rename(final String oldName, final String newName) throws NamingException {
148         // Not used here
149     }
150
151     /**
152      * {@inheritDoc}.
153      */
154     @Override
155     public NamingEnumeration<NameClassPair> list(final Name name) throws NamingException {
156         return null;
157     }
158
159     /**
160      * {@inheritDoc}.
161      */
162     @Override
163     public NamingEnumeration<NameClassPair> list(final String name) throws NamingException {
164         return null;
165     }
166
167     /**
168      * {@inheritDoc}.
169      */
170     @Override
171     public NamingEnumeration<Binding> listBindings(final Name name) throws NamingException {
172         return null;
173     }
174
175     /**
176      * {@inheritDoc}.
177      */
178     @Override
179     public NamingEnumeration<Binding> listBindings(final String name) throws NamingException {
180         return null;
181     }
182
183     /**
184      * {@inheritDoc}.
185      */
186     @Override
187     public void destroySubcontext(final Name name) throws NamingException {
188         // Not used here
189     }
190
191     /**
192      * {@inheritDoc}.
193      */
194     @Override
195     public void destroySubcontext(final String name) throws NamingException {
196         // Not used here
197     }
198
199     /**
200      * {@inheritDoc}.
201      */
202     @Override
203     public Context createSubcontext(final Name name) throws NamingException {
204         return null;
205     }
206
207     /**
208      * {@inheritDoc}.
209      */
210     @Override
211     public Context createSubcontext(final String name) throws NamingException {
212         return null;
213     }
214
215     /**
216      * {@inheritDoc}.
217      */
218     @Override
219     public Object lookupLink(final Name name) throws NamingException {
220         return null;
221     }
222
223     /**
224      * {@inheritDoc}.
225      */
226     @Override
227     public Object lookupLink(final String name) throws NamingException {
228         return null;
229     }
230
231     /**
232      * {@inheritDoc}.
233      */
234     @Override
235     public NameParser getNameParser(final Name name) throws NamingException {
236         return null;
237     }
238
239     /**
240      * {@inheritDoc}.
241      */
242     @Override
243     public NameParser getNameParser(final String name) throws NamingException {
244         return null;
245     }
246
247     /**
248      * {@inheritDoc}.
249      */
250     @Override
251     public Name composeName(final Name name, final Name prefix) throws NamingException {
252         return null;
253     }
254
255     /**
256      * {@inheritDoc}.
257      */
258     @Override
259     public String composeName(final String name, final String prefix) throws NamingException {
260         return null;
261     }
262
263     /**
264      * {@inheritDoc}.
265      */
266     @Override
267     public Object addToEnvironment(final String propName, final Object propVal) throws NamingException {
268         return null;
269     }
270
271     /**
272      * {@inheritDoc}.
273      */
274     @Override
275     public Object removeFromEnvironment(final String propName) throws NamingException {
276         return null;
277     }
278
279     /**
280      * {@inheritDoc}.
281      */
282     @Override
283     public Hashtable<?, ?> getEnvironment() throws NamingException {
284         return null;
285     }
286
287     /**
288      * {@inheritDoc}.
289      */
290     @Override
291     public void close() throws NamingException {
292         // Not used here
293     }
294
295     /**
296      * {@inheritDoc}.
297      */
298     @Override
299     public String getNameInNamespace() throws NamingException {
300         return null;
301     }
302 }