bump the version
[dmaap/messagerouter/msgrtr.git] / src / test / java / org / onap / dmaap / mr / test / dme2 / DME2TopicTest.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
4  *  ================================================================================
5  *  Copyright © 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  *        http://www.apache.org/licenses/LICENSE-2.0
11  *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package org.onap.dmaap.mr.test.dme2;
23
24 import java.net.URI;
25 import java.net.URISyntaxException;
26 import java.util.HashMap;
27 import java.util.Properties;
28
29 import javax.ws.rs.client.Entity;
30
31 import org.apache.log4j.Logger;
32
33 import junit.framework.TestCase;
34
35 import com.att.aft.dme2.api.DME2Client;
36 import com.att.aft.dme2.api.DME2Exception;
37 import com.att.aft.dme2.internal.jackson.map.ObjectMapper;
38
39 public class DME2TopicTest extends TestCase {
40         private String latitude;
41         private String longitude;
42         private String version;
43         private String serviceName;
44         private String env;
45         private String partner;
46         private String protocol;
47         private String methodTypeGet;
48         private String methodTypePost;
49         private String methodTypeDelete;
50         private String methodTypePut;
51
52         private String user;
53         private String password;
54         private String contenttype;
55         private String subContextPathGetAllTopic;
56         private String subContextPathGetOneTopic;
57         private String SubContextPathCreateTopic;
58         private String SubContextPathGetPublisherl;
59         private String SubContextPathGetPublisher;
60         private String SubContextPathGetPermitPublisher;
61         private String SubContextPathGetConsumer;
62         private String SubContextPathGetPermitConsumer;
63         private static final Logger LOGGER = Logger.getLogger(DME2TopicTest.class);
64
65         public void createTopic(String url, Properties props, HashMap<String, String> mapData) {
66                 LOGGER.info("create topic method starts");
67                 if (!topicExist(url, props, mapData)) {
68                         LOGGER.info("creating a new topic");
69                         try {
70                                 DME2Client sender = new DME2Client(new URI(url), 5000L);
71                                 sender.setAllowAllHttpReturnCodes(true);
72                                 sender.setMethod(props.getProperty("MethodTypePost"));
73                                 sender.setSubContext(props.getProperty("SubContextPathCreateTopic"));
74                                 TopicBeanDME2 topicBean = new TopicBeanDME2(props.getProperty("newTopic"),
75                                                 props.getProperty("topicDescription"), Integer.parseInt(props.getProperty("partition")),
76                                                 Integer.parseInt(props.getProperty("replication")), Boolean.valueOf(props
77                                                                 .getProperty("txenabled")));
78                                 String jsonStringApiBean = new ObjectMapper().writeValueAsString(topicBean);
79                                 sender.setPayload(jsonStringApiBean);
80                                 sender.addHeader("content-type", props.getProperty("contenttype"));
81                                 sender.setCredentials(props.getProperty("user"), props.getProperty("password"));
82
83                                 LOGGER.info("creating Topic");
84                                 String reply = sender.sendAndWait(5000L);
85                                 assertTrue(LoadPropertyFile.isValidJsonString(reply));
86                                 LOGGER.info("response =" + reply);
87
88                         } catch (DME2Exception e) {
89                                 e.printStackTrace();
90                         } catch (URISyntaxException e) {
91                                 e.printStackTrace();
92                         } catch (Exception e) {
93                                 e.printStackTrace();
94                         }
95                 }
96         }
97
98         public boolean topicExist(String url, Properties props, HashMap<String, String> mapData) {
99                 boolean topicExist = false;
100                 try {
101                         LOGGER.info("Checking topic exists or not");
102                         DME2Client sender = new DME2Client(new URI(url), 5000L);
103                         sender.setAllowAllHttpReturnCodes(true);
104                         sender.setMethod(props.getProperty("MethodTypeGet"));
105                         String subcontextPath = props.getProperty("subContextPathGetOneTopic") + props.getProperty("newTopic");
106                         sender.setSubContext(subcontextPath);
107                         sender.setPayload("");
108                         sender.addHeader("content-type", props.getProperty("contenttype"));
109                         sender.setCredentials(props.getProperty("user"), props.getProperty("password"));
110                         String reply = sender.sendAndWait(5000L);
111                         topicExist = LoadPropertyFile.isValidJsonString(reply);
112                         LOGGER.info("Topic exist =" + topicExist);
113                 } catch (DME2Exception e) {
114                         e.printStackTrace();
115                 } catch (URISyntaxException e) {
116                         e.printStackTrace();
117                 } catch (Exception e) {
118                         e.printStackTrace();
119                 }
120                 return topicExist;
121         }
122
123         public void testAllTopics() {
124                 LOGGER.info("Test case get all topics initiated");
125                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
126                 latitude = props.getProperty("Latitude");
127                 longitude = props.getProperty("Longitude");
128                 version = props.getProperty("Version");
129                 serviceName = props.getProperty("ServiceName");
130                 env = props.getProperty("Environment");
131                 partner = props.getProperty("Partner");
132                 subContextPathGetAllTopic = props.getProperty("subContextPathGetAllTopic");
133                 protocol = props.getProperty("Protocol");
134                 methodTypeGet = props.getProperty("MethodTypeGet");
135                 user = props.getProperty("user");
136                 password = props.getProperty("password");
137                 contenttype = props.getProperty("contenttype");
138
139                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
140                                 + "envContext=" + env + "/" + "partner=" + partner;
141                 LoadPropertyFile.loadAFTProperties(latitude, longitude); // } else {
142                 HashMap<String, String> hm = new HashMap<String, String>();
143                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
144                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
145                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
146
147                 try {
148                         DME2Client sender = new DME2Client(new URI(url), 5000L);
149                         sender.setAllowAllHttpReturnCodes(true);
150                         sender.setMethod(methodTypeGet);
151                         sender.setSubContext(subContextPathGetAllTopic);
152                         sender.setPayload("");
153
154                         sender.addHeader("Content-Type", contenttype);
155                         sender.setCredentials(user, password);
156                         sender.setHeaders(hm);
157
158                         LOGGER.info("Retrieving all topics");
159                         String reply = sender.sendAndWait(5000L);
160                         assertTrue(LoadPropertyFile.isValidJsonString(reply));
161                         LOGGER.info("All Topics details = " + reply);
162
163                 } catch (DME2Exception e) {
164                         e.printStackTrace();
165                 } catch (URISyntaxException e) {
166                         e.printStackTrace();
167                 } catch (Exception e) {
168                         e.printStackTrace();
169                 }
170         }
171
172         public void testOneTopic() {
173                 LOGGER.info("Test case get one topic initiated");
174                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
175                 latitude = props.getProperty("Latitude");
176                 longitude = props.getProperty("Longitude");
177                 version = props.getProperty("Version");
178                 serviceName = props.getProperty("ServiceName");
179                 env = props.getProperty("Environment");
180                 partner = props.getProperty("Partner");
181                 subContextPathGetOneTopic = props.getProperty("subContextPathGetOneTopic");
182                 protocol = props.getProperty("Protocol");
183                 methodTypeGet = props.getProperty("MethodTypeGet");
184                 user = props.getProperty("user");
185                 password = props.getProperty("password");
186                 contenttype = props.getProperty("contenttype");
187
188                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
189                                 + "envContext=" + env + "/" + "partner=" + partner;
190                 LoadPropertyFile.loadAFTProperties(latitude, longitude);
191
192                 HashMap<String, String> hm = new HashMap<String, String>();
193                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
194                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
195                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
196                 System.out.println("Retrieving topic detail");
197                 if (!topicExist(url, props, hm)) {
198                         createTopic(url, props, hm);
199                 } else {
200                         assertTrue(true);
201                 }
202         }
203
204         public void createTopicForDeletion(String url, Properties props, HashMap<String, String> mapData) {
205                 LOGGER.info("create topic method starts");
206
207                 LOGGER.info("creating a new topic for deletion");
208                 try {
209                         DME2Client sender = new DME2Client(new URI(url), 5000L);
210                         sender.setAllowAllHttpReturnCodes(true);
211                         sender.setMethod(props.getProperty("MethodTypePost"));
212                         sender.setSubContext(props.getProperty("SubContextPathCreateTopic"));
213                         TopicBeanDME2 topicBean = new TopicBeanDME2(props.getProperty("deleteTopic"),
214                                         props.getProperty("topicDescription"), Integer.parseInt(props.getProperty("partition")),
215                                         Integer.parseInt(props.getProperty("replication")), Boolean.valueOf(props.getProperty("txenabled")));
216                         String jsonStringApiBean = new ObjectMapper().writeValueAsString(topicBean);
217                         sender.setPayload(jsonStringApiBean);
218                         sender.addHeader("content-type", props.getProperty("contenttype"));
219                         sender.setCredentials(props.getProperty("user"), props.getProperty("password"));
220
221                         LOGGER.info("creating Topic");
222                         String reply = sender.sendAndWait(5000L);
223                         assertTrue(LoadPropertyFile.isValidJsonString(reply));
224                         LOGGER.info("response =" + reply);
225
226                 } catch (DME2Exception e) {
227                         e.printStackTrace();
228                 } catch (URISyntaxException e) {
229                         e.printStackTrace();
230                 } catch (Exception e) {
231                         e.printStackTrace();
232                 }
233
234         }
235
236         public boolean topicExistForDeletion(String url, Properties props, HashMap<String, String> mapData) {
237                 boolean topicExist = false;
238                 try {
239                         LOGGER.info("Checking topic exists for deletion");
240                         DME2Client sender = new DME2Client(new URI(url), 5000L);
241                         sender.setAllowAllHttpReturnCodes(true);
242                         sender.setMethod(props.getProperty("MethodTypeGet"));
243                         String subcontextPath = props.getProperty("subContextPathGetOneTopic") + props.getProperty("deleteTopic");
244                         sender.setSubContext(subcontextPath);
245                         sender.setPayload("");
246                         sender.addHeader("content-type", props.getProperty("contenttype"));
247                         sender.setCredentials(props.getProperty("user"), props.getProperty("password"));
248                         String reply = sender.sendAndWait(5000L);
249                         topicExist = LoadPropertyFile.isValidJsonString(reply);
250                         LOGGER.info("Topic exist for deletion=" + topicExist);
251                 } catch (DME2Exception e) {
252                         e.printStackTrace();
253                 } catch (URISyntaxException e) {
254                         e.printStackTrace();
255                 } catch (Exception e) {
256                         e.printStackTrace();
257                 }
258                 return topicExist;
259         }
260
261         public void testDeleteTopic() {
262                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
263                 latitude = props.getProperty("Latitude");
264                 longitude = props.getProperty("Longitude");
265                 version = props.getProperty("Version");
266                 serviceName = props.getProperty("ServiceName");
267                 env = props.getProperty("Environment");
268                 partner = props.getProperty("Partner");
269                 SubContextPathCreateTopic = props.getProperty("SubContextPathCreateTopic");
270                 protocol = props.getProperty("Protocol");
271                 methodTypePost = props.getProperty("MethodTypeDelete");
272                 user = props.getProperty("user");
273                 password = props.getProperty("password");
274                 contenttype = props.getProperty("contenttypejson");
275                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
276                                 + "envContext=" + env + "/" + "partner=" + partner;
277                 LoadPropertyFile.loadAFTProperties(latitude, longitude);
278                 HashMap<String, String> hm = new HashMap<String, String>();
279                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
280                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
281                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
282                 System.out.println("deleteing topic");
283                 if (!topicExistForDeletion(url, props, hm)) {
284                         createTopicForDeletion(url, props, hm);
285                         deleteTopic(url, props, hm);
286                 } else {
287                         deleteTopic(url, props, hm);
288                 }
289         }
290
291         public void deleteTopic(String url, Properties props, HashMap<String, String> mapData) {
292                 try {
293                         DME2Client sender = new DME2Client(new URI(url), 5000L);
294                         sender.setAllowAllHttpReturnCodes(true);
295                         sender.setMethod(props.getProperty("MethodTypeDelete"));
296                         String subsontextPathDelete = props.getProperty("subContextPathGetOneTopic")
297                                         + props.getProperty("deleteTopic");
298                         sender.setSubContext(subsontextPathDelete);
299                         sender.setPayload("");
300                         sender.addHeader("content-type", props.getProperty("contenttype"));
301                         sender.setCredentials(props.getProperty("user"), props.getProperty("password"));
302                         System.out.println("Deleting Topic " + props.getProperty("deleteTopic"));
303                         String reply = sender.sendAndWait(5000L);
304                         assertNotNull(reply);
305                         System.out.println("response =" + reply);
306                 } catch (DME2Exception e) {
307                         e.printStackTrace();
308                 } catch (URISyntaxException e) {
309                         e.printStackTrace();
310                 } catch (Exception e) {
311                         e.printStackTrace();
312                 }
313         }
314
315         public void testGetProducersTopics() {
316                 LOGGER.info("Test case get list of producers on topic");
317                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
318                 latitude = props.getProperty("Latitude");
319                 longitude = props.getProperty("Longitude");
320                 version = props.getProperty("Version");
321                 serviceName = props.getProperty("ServiceName");
322                 env = props.getProperty("Environment");
323                 partner = props.getProperty("Partner");
324                 SubContextPathGetPublisher = props.getProperty("SubContextPathGetPublisher");
325                 protocol = props.getProperty("Protocol");
326                 methodTypeGet = props.getProperty("MethodTypeGet");
327                 user = props.getProperty("user");
328                 password = props.getProperty("password");
329                 contenttype = props.getProperty("contenttype");
330
331                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
332                                 + "envContext=" + env + "/" + "partner=" + partner;
333                 LoadPropertyFile.loadAFTProperties(latitude, longitude);
334
335                 HashMap<String, String> hm = new HashMap<String, String>();
336                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
337                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
338                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
339
340                 try {
341                         DME2Client sender = new DME2Client(new URI(url), 5000L);
342                         sender.setAllowAllHttpReturnCodes(true);
343                         sender.setMethod(methodTypeGet);
344                         sender.setSubContext(SubContextPathGetPublisher);
345                         sender.setPayload("");
346
347                         sender.addHeader("Content-Type", contenttype);
348                         sender.setCredentials(user, password);
349                         sender.setHeaders(hm);
350
351                         LOGGER.info("Retrieving List of publishers");
352                         String reply = sender.sendAndWait(5000L);
353                         assertTrue(LoadPropertyFile.isValidJsonString(reply));
354                         LOGGER.info("All Publishers details = " + reply);
355
356                 } catch (DME2Exception e) {
357                         e.printStackTrace();
358                 } catch (URISyntaxException e) {
359                         e.printStackTrace();
360                 } catch (Exception e) {
361                         e.printStackTrace();
362                 }
363         }
364
365         // permitting a producer on topic is not applicable
366         // public void testPermitProducersTopics() {
367         // LOGGER.info("Test case ");
368         // Properties props = LoadPropertyFile.getPropertyFileDataProducer();
369         // latitude = props.getProperty("Latitude");
370         // longitude = props.getProperty("Longitude");
371         // version = props.getProperty("Version");
372         // serviceName = props.getProperty("ServiceName");
373         // env = props.getProperty("Environment");
374         // partner = props.getProperty("Partner");
375         // SubContextPathGetPermitPublisher =
376         // props.getProperty("SubContextPathGetPermitPublisher");
377         // protocol = props.getProperty("Protocol");
378         // methodTypePut = props.getProperty("MethodTypePut");
379         // user = props.getProperty("user");
380         // password = props.getProperty("password");
381         // contenttype = props.getProperty("contenttype");
382         //
383         // String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/"
384         // + "version=" + version + "/"
385         // + "envContext=" + env + "/" + "partner=" + partner;
386         // LoadPropertyFile.loadAFTProperties(latitude, longitude);
387         //
388         // HashMap<String, String> hm = new HashMap<String, String>();
389         // hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
390         // hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
391         // hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
392         //
393         // try {
394         // DME2Client sender = new DME2Client(new URI(url), 5000L);
395         // sender.setAllowAllHttpReturnCodes(true);
396         // sender.setMethod(methodTypePut);
397         // sender.setSubContext(SubContextPathGetPermitPublisher);
398         // sender.setPayload("");
399         //
400         // sender.addHeader("Content-Type", contenttype);
401         // sender.setCredentials(user, password);
402         // sender.setHeaders(hm);
403         //
404         // System.out.println("Permitting a producer on topic");
405         // String reply = sender.sendAndWait(5000L);
406         // System.out.println("Reply from server = " + reply);
407         //
408         // } catch (DME2Exception e) {
409         // e.printStackTrace();
410         // } catch (URISyntaxException e) {
411         // e.printStackTrace();
412         // } catch (Exception e) {
413         // e.printStackTrace();
414         // }
415         // }
416
417         public void testGetConsumersTopics() {
418                 LOGGER.info("Test case get list of consumers on topic ");
419                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
420                 latitude = props.getProperty("Latitude");
421                 longitude = props.getProperty("Longitude");
422                 version = props.getProperty("Version");
423                 serviceName = props.getProperty("ServiceName");
424                 env = props.getProperty("Environment");
425                 partner = props.getProperty("Partner");
426                 SubContextPathGetConsumer = props.getProperty("SubContextPathGetConsumer");
427                 protocol = props.getProperty("Protocol");
428                 methodTypeGet = props.getProperty("MethodTypeGet");
429                 user = props.getProperty("user");
430                 password = props.getProperty("password");
431                 contenttype = props.getProperty("contenttype");
432
433                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
434                                 + "envContext=" + env + "/" + "partner=" + partner;
435                 LoadPropertyFile.loadAFTProperties(latitude, longitude);
436
437                 HashMap<String, String> hm = new HashMap<String, String>();
438                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
439                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
440                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
441
442                 try {
443                         DME2Client sender = new DME2Client(new URI(url), 5000L);
444                         sender.setAllowAllHttpReturnCodes(true);
445                         sender.setMethod(methodTypeGet);
446                         sender.setSubContext(SubContextPathGetConsumer);
447                         sender.setPayload("");
448
449                         sender.addHeader("Content-Type", contenttype);
450                         sender.setCredentials(user, password);
451                         sender.setHeaders(hm);
452
453                         LOGGER.info("Retrieving consumer details on topics");
454                         String reply = sender.sendAndWait(5000L);
455                         assertTrue(LoadPropertyFile.isValidJsonString(reply));
456                         System.out.println("Reply from server = " + reply);
457
458                 } catch (DME2Exception e) {
459                         e.printStackTrace();
460                 } catch (URISyntaxException e) {
461                         e.printStackTrace();
462                 } catch (Exception e) {
463                         e.printStackTrace();
464                 }
465         }
466
467         public void testCreateTopic() {
468                 LOGGER.info("Test case create topic starts");
469                 Properties props = LoadPropertyFile.getPropertyFileDataProducer();
470                 latitude = props.getProperty("Latitude");
471                 longitude = props.getProperty("Longitude");
472                 version = props.getProperty("Version");
473                 serviceName = props.getProperty("ServiceName");
474                 env = props.getProperty("Environment");
475                 partner = props.getProperty("Partner");
476                 SubContextPathCreateTopic = props.getProperty("SubContextPathCreateTopic");
477                 protocol = props.getProperty("Protocol");
478                 methodTypePost = props.getProperty("MethodTypePost");
479                 user = props.getProperty("user");
480                 password = props.getProperty("password");
481                 contenttype = props.getProperty("contenttypejson");
482
483                 String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/" + "version=" + version + "/"
484                                 + "envContext=" + env + "/" + "partner=" + partner;
485                 LoadPropertyFile.loadAFTProperties(latitude, longitude);
486                 HashMap<String, String> hm = new HashMap<String, String>();
487                 hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
488                 hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
489                 hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
490
491                 createTopic(url, props, hm);
492         }
493         // permitting a consumer on topic is not applicable
494         // public void testPermitConsumerTopics() {
495         // Properties props = LoadPropertyFile.getPropertyFileDataProducer();
496         // latitude = props.getProperty("Latitude");
497         // longitude = props.getProperty("Longitude");
498         // version = props.getProperty("Version");
499         // serviceName = props.getProperty("ServiceName");
500         // env = props.getProperty("Environment");
501         // partner = props.getProperty("Partner");
502         // SubContextPathGetPermitConsumer =
503         // props.getProperty("SubContextPathGetPermitConsumer");
504         // protocol = props.getProperty("Protocol");
505         // methodTypePut = props.getProperty("MethodTypePut");
506         // user = props.getProperty("user");
507         // password = props.getProperty("password");
508         // contenttype = props.getProperty("contenttype");
509         //
510         // String url = protocol + "://DME2SEARCH/" + "service=" + serviceName + "/"
511         // + "version=" + version + "/"
512         // + "envContext=" + env + "/" + "partner=" + partner;
513         // LoadPropertyFile.loadAFTProperties(latitude, longitude);
514         //
515         // HashMap<String, String> hm = new HashMap<String, String>();
516         // hm.put("AFT_DME2_EP_READ_TIMEOUT_MS", "50000");
517         // hm.put("AFT_DME2_ROUNDTRIP_TIMEOUT_MS", "240000");
518         // hm.put("AFT_DME2_EP_CONN_TIMEOUT", "5000");
519         //
520         // try {
521         // DME2Client sender = new DME2Client(new URI(url), 5000L);
522         // sender.setAllowAllHttpReturnCodes(true);
523         // sender.setMethod(methodTypePut);
524         // sender.setSubContext(SubContextPathGetPermitConsumer);
525         // sender.setPayload("");
526         //
527         // sender.addHeader("Content-Type", contenttype);
528         // sender.setCredentials(user, password);
529         // sender.setHeaders(hm);
530         //
531         // System.out.println("Permitting a consumer on topic");
532         // String reply = sender.sendAndWait(5000L);
533         // assertNotNull(reply);
534         // System.out.println("Reply from server = " + reply);
535         //
536         // } catch (DME2Exception e) {
537         // e.printStackTrace();
538         // } catch (URISyntaxException e) {
539         // e.printStackTrace();
540         // } catch (Exception e) {
541         // e.printStackTrace();
542         // }
543         // }
544
545 }