Package org.apache.camel.model

Examples of org.apache.camel.model.OnExceptionDefinition


        assertEquals(type1, result);
    }

    public void testDirectMatch2() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new Exception(""));
        assertEquals(type2, result);
    }
View Full Code Here


        assertEquals(type2, result);
    }

    public void testDirectMatch3() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new IOException(""));
        assertEquals(type3, result);
    }
View Full Code Here

        assertEquals(type3, result);
    }

    public void testClosetMatch3() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new ConnectException(""));
        assertEquals(type3, result);

        result = strategy.getExceptionPolicy(policies, null, new SocketException(""));
        assertEquals(type3, result);
View Full Code Here

        assertEquals(type3, result);
    }

    public void testClosetMatch2() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new ClassCastException(""));
        assertEquals(type2, result);

        result = strategy.getExceptionPolicy(policies, null, new NumberFormatException(""));
        assertEquals(type2, result);
View Full Code Here

        assertEquals(type2, result);
    }

    public void testClosetMatch1() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new ValidationException(null, ""));
        assertEquals(type1, result);

        result = strategy.getExceptionPolicy(policies, null, new ExchangeTimedOutException(null, 0));
        assertEquals(type1, result);
    }
View Full Code Here

        assertEquals(type1, result);
    }

    public void testNoMatch1ThenMatchingJustException() {
        setupPolicies();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
        assertEquals(type2, result);
    }
View Full Code Here

        assertEquals(type2, result);
    }

    public void testNoMatch1ThenNull() {
        setupPoliciesNoTopLevelException();
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
        assertNull("Should not find an exception policy to use", result);
    }
View Full Code Here

    public void testCausedBy() {
        setupPoliciesCausedBy();

        IOException ioe = new IOException("Damm");
        ioe.initCause(new FileNotFoundException("Somefile not found"));
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, ioe);
        assertEquals(type1, result);
    }
View Full Code Here

    public void testCausedByWrapped() {
        setupPoliciesCausedBy();

        IOException ioe = new IOException("Damm");
        ioe.initCause(new FileNotFoundException("Somefile not found"));
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new RuntimeCamelException(ioe));
        assertEquals(type1, result);
    }
View Full Code Here

    public void testCausedByNotConnected() {
        setupPoliciesCausedBy();

        IOException ioe = new IOException("Damm");
        ioe.initCause(new ConnectException("Not connected"));
        OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, ioe);
        assertEquals(type3, result);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.OnExceptionDefinition

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.