- try {
- DMaaPEventBusComponent rc = new DMaaPEventBusComponent();
- DMaaPEventBusEndpoint endpoint = new DMaaPEventBusEndpoint("http://host.com:8443/endpoint", rc);
- endpoint.setPassword("OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10");
- endpoint.setUsername("OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10");
- endpoint.setEventTopic("eventTopic");
- endpoint.setConsumerId("groupId");
- endpoint.setConsumerGroup("gn");
- endpoint.setName("name");
- endpoint.setPoolSize(45);
- endpoint.setPollingDelay(10);
- endpoint.setUrl("url");
-
- assertTrue(endpoint.getPassword().compareTo("onapSecret") == 0);
- assertTrue(endpoint.getUsername().compareTo("onapSecret") == 0);
- assertTrue(endpoint.getEventTopic().compareTo("eventTopic") == 0);
- assertTrue(endpoint.getConsumerId().compareTo("groupId") == 0);
- assertTrue(endpoint.getConsumerGroup().compareTo("gn") == 0);
- assertTrue(endpoint.getName().compareTo("name") == 0);
- assertTrue(endpoint.getPoolSize() == 45);
- assertTrue(endpoint.getPollingDelay() == 10);
- assertTrue(endpoint.getUrl().compareTo("url") == 0);
- assertFalse(endpoint.isSingleton());
-
- EventBusProducer producer = (EventBusProducer)endpoint.createProducer();
- assertTrue(producer.getEndpoint() != null);
- }
- catch (Exception ex) {
- StringWriter writer = new StringWriter();
- PrintWriter printWriter = new PrintWriter( writer );
- ex.printStackTrace( printWriter );
- printWriter.flush();
- System.out.println(writer.toString());
- throw ex;
- }
+ EventBusComponent rc = new EventBusComponent();
+ EventBusEndPoint endpoint = new EventBusEndPoint("http://host.com:8443/endpoint", rc);
+ endpoint.setEventTopic("eventTopic");
+ endpoint.setPublisher(publisher);
+ endpoint.setPoolSize(45);
+ endpoint.setPollingDelay(10);
+
+ assertTrue(endpoint.getEventTopic().compareTo("eventTopic") == 0);
+ assertTrue(endpoint.getPoolSize() == 45);
+ assertTrue(endpoint.getPollingDelay() == 10);
+ assertFalse(endpoint.isSingleton());
+ EventBusProducer producer = (EventBusProducer)endpoint.createProducer();
+ assertTrue(producer.getEndpoint() != null);
+ endpoint.close();