Search in sources :

Example 6 with BranchingServiceCollection

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

the class SyntaxBranchingServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    BranchingServiceCollection sl = new BranchingServiceCollection();
    SyntaxBranchingService sbs = new SyntaxBranchingService();
    sbs.setUniqueId("determineDocType");
    sbs.setSyntaxIdentifiers(createStandardIdentifiers());
    sbs.addSyntaxIdentifier(new AlwaysMatchSyntaxIdentifier("alwaysMatches"));
    sl.addService(sbs);
    sl.setFirstServiceId(sbs.getUniqueId());
    sl.addService(new LogMessageService("isPostcode"));
    sl.addService(new LogMessageService("isXml"));
    sl.addService(new LogMessageService("alwaysMatches"));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) LogMessageService(com.adaptris.core.services.LogMessageService)

Example 7 with BranchingServiceCollection

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

the class CheckUniqueMetadataValueServiceTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    service.setUniqueId("CheckMetadataUniqueNess");
    service.setStoreFileUrl("file:///path/to/store.file");
    service.setMetadataKeyToCheck("metadata-key");
    BranchingServiceCollection sl = new BranchingServiceCollection();
    sl.addService(service);
    sl.setFirstServiceId(service.getUniqueId());
    sl.addService(new LogMessageService(CheckUniqueMetadataValueService.DEFAULT_SERVICE_ID_UNIQUE));
    sl.addService(new LogMessageService(CheckUniqueMetadataValueService.DEFAULT_SERVICE_ID_DUPLICATE));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) LogMessageService(com.adaptris.core.services.LogMessageService)

Example 8 with BranchingServiceCollection

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

the class BranchingServiceEnablerTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    BranchingServiceEnabler s = new BranchingServiceEnabler(new Base64DecodeService());
    s.setFailureId(FAIL);
    s.setSuccessId(SUCCESS);
    BranchingServiceCollection sl = new BranchingServiceCollection();
    sl.addService(s);
    sl.setFirstServiceId(s.getUniqueId());
    sl.addService(new LogMessageService(FAIL));
    sl.addService(new LogMessageService(SUCCESS));
    return sl;
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection)

Example 9 with BranchingServiceCollection

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

the class EmbeddedScriptingServiceTest method testBranchingServiceExecution_NoNextServiceId.

@Test
public void testBranchingServiceExecution_NoNextServiceId() throws Exception {
    BranchingServiceCollection bsc = new BranchingServiceCollection();
    bsc.setFirstServiceId(getName());
    bsc.add(createServiceForBranch(getName(), null));
    bsc.add(createService(NEXT_SERVICE_ID));
    AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
    msg.addMetadata(MY_METADATA_KEY, MY_METADATA_VALUE);
    execute(bsc, msg);
    assertTrue(msg.headersContainsKey(MY_METADATA_KEY));
    assertEquals(MY_METADATA_VALUE, msg.getMetadataValue(MY_METADATA_KEY));
    assertEquals(MY_METADATA_VALUE, msg.getMetadataValue(MY_METADATA_KEY3));
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) Test(org.junit.Test)

Example 10 with BranchingServiceCollection

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

the class JettyRoutingServiceTest method createBaseFileName.

@Override
protected String createBaseFileName(Object object) {
    BranchingServiceCollection bs = (BranchingServiceCollection) object;
    JettyRoutingService s = (JettyRoutingService) bs.getServices().get(0);
    return s.getClass().getCanonicalName();
}
Also used : BranchingServiceCollection(com.adaptris.core.BranchingServiceCollection)

Aggregations

BranchingServiceCollection (com.adaptris.core.BranchingServiceCollection)13 LogMessageService (com.adaptris.core.services.LogMessageService)7 ConfiguredException (com.adaptris.core.services.exception.ConfiguredException)3 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)3 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)2 Test (org.junit.Test)2 MetadataElement (com.adaptris.core.MetadataElement)1 NullService (com.adaptris.core.NullService)1 AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)1