use of com.adaptris.core.jms.jndi.SimpleFactoryConfiguration in project interlok by adaptris.
the class JndiPtpProducerCase method testProduceAndConsume_ExtraConfig.
@Test
public void testProduceAndConsume_ExtraConfig() throws Exception {
SimpleFactoryConfiguration sfc = new SimpleFactoryConfiguration();
KeyValuePairSet kvps = new KeyValuePairSet();
kvps.add(new KeyValuePair("ClientID", "testProduceAndConsume_ExtraConfig"));
kvps.add(new KeyValuePair("UseCompression", "true"));
sfc.setProperties(kvps);
String queueName = testName.getMethodName() + "_queue";
String topicName = testName.getMethodName() + "_topic";
StandardJndiImplementation recvVendorImp = createVendorImplementation();
StandardJndiImplementation sendVendorImp = createVendorImplementation();
sendVendorImp.setExtraFactoryConfiguration(sfc);
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJndiPtpConnection(recvVendorImp, false, queueName, topicName), new PtpConsumer().withQueue(queueName));
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJndiPtpConnection(sendVendorImp, false, queueName, topicName), new PtpProducer().withQueue((queueName)));
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms);
}
use of com.adaptris.core.jms.jndi.SimpleFactoryConfiguration in project interlok by adaptris.
the class JndiImplementationCase method testSetExtraConfiguration.
@Test
public void testSetExtraConfiguration() throws Exception {
BaseJndiImplementation jv = createVendorImplementation();
assertEquals(NoOpFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
jv.setExtraFactoryConfiguration(new SimpleFactoryConfiguration());
assertEquals(SimpleFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
try {
jv.setExtraFactoryConfiguration(null);
fail();
} catch (IllegalArgumentException expected) {
}
assertEquals(SimpleFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
}
use of com.adaptris.core.jms.jndi.SimpleFactoryConfiguration in project interlok by adaptris.
the class JndiPasProducerCase method testProduceAndConsume_ExtraConfig.
@Test
public void testProduceAndConsume_ExtraConfig() throws Exception {
String queueName = testName.getMethodName() + "_queue";
String topicName = testName.getMethodName() + "_topic";
SimpleFactoryConfiguration sfc = new SimpleFactoryConfiguration();
KeyValuePairSet kvps = new KeyValuePairSet();
kvps.add(new KeyValuePair("ClientID", "testProduceAndConsume_ExtraConfig"));
kvps.add(new KeyValuePair("UseCompression", "true"));
sfc.setProperties(kvps);
StandardJndiImplementation recvVendorImp = createVendorImplementation();
StandardJndiImplementation sendVendorImp = createVendorImplementation();
sendVendorImp.setExtraFactoryConfiguration(sfc);
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJndiPasConnection(recvVendorImp, false, queueName, topicName), new PasConsumer().withTopic(topicName));
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJndiPasConnection(sendVendorImp, false, queueName, topicName), new PasProducer().withTopic(topicName));
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms, 1);
}
use of com.adaptris.core.jms.jndi.SimpleFactoryConfiguration in project interlok by adaptris.
the class JndiExtraConfigPtpProducerTest method createJndiVendorImpExample.
static JmsConnection createJndiVendorImpExample(StandardJndiImplementation jndi, JmsConnection c) {
JndiPtpProducerTest.createJndiVendorImpExample(jndi, c);
SimpleFactoryConfiguration sfc = new SimpleFactoryConfiguration();
KeyValuePairSet jndiExtras = sfc.getProperties();
jndiExtras.add(new KeyValuePair("ConnectID", "MyConnectId"));
jndiExtras.add(new KeyValuePair("PingInterval", "10"));
jndi.setExtraFactoryConfiguration(sfc);
return c;
}
Aggregations