Package org.switchyard

Examples of org.switchyard.HandlerException


    @Override
    public void before(String target, Exchange exchange) throws HandlerException {
        ++count;
        if (!waitForAfter) {
            throw new HandlerException("Error before on target " + target);
        }
    }
View Full Code Here


    @Override
    public void after(String target, Exchange exchange) throws HandlerException {
        ++count;
        if (waitForAfter) {
            throw new HandlerException("Error after on target " + target);
        }
    }
View Full Code Here

*/
public class RuntimeErrorFaultHandler extends BaseHandler {

    @Override
    public void handleMessage(Exchange exchange) throws HandlerException {
        throw new HandlerException("Standard processing exception");
    }
View Full Code Here

    @Test
    public void testBasicExceptions() throws Exception {
        final IllegalStateException expectedIllegalStateException = new IllegalStateException("expectedIllegalStateException");
        expectedIllegalStateException.fillInStackTrace();
        final HandlerException expectedHandlerException = new HandlerException(expectedIllegalStateException);
        expectedHandlerException.fillInStackTrace();
        final Exception expectedException = new Exception("expectedException", expectedHandlerException);
        expectedException.fillInStackTrace();
        final Exception actualException = serDeser(expectedException, Exception.class);
        final HandlerException actualHandlerException = (HandlerException)actualException.getCause();
        final IllegalStateException actualIllegalStateException = (IllegalStateException)actualHandlerException.getCause();
        Assert.assertEquals(expectedException.getMessage(), actualException.getMessage());
        Assert.assertEquals(expectedHandlerException.getMessage(), actualHandlerException.getMessage());
        Assert.assertEquals(expectedIllegalStateException.getMessage(), actualIllegalStateException.getMessage());
        Assert.assertEquals(expectedException.getStackTrace().length, actualException.getStackTrace().length);
        Assert.assertEquals(expectedHandlerException.getStackTrace().length, actualHandlerException.getStackTrace().length);
        Assert.assertEquals(expectedIllegalStateException.getStackTrace().length, actualIllegalStateException.getStackTrace().length);
        Assert.assertEquals(expectedHandlerException.isWrapper(), actualHandlerException.isWrapper());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.HandlerException

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.