Search in sources :

Example 1 with MultiItemConfiguredXpathQuery

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;
}
Also used : MetadataXpathQuery(com.adaptris.core.services.metadata.xpath.MetadataXpathQuery) MultiItemMetadataXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemMetadataXpathQuery) XpathQuery(com.adaptris.core.services.metadata.xpath.XpathQuery) MultiItemConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery) MetadataXpathQuery(com.adaptris.core.services.metadata.xpath.MetadataXpathQuery) MultiItemMetadataXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemMetadataXpathQuery) ConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.ConfiguredXpathQuery) MultiItemConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery) ConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.ConfiguredXpathQuery) MultiItemMetadataXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemMetadataXpathQuery) MultiItemConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery)

Example 2 with MultiItemConfiguredXpathQuery

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"));
}
Also used : AdaptrisMessage(com.adaptris.core.AdaptrisMessage) MultiItemConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery) Test(org.junit.Test)

Aggregations

MultiItemConfiguredXpathQuery (com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery)2 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 ConfiguredXpathQuery (com.adaptris.core.services.metadata.xpath.ConfiguredXpathQuery)1 MetadataXpathQuery (com.adaptris.core.services.metadata.xpath.MetadataXpathQuery)1 MultiItemMetadataXpathQuery (com.adaptris.core.services.metadata.xpath.MultiItemMetadataXpathQuery)1 XpathQuery (com.adaptris.core.services.metadata.xpath.XpathQuery)1 Test (org.junit.Test)1