Package org.mule.api

Examples of org.mule.api.DefaultMuleException


        try
        {
            CommandLine line = parser.parse(options, args, true);
            if (line == null)
            {
                throw new DefaultMuleException("Unknown error parsing the Mule command line");
            }

            return line;
        }
        catch (ParseException p)
        {
            throw new DefaultMuleException("Unable to parse the Mule command line because of: " + p.toString(), p);
        }
    }
View Full Code Here


    }

    @Test(expected = MuleException.class)
    public void closeNoisely() throws MuleException
    {
        Mockito.doThrow(new DefaultMuleException(new Exception())).when(this.delegate).close();
        this.producer.close();

    }
View Full Code Here

        {
            return message.getPayloadAsBytes();
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

        {
            return message.getPayloadAsString();
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

        {
            return message.getPayloadAsString(encoding);
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

    }

    @Test
    public void testRollback() throws Exception
    {
        strategy.handleException(new DefaultMuleException(CoreMessages.agentsRunning()));
        assertTrue(tx.isRolledBack());
        //There is nothing to actually commit the transaction since we are not running in a real tx
        assertFalse(tx.isCommitted());
    }
View Full Code Here

        {
            throw new IllegalArgumentException(CoreMessages.objectIsNull("protocol").toString());
        }
        if (!isTransportSupported(protocol))
        {
            throw new DefaultMuleException(
                CoreMessages.schemeNotCompatibleWithConnector(protocol, AxisConnector.class));
        }
        return transports.get(protocol);
    }
View Full Code Here

        // Text exception handler
        SystemExceptionHandler ehandlerMock = mock(SystemExceptionHandler.class);

        assertNotNull(muleContext.getExceptionListener());
        muleContext.setExceptionListener(ehandlerMock);
        muleContext.getExceptionListener().handleException(new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));

        if (connector instanceof AbstractConnector)
        {
            muleContext.getExceptionListener().handleException(
                    new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));
        }


        muleContext.setExceptionListener(null);
        try
        {
            muleContext.getExceptionListener().handleException(new DefaultMuleException(MessageFactory.createStaticMessage("Dummy")));
            fail("Should have thrown exception as no strategy is set");
        }
        catch (RuntimeException e)
        {
            // expected
View Full Code Here

        {
            throw e;
        }
        catch (Exception e)
        {
            throw new DefaultMuleException(e);
        }
    }
View Full Code Here

            }
            else
            {
                if (StringUtils.isEmpty(methodName))
                {
                    throw new DefaultMuleException(CoreMessages.propertiesNotSet("methodName"));
                }
               
                return script.invokeMethod(methodName, eventContext.getMessage().getPayload());
            }
           
        }
       
        throw new Exception(new DefaultMuleException("script engine not supported"));
    }
View Full Code Here

TOP

Related Classes of org.mule.api.DefaultMuleException

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.