Search in sources :

Example 1 with TruncateMetadata

use of com.adaptris.core.util.TruncateMetadata in project interlok by adaptris.

the class XpathMetadataServiceTest method testDoService_NotXML.

@Test
public void testDoService_NotXML() throws Exception {
    AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("ABCDEFG");
    XpathMetadataService service = new XpathMetadataService().withMetadataLogger(new TruncateMetadata(20));
    service.setXpathQueries(new ArrayList<XpathQuery>(Arrays.asList(new ConfiguredXpathQuery("source", "//source-id"), new ConfiguredXpathQuery("destination", "//destination-id"))));
    try {
        execute(service, msg);
        fail();
    } catch (ServiceException expected) {
    }
}
Also used : TruncateMetadata(com.adaptris.core.util.TruncateMetadata) 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) ServiceException(com.adaptris.core.ServiceException) AdaptrisMessage(com.adaptris.core.AdaptrisMessage) MultiItemConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.MultiItemConfiguredXpathQuery) ConfiguredXpathQuery(com.adaptris.core.services.metadata.xpath.ConfiguredXpathQuery) Test(org.junit.Test)

Example 2 with TruncateMetadata

use of com.adaptris.core.util.TruncateMetadata in project interlok by adaptris.

the class MetadataServiceImplTest method testMetadataLogger.

@Test
public void testMetadataLogger() {
    TruncateMetadata logger = new TruncateMetadata(10);
    withMetadataLogger(logger);
    assertNotNull(getMetadataLogger());
    assertEquals(logger, getMetadataLogger());
    assertEquals(TruncateMetadata.class, getMetadataLogger().getClass());
}
Also used : TruncateMetadata(com.adaptris.core.util.TruncateMetadata) Test(org.junit.Test)

Aggregations

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