@Test public void testInit_PropertiesNotFound() { String configPath = "src/test/resources/config/jms_config_not_found.xml"; try { transport.init(configPath); fail("Should have failed because the above config file shouldn't exist"); } catch (Exception e) { assertTrue(e instanceof EtiqetException); assertEquals("Exception thrown while trying to read " + configPath, e.getMessage()); } }
@Override public void init(String configPath) throws EtiqetException { JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(new JmsConfigXmlParser()); JmsConfig configuration = jmsConfigExtractor.retrieveConfiguration(configPath); binaryMessageConverterDelegate = instantiateBinaryMessageConverterDelegate(configuration); connectionFactory = createConnectionFactory(configuration); defaultTopic = configuration.getDefaultTopic(); }
JmsTransport implements BrokerTransport { @Override public void init(String configPath) throws EtiqetException { JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(new JmsConfigXmlParser()); JmsConfig configuration = jmsConfigExtractor.retrieveConfiguration(configPath); binaryMessageConverterDelegate = instantiateBinaryMessageConverterDelegate(configuration); connectionFactory = createConnectionFactory(configuration); defaultTopic = configuration.getDefaultTopic(); } }
JmsTransport implements BrokerTransport { @Override public void init(String configPath) throws EtiqetException { JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(new JmsConfigXmlParser()); JmsConfig configuration = jmsConfigExtractor.retrieveConfiguration(configPath); binaryMessageConverterDelegate = instantiateBinaryMessageConverterDelegate(configuration); connectionFactory = createConnectionFactory(configuration); defaultTopic = configuration.getDefaultTopic(); }  }
JmsTransport implements BrokerTransport { @Override public void init(String configPath) throws EtiqetException { JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(new JmsConfigXmlParser()); JmsConfig configuration = jmsConfigExtractor.retrieveConfiguration(configPath); binaryMessageConverterDelegate = instantiateBinaryMessageConverterDelegate(configuration); connectionFactory = createConnectionFactory(configuration); defaultTopic = configuration.getDefaultTopic(); }  @Override void init(String configPath); @Override void start(); @Override void stop(); @Override void send(Cdr msg); @Override void send(Cdr msg, String topicName); @Override boolean isLoggedOn(); @Override String getDefaultSessionId(); @Override void setTransportDelegate(TransportDelegate<String, Cdr> transDel); @Override @SuppressWarnings("unchecked") void setCodec(Codec c); @Override Codec getCodec(); @Override void setDelegate(ClientDelegate delegate); @Override ClientDelegate getDelegate(); @Override void subscribeToTopic(Optional<String> topicName, final Consumer<Cdr> cdrListener); @Override void subscribeToQueue(String queueName, Consumer<Cdr> cdrListener); @Override void sendToTopic(Cdr cdr, Optional<String> maybeTopicName); @Override void sendToQueue(Cdr cdr, String queueName); @Override void clearQueue(String queueName); @Override Cdr subscribeAndConsumeFromTopic(final Optional<String> topicName, final Duration timeout); @Override Cdr subscribeAndConsumeFromQueue(final String queueName, final Duration timeout); }
JmsTransport implements BrokerTransport { @Override public void init(String configPath) throws EtiqetException { JmsConfigExtractor jmsConfigExtractor = new JmsConfigExtractor(new JmsConfigXmlParser()); JmsConfig configuration = jmsConfigExtractor.retrieveConfiguration(configPath); binaryMessageConverterDelegate = instantiateBinaryMessageConverterDelegate(configuration); connectionFactory = createConnectionFactory(configuration); defaultTopic = configuration.getDefaultTopic(); }  @Override void init(String configPath); @Override void start(); @Override void stop(); @Override void send(Cdr msg); @Override void send(Cdr msg, String topicName); @Override boolean isLoggedOn(); @Override String getDefaultSessionId(); @Override void setTransportDelegate(TransportDelegate<String, Cdr> transDel); @Override @SuppressWarnings("unchecked") void setCodec(Codec c); @Override Codec getCodec(); @Override void setDelegate(ClientDelegate delegate); @Override ClientDelegate getDelegate(); @Override void subscribeToTopic(Optional<String> topicName, final Consumer<Cdr> cdrListener); @Override void subscribeToQueue(String queueName, Consumer<Cdr> cdrListener); @Override void sendToTopic(Cdr cdr, Optional<String> maybeTopicName); @Override void sendToQueue(Cdr cdr, String queueName); @Override void clearQueue(String queueName); @Override Cdr subscribeAndConsumeFromTopic(final Optional<String> topicName, final Duration timeout); @Override Cdr subscribeAndConsumeFromQueue(final String queueName, final Duration timeout);  }