use of com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery in project interlok by adaptris.
the class XpathMetadataServiceTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
XpathMetadataService service = new XpathMetadataService();
service.setXpathQueries(new ArrayList<XpathQuery>(Arrays.asList(new ConfiguredXpathQuery("key1", "//source-id"), new ConfiguredXpathQuery("key2", "//destination-id"), new MetadataXpathQuery("key3", "metadataKey_containing_an_XPath"), new MultiItemConfiguredXpathQuery("key4", "//xpath/that/resolves/to/multiple/items"), new MultiItemMetadataXpathQuery("key5", "metadata_containing_an_Xpath_that_resolves_to_multiple_items"), new ConfiguredXpathQuery("key6", "/svrl:output/svrl:value"))));
service.setNamespaceContext(createContextEntries());
return service;
}
use of com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery in project interlok by adaptris.
the class XpathMetadataServiceTest method testPayloadMultipleAttributeValuesXPathIntoMetadata.
@Test
public void testPayloadMultipleAttributeValuesXPathIntoMetadata() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(XML);
XpathMetadataService service = new XpathMetadataService();
service.addXpathQuery(new MultiItemConfiguredXpathQuery("attribute", "//@att"));
execute(service, msg);
assertEquals("att|two|two", msg.getMetadataValue("attribute"));
}
Aggregations