Search in sources :

Example 1 with ServiceCollection

use of com.adaptris.core.ServiceCollection 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)

Example 2 with ServiceCollection

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

the class ExampleWorkflowCase method testSetServiceCollection.

@Test
public void testSetServiceCollection() throws Exception {
    WorkflowImp wf = createWorkflowForGenericTests();
    ServiceCollection obj = wf.getServiceCollection();
    try {
        wf.setServiceCollection(null);
        fail();
    } catch (IllegalArgumentException e) {
    }
    assertEquals(obj, wf.getServiceCollection());
}
Also used : ServiceCollection(com.adaptris.core.ServiceCollection) WorkflowImp(com.adaptris.core.WorkflowImp) Test(org.junit.Test)

Example 3 with ServiceCollection

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

the class ServiceUtil method rewriteConnectionsForTesting.

public static Service rewriteConnectionsForTesting(Service service) throws CoreException {
    Service rewritten = service;
    if (rewritten instanceof ConnectedService) {
        ConnectedService connectedService = (ConnectedService) rewritten;
        connectedService.setConnection(cloneForTesting(connectedService.getConnection()));
    }
    if (rewritten instanceof ServiceCollection) {
        rewriteConnectionsForTesting((ServiceCollection) rewritten);
    }
    if (rewritten instanceof ServiceWrapper) {
        rewriteConnectionsForTesting((ServiceWrapper) rewritten);
    }
    return rewritten;
}
Also used : ServiceCollection(com.adaptris.core.ServiceCollection) ServiceWrapper(com.adaptris.core.ServiceWrapper) ConnectedService(com.adaptris.core.ConnectedService) Service(com.adaptris.core.Service) ConnectedService(com.adaptris.core.ConnectedService)

Aggregations

ServiceCollection (com.adaptris.core.ServiceCollection)3 ConnectedService (com.adaptris.core.ConnectedService)1 Service (com.adaptris.core.Service)1 ServiceList (com.adaptris.core.ServiceList)1 ServiceWrapper (com.adaptris.core.ServiceWrapper)1 WorkflowImp (com.adaptris.core.WorkflowImp)1 LogMessageService (com.adaptris.core.services.LogMessageService)1 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)1 Test (org.junit.Test)1