use of com.adaptris.core.services.metadata.AddMetadataService in project interlok by adaptris.
the class ExceptionHandlingServiceWrapperTest method create.
private ExceptionHandlingServiceWrapper create() {
ExceptionHandlingServiceWrapper service = new ExceptionHandlingServiceWrapper();
AddMetadataService fail = new AddMetadataService();
fail.addMetadataElement("exceptionServiceTriggered", "true");
service.setExceptionHandlingService(fail);
return service;
}
use of com.adaptris.core.services.metadata.AddMetadataService in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_MimeServiceExtractor_ByContentId.
@Test
public void testDoService_MimeServiceExtractor_ByContentId() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
dynamicService.setServiceExtractor(new MimeServiceExtractor(new SelectByContentId("Service")));
AdaptrisMessage msg = createMimeMessage(new ServiceList(new Service[] { metadataService }), ENCODING_8BIT);
execute(dynamicService, msg);
assertEquals(getName(), msg.getMetadataValue(getName()));
}
use of com.adaptris.core.services.metadata.AddMetadataService in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_MimeServiceExtractor_ByPosition.
@Test
public void testDoService_MimeServiceExtractor_ByPosition() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
dynamicService.setServiceExtractor(new MimeServiceExtractor(new SelectByPosition(0)));
AdaptrisMessage msg = createMimeMessage(new ServiceList(new Service[] { metadataService }), ENCODING_7BIT);
execute(dynamicService, msg);
assertEquals(getName(), msg.getMetadataValue(getName()));
}
use of com.adaptris.core.services.metadata.AddMetadataService in project interlok by adaptris.
the class DynamicServiceExecutorTest method testDoService_DefaultServiceExtractor.
@Test
public void testDoService_DefaultServiceExtractor() throws Exception {
AddMetadataService metadataService = new AddMetadataService();
metadataService.addMetadataElement(new MetadataElement(getName(), getName()));
DynamicServiceExecutor dynamicService = createService();
AdaptrisMessage msg = createMessage(metadataService);
execute(dynamicService, msg);
assertEquals(getName(), msg.getMetadataValue(getName()));
}
use of com.adaptris.core.services.metadata.AddMetadataService 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);
}
Aggregations