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;
}
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;
}
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;
}
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));
}
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();
}
Aggregations