Package org.mule.api

Examples of org.mule.api.MuleException


    static Log log = LogFactory.getLog(MuleAbstractTransportMessageHandlerTestCase.class);

    @Test
    public void testStartRethrowsMuleExceptionCorrectly() throws Exception
    {
        final MuleException someMuleException = mock(MuleException.class);
        AbstractTransportMessageHandler connectable = new AbstractTransportMessageHandler(createDummyEndpoint())
        {
            @Override
            protected void doStart() throws MuleException
            {
View Full Code Here


    }

    public static MuleException getRootMuleException(Throwable t)
    {
        Throwable cause = t;
        MuleException exception = null;
        while (cause != null)
        {
            if (cause instanceof MuleException)
            {
                exception = (MuleException) cause;
View Full Code Here

    private Throwable exception;

    public DefaultExceptionPayload(Throwable exception)
    {
        this.exception = exception;
        MuleException muleRoot = ExceptionHelper.getRootMuleException(exception);
        if (muleRoot != null)
        {
            message = muleRoot.getMessage();
            code = muleRoot.getExceptionCode();
            info = muleRoot.getInfo();
        }
        else
        {
            message = exception.getMessage();
        }
View Full Code Here

     *
     * @param t the exception thrown
     */
    protected void logException(Throwable t)
    {
        MuleException muleException = ExceptionHelper.getRootMuleException(t);
        if (muleException != null)
        {
            logger.error(muleException.getDetailedMessage());
        }
        else
        {
            logger.error("Caught exception in Exception Strategy: " + t.getMessage(), t);
        }
View Full Code Here

                    }
                    phaseResultNotifier.phaseSuccessfully();
                }
                catch (Exception e)
                {
                    MuleException me = new DefaultMuleException(e);
                    try
                    {
                        flowProcessingPhaseTemplate.afterFailureProcessingFlow(me);
                    }
                    catch (MuleException e1)
View Full Code Here

        assertTrue(router.isMatch(message));

        final MuleSession session = mock(MuleSession.class);
        // exception to throw
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, null, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);
        // 1st failure
        when(mockendpoint1.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(rex));
        when(mockendpoint2.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(event));

        MuleEvent actualResult = router.route(new OutboundRoutingTestEvent(message, session, muleContext));
View Full Code Here

        assertTrue(router.isMatch(message));

        final MuleSession session = mock(MuleSession.class);
        // exception to throw
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, null, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);

        when(mockendpoint1.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(rex));
        when(mockendpoint2.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(event));

        MuleEvent actualResult = router.route(new OutboundRoutingTestEvent(message, session, muleContext));
View Full Code Here

        assertTrue(router.isMatch(message));

        // exception to throw
        MuleSession session = mock(MuleSession.class);
        MuleEvent eventToThrow = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, null, session);
        MuleException rex = new RoutingException(eventToThrow, endpoint1);
        when(mockendpoint1.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(rex));
        when(mockendpoint2.process(any(MuleEvent.class))).thenAnswer(new MuleEventCheckAnswer(rex));
        MuleEvent result = null;
        try
        {
View Full Code Here

            {
                ExceptionPayload wsException = message.getExceptionPayload();

                if (wsException != null)
                {
                    MuleException exception = ExceptionHelper.getRootMuleException(wsException.getException());
                    // if the exception has a cause, then throw only the cause
                    if (exception.getCause() != null)
                    {
                        throw exception.getCause();
                    }
                    else
                    {
                        throw exception;
                    }
View Full Code Here

  }
 
  @Override
  public void start() throws MuleException
  {
    throw new MuleException(MessageFactory.createStaticMessage("TOO RUDE!")){};
  }
View Full Code Here

TOP

Related Classes of org.mule.api.MuleException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.