@Test public void testInit_PropertiesNotFound() { String configPath = "src/test/resources/config/solace_config_not_found.cfg"; try { transport.init(configPath); fail("Should have failed because the above config file shouldn't exist"); } catch (Exception e) { assertTrue(e instanceof EtiqetException); assertEquals("Could not init Solace with config [" + configPath + "]", e.getMessage()); } }
@Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } }
SolaceTransport implements Transport { @Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } } }
SolaceTransport implements Transport { @Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } }  }
SolaceTransport implements Transport { @Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } }  @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(); }
SolaceTransport implements Transport { @Override public void init(String configPath) throws EtiqetException { try { Properties props = new Properties(); props.load(Environment.fileResolveEnvVars(configPath)); connectionFactory = new SolXAConnectionFactoryImpl(); connectionFactory.setHost(props.getProperty("solaceHost")); connectionFactory.setVPN(props.getProperty("solaceVpn")); connectionFactory.setUsername(props.getProperty("solaceUser")); connectionFactory.setPassword(props.getProperty("solacePassword")); defaultTopic = props.getProperty("solaceDefaultTopic"); } catch (Exception e) { throw new EtiqetException("Could not init Solace with config [" + configPath + "]", e); } }  @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();  }