Search in sources :

Example 26 with DefaultMuleException

use of org.mule.runtime.api.exception.DefaultMuleException in project mule by mulesoft.

the class ExceptionsTestCase method testExceptionChaining.

@Test
public void testExceptionChaining() {
    String rootMsg = "Root Test Exception Message";
    String msg = "Test Exception Message";
    Exception e = new MuleContextException(I18nMessageFactory.createStaticMessage(msg), new DefaultMuleException(I18nMessageFactory.createStaticMessage(rootMsg)));
    assertEquals(rootMsg, e.getCause().getMessage());
    assertEquals(msg, e.getMessage());
    assertEquals(e.getClass().getName() + ": " + msg, e.toString());
}
Also used : DefaultMuleException(org.mule.runtime.api.exception.DefaultMuleException) DefaultMuleException(org.mule.runtime.api.exception.DefaultMuleException) MuleException(org.mule.runtime.api.exception.MuleException) RoutingException(org.mule.runtime.core.privileged.routing.RoutingException) Test(org.junit.Test)

Aggregations

DefaultMuleException (org.mule.runtime.api.exception.DefaultMuleException)26 Test (org.junit.Test)12 MuleException (org.mule.runtime.api.exception.MuleException)12 MessagingException (org.mule.runtime.core.internal.exception.MessagingException)8 SmallTest (org.mule.tck.size.SmallTest)6 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)5 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)5 IOException (java.io.IOException)3 ConnectionException (org.mule.runtime.api.connection.ConnectionException)3 URL (java.net.URL)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 ConnectionProvider (org.mule.runtime.api.connection.ConnectionProvider)2 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)2 ObjectStoreException (org.mule.runtime.api.store.ObjectStoreException)2 MuleCoreExtension (org.mule.runtime.container.api.MuleCoreExtension)2 Processor (org.mule.runtime.core.api.processor.Processor)2 MessageProcessors.processToApply (org.mule.runtime.core.privileged.processor.MessageProcessors.processToApply)2 RegistrationException (org.mule.runtime.core.privileged.registry.RegistrationException)2 RoutingException (org.mule.runtime.core.privileged.routing.RoutingException)2