Search in sources :

Example 31 with ServiceList

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

the class AdvancedMessageSplitterServiceTest method testInit.

@Override
public void testInit() throws Exception {
    AdvancedMessageSplitterService service = createForTests();
    try {
        service.init();
        fail();
    } catch (CoreException expected) {
    }
    service.setSplitter(new LineCountSplitter());
    service.setService(new ServiceList());
    service.init();
    assertNotNull(service.wrappedServices());
    assertEquals(1, service.wrappedServices().length);
}
Also used : CoreException(com.adaptris.core.CoreException) ServiceList(com.adaptris.core.ServiceList)

Example 32 with ServiceList

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

the class SplitterCase method createPooling.

static PoolingMessageSplitterService createPooling(MessageSplitter ms, Service... services) {
    PoolingMessageSplitterService service = new PoolingMessageSplitterService();
    ServiceList sl = new ServiceList(services);
    service.setSplitter(ms);
    service.setService(sl);
    service.setMaxThreads(5);
    return service;
}
Also used : ServiceList(com.adaptris.core.ServiceList)

Example 33 with ServiceList

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

the class SplitterCase method createAdvanced.

static AdvancedMessageSplitterService createAdvanced(MessageSplitter ms, Service... services) {
    AdvancedMessageSplitterService service = new AdvancedMessageSplitterService();
    ServiceList sl = new ServiceList(services);
    service.setSplitter(ms);
    service.setService(sl);
    return service;
}
Also used : ServiceList(com.adaptris.core.ServiceList)

Example 34 with ServiceList

use of com.adaptris.core.ServiceList 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 35 with ServiceList

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

the class ExampleChannelCase method createServiceCollection.

private ServiceCollection createServiceCollection() throws CoreException {
    ServiceCollection services = new ServiceList();
    AddMetadataService service = new AddMetadataService();
    service.addMetadataElement("key1", "val1");
    services.addService(service);
    services.addService(new LogMessageService());
    return services;
}
Also used : ServiceCollection(com.adaptris.core.ServiceCollection) ServiceList(com.adaptris.core.ServiceList) LogMessageService(com.adaptris.core.services.LogMessageService) AddMetadataService(com.adaptris.core.services.metadata.AddMetadataService)

Aggregations

ServiceList (com.adaptris.core.ServiceList)64 Test (org.junit.Test)52 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)43 StandaloneProducer (com.adaptris.core.StandaloneProducer)39 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)33 Channel (com.adaptris.core.Channel)31 JettyHelper.createChannel (com.adaptris.core.http.jetty.JettyHelper.createChannel)29 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)23 HttpConnection (com.adaptris.core.http.jetty.HttpConnection)20 JettyMessageConsumer (com.adaptris.core.http.jetty.JettyMessageConsumer)20 StandardResponseProducer (com.adaptris.core.http.jetty.StandardResponseProducer)20 DefaultMessageFactory (com.adaptris.core.DefaultMessageFactory)18 HttpConsumerTest (com.adaptris.core.http.jetty.HttpConsumerTest)18 PayloadFromTemplateService (com.adaptris.core.services.metadata.PayloadFromTemplateService)17 Service (com.adaptris.core.Service)16 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)16 MetadataElement (com.adaptris.core.MetadataElement)14 ConfiguredRequestMethodProvider (com.adaptris.core.http.client.ConfiguredRequestMethodProvider)11 LogMessageService (com.adaptris.core.services.LogMessageService)11 StandardWorkflow (com.adaptris.core.StandardWorkflow)10