use of com.adaptris.util.text.xml.StxTransformerFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testMultipleParameters_STXOutput.
@Test
public void testMultipleParameters_STXOutput() throws Exception {
MultiPayloadAdaptrisMessage msg = MessageHelper.createMultiPayloadMessage(PAYLOAD_ID_SOURCE, PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
msg.addMetadata("world", "World");
msg.addMetadata("one", "World");
msg.addMetadata("two", "World");
msg.addMetadata("three", "World");
msg.addMetadata("four", "World");
MultiPayloadXmlTransformService service = createBaseExample();
service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_STX_TRANSFORM_URL));
service.setXmlTransformerFactory(new StxTransformerFactory());
service.setTransformParameter(new StringMetadataParameter());
execute(service, msg);
assertEquals(PROPERTIES.getProperty(KEY_XML_TEST_OUTPUT) + "World", msg.getContent(PAYLOAD_ID_OUTPUT));
}
use of com.adaptris.util.text.xml.StxTransformerFactory in project interlok by adaptris.
the class MultiPayloadXmlTransformServiceTest method testSingleParameter_STXOutput.
@Test
public void testSingleParameter_STXOutput() throws Exception {
MultiPayloadAdaptrisMessage msg = MessageHelper.createMultiPayloadMessage(PAYLOAD_ID_SOURCE, PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
msg.addMetadata("world", "World");
MultiPayloadXmlTransformService service = createBaseExample();
service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_STX_TRANSFORM_URL));
service.setXmlTransformerFactory(new StxTransformerFactory());
service.setTransformParameter(new StringMetadataParameter());
execute(service, msg);
assertEquals(PROPERTIES.getProperty(KEY_XML_TEST_OUTPUT) + "World", msg.getContent(PAYLOAD_ID_OUTPUT));
}
use of com.adaptris.util.text.xml.StxTransformerFactory in project interlok by adaptris.
the class XmlTransformServiceTest method testSTXOutput.
@Test
public void testSTXOutput() throws Exception {
AdaptrisMessage m1 = MessageHelper.createMessage(PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
XmlTransformService service = new XmlTransformService();
service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_STX_TRANSFORM_URL));
service.setXmlTransformerFactory(new StxTransformerFactory());
execute(service, m1);
assertEquals("payload " + m1.getContent(), PROPERTIES.getProperty(KEY_XML_TEST_OUTPUT), m1.getContent());
}
use of com.adaptris.util.text.xml.StxTransformerFactory in project interlok by adaptris.
the class XmlTransformServiceTest method testSingleParameter_STXOutput.
@Test
public void testSingleParameter_STXOutput() throws Exception {
AdaptrisMessage msg = MessageHelper.createMessage(PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
msg.addMetadata("world", "World");
XmlTransformService service = new XmlTransformService();
service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_STX_TRANSFORM_URL));
service.setXmlTransformerFactory(new StxTransformerFactory());
service.setTransformParameter(new StringMetadataParameter());
execute(service, msg);
assertTrue("payload " + msg.getContent(), msg.getContent().equals(PROPERTIES.getProperty(KEY_XML_TEST_OUTPUT) + "World"));
}
use of com.adaptris.util.text.xml.StxTransformerFactory in project interlok by adaptris.
the class XmlTransformServiceTest method testMultipleParameters_STXOutput.
@Test
public void testMultipleParameters_STXOutput() throws Exception {
AdaptrisMessage msg = MessageHelper.createMessage(PROPERTIES.getProperty(KEY_XML_TEST_INPUT));
msg.addMetadata("world", "World");
msg.addMetadata("one", "World");
msg.addMetadata("two", "World");
msg.addMetadata("three", "World");
msg.addMetadata("four", "World");
XmlTransformService service = new XmlTransformService();
service.setUrl(PROPERTIES.getProperty(KEY_XML_TEST_STX_TRANSFORM_URL));
service.setXmlTransformerFactory(new StxTransformerFactory());
service.setTransformParameter(new StringMetadataParameter());
execute(service, msg);
assertTrue("payload " + msg.getContent(), msg.getContent().equals(PROPERTIES.getProperty(KEY_XML_TEST_OUTPUT) + "World"));
}
Aggregations