use of com.adaptris.interlok.junit.scaffolding.jms.MockJmsConnection in project interlok by adaptris.
the class ChannelTest method testConnectionEqualityCheck2ConnectionsToSameBroker.
@Test
public void testConnectionEqualityCheck2ConnectionsToSameBroker() throws Exception {
Channel channel = new Channel();
MockJmsConnection produceConnection = createMockJmsConnection(null, "broker1");
MockJmsConnection consumeConnection = createMockJmsConnection(null, "broker1");
channel.setConsumeConnection(consumeConnection);
channel.setProduceConnection(produceConnection);
try {
channel.init();
fail("Should fail, 2 identical connections with error handlers");
} catch (CoreException ex) {
assertEquals(DUP_CEH_MESSAGE, ex.getMessage());
}
}
use of com.adaptris.interlok.junit.scaffolding.jms.MockJmsConnection in project interlok by adaptris.
the class ChannelTest method createMockJmsConnection.
private MockJmsConnection createMockJmsConnection(String uid, String brokerUrl) {
MockJmsConnection connection = new MockJmsConnection();
if (uid != null)
connection.setUniqueId(uid);
UrlVendorImplementation vendorImp = new UrlVendorImplementation() {
@Override
public ConnectionFactory createConnectionFactory() throws JMSException {
return null;
}
};
vendorImp.setBrokerUrl(brokerUrl);
connection.setVendorImplementation(vendorImp);
connection.setConnectionErrorHandler(new MockNoOpConnectionErrorHandler());
return connection;
}
use of com.adaptris.interlok.junit.scaffolding.jms.MockJmsConnection in project interlok by adaptris.
the class ChannelTest method testConnectionEqualityCheck2DifferentConnections.
@Test
public void testConnectionEqualityCheck2DifferentConnections() throws Exception {
Channel channel = new Channel();
MockJmsConnection produceConnection = createMockJmsConnection(null, "broker1");
MockJmsConnection consumeConnection = createMockJmsConnection(null, "broker2");
channel.setConsumeConnection(consumeConnection);
channel.setProduceConnection(produceConnection);
consumeConnection.init();
produceConnection.init();
channel.init();
}
use of com.adaptris.interlok.junit.scaffolding.jms.MockJmsConnection in project interlok by adaptris.
the class ChannelTest method testConnectionEqualityCheckSameConnectionInstances.
@Test
public void testConnectionEqualityCheckSameConnectionInstances() throws Exception {
Channel channel = new Channel();
MockJmsConnection connection = createMockJmsConnection(null, "broker1");
channel.setConsumeConnection(connection);
channel.setProduceConnection(connection);
channel.init();
}
Aggregations