Search in sources :

Example 11 with NullMessageProducer

use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.

the class ServiceUtilTest method testRewriteForTesting_RetriesConnection.

@Test
public void testRewriteForTesting_RetriesConnection() throws Exception {
    MockAllowsRetriesConnection conn = new MockAllowsRetriesConnection(55);
    StandaloneProducer service = new StandaloneProducer(conn, new NullMessageProducer());
    StandaloneProducer rewritten = ((StandaloneProducer) rewriteConnectionsForTesting(service));
    assertNotSame(conn, rewritten.getConnection());
    assertNotSame(55, ((AllowsRetriesConnection) rewritten.getConnection()).getConnectionAttempts());
}
Also used : StandaloneProducer(com.adaptris.core.StandaloneProducer) NullMessageProducer(com.adaptris.core.NullMessageProducer) MockAllowsRetriesConnection(com.adaptris.core.stubs.MockAllowsRetriesConnection) Test(org.junit.Test)

Example 12 with NullMessageProducer

use of com.adaptris.core.NullMessageProducer in project interlok by adaptris.

the class ServiceUtilTest method createConnectedServices.

private String createConnectedServices() throws Exception {
    ServiceList nestedList = new ServiceList();
    nestedList.add(new StandaloneProducer(new MockAllowsRetriesConnection(6), new NullMessageProducer()));
    nestedList.add(new StatelessServiceWrapper(new StandaloneProducer()));
    nestedList.add(new AddMetadataService(new ArrayList(Arrays.asList(new MetadataElement[] { new MetadataElement("key", "value") }))));
    ServiceList list = new ServiceList();
    list.add(nestedList);
    list.add(new JdbcServiceList());
    return DefaultMarshaller.getDefaultMarshaller().marshal(list);
}
Also used : ServiceList(com.adaptris.core.ServiceList) JdbcServiceList(com.adaptris.core.services.jdbc.JdbcServiceList) ArrayList(java.util.ArrayList) JdbcServiceList(com.adaptris.core.services.jdbc.JdbcServiceList) MetadataElement(com.adaptris.core.MetadataElement) AddMetadataService(com.adaptris.core.services.metadata.AddMetadataService) StandaloneProducer(com.adaptris.core.StandaloneProducer) NullMessageProducer(com.adaptris.core.NullMessageProducer) StatelessServiceWrapper(com.adaptris.core.services.StatelessServiceWrapper) MockAllowsRetriesConnection(com.adaptris.core.stubs.MockAllowsRetriesConnection)

Aggregations

NullMessageProducer (com.adaptris.core.NullMessageProducer)12 Test (org.junit.Test)7 NullMessageConsumer (com.adaptris.core.NullMessageConsumer)5 StandaloneProducer (com.adaptris.core.StandaloneProducer)5 NullConnection (com.adaptris.core.NullConnection)3 MockAllowsRetriesConnection (com.adaptris.core.stubs.MockAllowsRetriesConnection)3 JMSException (javax.jms.JMSException)3 MetadataElement (com.adaptris.core.MetadataElement)2 ServiceList (com.adaptris.core.ServiceList)2 StatelessServiceWrapper (com.adaptris.core.services.StatelessServiceWrapper)2 JdbcServiceList (com.adaptris.core.services.jdbc.JdbcServiceList)2 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)2 ArrayList (java.util.ArrayList)2 Adapter (com.adaptris.core.Adapter)1 AdaptrisMessageConsumer (com.adaptris.core.AdaptrisMessageConsumer)1 Channel (com.adaptris.core.Channel)1 CoreException (com.adaptris.core.CoreException)1 SharedConnection (com.adaptris.core.SharedConnection)1 StandardWorkflow (com.adaptris.core.StandardWorkflow)1