Search in sources :

Example 1 with AbstractExceptionListener

use of org.mule.runtime.core.privileged.exception.AbstractExceptionListener in project mule by mulesoft.

the class ExceptionListenerTestCase method setGoodProcessors.

@Test
public void setGoodProcessors() throws Exception {
    List<Processor> list = new ArrayList<Processor>();
    list.add(mock(Processor.class));
    list.add(mock(Processor.class));
    AbstractExceptionListener router = new OnErrorPropagateHandler();
    assertNotNull(router.getMessageProcessors());
    assertEquals(0, router.getMessageProcessors().size());
    router.setMessageProcessors(singletonList(mock(Processor.class)));
    assertEquals(1, router.getMessageProcessors().size());
    router.setMessageProcessors(list);
    assertNotNull(router.getMessageProcessors());
    assertEquals(2, router.getMessageProcessors().size());
}
Also used : AbstractExceptionListener(org.mule.runtime.core.privileged.exception.AbstractExceptionListener) Processor(org.mule.runtime.core.api.processor.Processor) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with AbstractExceptionListener

use of org.mule.runtime.core.privileged.exception.AbstractExceptionListener in project mule by mulesoft.

the class ExceptionListenerTestCase method setSingleGoodProcessorEndpoint.

@Test
public void setSingleGoodProcessorEndpoint() throws Exception {
    AbstractExceptionListener router = new OnErrorPropagateHandler();
    Processor messageProcessor = mock(Processor.class);
    router.setMessageProcessors(singletonList(messageProcessor));
    assertNotNull(router.getMessageProcessors());
    assertTrue(router.getMessageProcessors().contains(messageProcessor));
}
Also used : AbstractExceptionListener(org.mule.runtime.core.privileged.exception.AbstractExceptionListener) Processor(org.mule.runtime.core.api.processor.Processor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Processor (org.mule.runtime.core.api.processor.Processor)2 AbstractExceptionListener (org.mule.runtime.core.privileged.exception.AbstractExceptionListener)2 ArrayList (java.util.ArrayList)1