Search in sources :

Example 16 with MessageTypeTranslatorImp

use of com.adaptris.core.jms.MessageTypeTranslatorImp in project interlok by adaptris.

the class MessageTypeTranslatorCase method testSetMetadataFilter.

@Test
public void testSetMetadataFilter() throws Exception {
    MessageTypeTranslatorImp translator = createTranslator();
    assertNull(translator.getMetadataFilter());
    assertNotNull(translator.metadataFilter());
    assertEquals(NoOpMetadataFilter.class, translator.metadataFilter().getClass());
    RegexMetadataFilter filter = new RegexMetadataFilter();
    translator.setMetadataFilter(filter);
    assertEquals(filter, translator.getMetadataFilter());
    assertEquals(filter, translator.metadataFilter());
    translator.setMetadataFilter(null);
    assertNull(translator.getMetadataFilter());
    assertNotNull(translator.metadataFilter());
    assertEquals(NoOpMetadataFilter.class, translator.metadataFilter().getClass());
}
Also used : RegexMetadataFilter(com.adaptris.core.metadata.RegexMetadataFilter) MessageTypeTranslatorImp(com.adaptris.core.jms.MessageTypeTranslatorImp) Test(org.junit.Test)

Example 17 with MessageTypeTranslatorImp

use of com.adaptris.core.jms.MessageTypeTranslatorImp in project interlok by adaptris.

the class MessageTypeTranslatorCase method testSetReportAllErrors.

@Test
public void testSetReportAllErrors() throws Exception {
    MessageTypeTranslatorImp translator = createTranslator();
    assertNull(translator.getReportAllErrors());
    assertFalse(translator.reportAllErrors());
    translator.setReportAllErrors(Boolean.TRUE);
    assertEquals(Boolean.TRUE, translator.getReportAllErrors());
    assertTrue(translator.reportAllErrors());
    translator.setReportAllErrors(null);
    assertNull(translator.getReportAllErrors());
    assertFalse(translator.reportAllErrors());
}
Also used : MessageTypeTranslatorImp(com.adaptris.core.jms.MessageTypeTranslatorImp) Test(org.junit.Test)

Aggregations

MessageTypeTranslatorImp (com.adaptris.core.jms.MessageTypeTranslatorImp)17 Test (org.junit.Test)17 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)13 Message (javax.jms.Message)13 Session (javax.jms.Session)13 DefaultMessageFactory (com.adaptris.core.DefaultMessageFactory)4 JmsConnection (com.adaptris.core.jms.JmsConnection)4 ActiveMQSession (org.apache.activemq.ActiveMQSession)4 RegexMetadataFilter (com.adaptris.core.metadata.RegexMetadataFilter)3 RemoveAllMetadataFilter (com.adaptris.core.metadata.RemoveAllMetadataFilter)2 MetadataElement (com.adaptris.core.MetadataElement)1 StandaloneProducer (com.adaptris.core.StandaloneProducer)1 NoOpMetadataFilter (com.adaptris.core.metadata.NoOpMetadataFilter)1