Search in sources :

Example 1 with StatelessServiceWrapper

use of com.adaptris.core.services.StatelessServiceWrapper in project interlok by adaptris.

the class AdapterComponentCheckerTest method createConnectedServices.

private String createConnectedServices(String sharedName) throws Exception {
    ServiceList nestedList = new ServiceList();
    nestedList.add(new StandaloneProducer(new MockAllowsRetriesConnection(6), new NullMessageProducer()));
    if (!StringUtils.isEmpty(sharedName)) {
        nestedList.add(new StatelessServiceWrapper(new StandaloneProducer(new SharedConnection(sharedName), new NullMessageProducer())));
    } else {
        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 : SharedConnection(com.adaptris.core.SharedConnection) 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)

Example 2 with StatelessServiceWrapper

use of com.adaptris.core.services.StatelessServiceWrapper in project interlok by adaptris.

the class ServiceUtilTest method testRewriteForTesting_NoConnection.

@Test
public void testRewriteForTesting_NoConnection() throws Exception {
    NullService nullService = new NullService();
    JdbcServiceList jdbcService = new JdbcServiceList();
    StatelessServiceWrapper stateless = new StatelessServiceWrapper(new StandaloneProducer());
    assertTrue(nullService == rewriteConnectionsForTesting(nullService));
    assertTrue(jdbcService == rewriteConnectionsForTesting(jdbcService));
    assertTrue(stateless == rewriteConnectionsForTesting(stateless));
    ServiceList nestedList = new ServiceList();
    ServiceList list = new ServiceList();
    list.add(nestedList);
    assertTrue(list == rewriteConnectionsForTesting(list));
}
Also used : ServiceList(com.adaptris.core.ServiceList) JdbcServiceList(com.adaptris.core.services.jdbc.JdbcServiceList) NullService(com.adaptris.core.NullService) JdbcServiceList(com.adaptris.core.services.jdbc.JdbcServiceList) StatelessServiceWrapper(com.adaptris.core.services.StatelessServiceWrapper) StandaloneProducer(com.adaptris.core.StandaloneProducer) Test(org.junit.Test)

Example 3 with StatelessServiceWrapper

use of com.adaptris.core.services.StatelessServiceWrapper 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

ServiceList (com.adaptris.core.ServiceList)3 StandaloneProducer (com.adaptris.core.StandaloneProducer)3 StatelessServiceWrapper (com.adaptris.core.services.StatelessServiceWrapper)3 JdbcServiceList (com.adaptris.core.services.jdbc.JdbcServiceList)3 MetadataElement (com.adaptris.core.MetadataElement)2 NullMessageProducer (com.adaptris.core.NullMessageProducer)2 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)2 MockAllowsRetriesConnection (com.adaptris.core.stubs.MockAllowsRetriesConnection)2 ArrayList (java.util.ArrayList)2 NullService (com.adaptris.core.NullService)1 SharedConnection (com.adaptris.core.SharedConnection)1 Test (org.junit.Test)1