Search in sources :

Example 6 with OnExceptionDefinition

use of org.apache.camel.model.OnExceptionDefinition in project camel by apache.

the class DefaultExceptionPolicyStrategyTest method testDirectMatch1.

public void testDirectMatch1() {
    setupPolicies();
    OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new CamelExchangeException("", null));
    assertEquals(type1, result);
}
Also used : CamelExchangeException(org.apache.camel.CamelExchangeException) OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition)

Example 7 with OnExceptionDefinition

use of org.apache.camel.model.OnExceptionDefinition in project camel by apache.

the class DefaultExceptionPolicyStrategyTest method testNoMatch1ThenNull.

public void testNoMatch1ThenNull() {
    setupPoliciesNoTopLevelException();
    OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
    assertNull("Should not find an exception policy to use", result);
}
Also used : AlreadyStoppedException(org.apache.camel.AlreadyStoppedException) OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition)

Example 8 with OnExceptionDefinition

use of org.apache.camel.model.OnExceptionDefinition in project camel by apache.

the class DefaultExceptionPolicyStrategyTest method testClosetMatch1.

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);
}
Also used : ValidationException(org.apache.camel.ValidationException) OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition) ExchangeTimedOutException(org.apache.camel.ExchangeTimedOutException)

Example 9 with OnExceptionDefinition

use of org.apache.camel.model.OnExceptionDefinition in project camel by apache.

the class DefaultExceptionPolicyStrategyTest method testDirectMatch3.

public void testDirectMatch3() {
    setupPolicies();
    OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new IOException(""));
    assertEquals(type3, result);
}
Also used : OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition) IOException(java.io.IOException)

Example 10 with OnExceptionDefinition

use of org.apache.camel.model.OnExceptionDefinition in project camel by apache.

the class DefaultExceptionPolicyStrategyTest method testNoMatch1ThenMatchingJustException.

public void testNoMatch1ThenMatchingJustException() {
    setupPolicies();
    OnExceptionDefinition result = strategy.getExceptionPolicy(policies, null, new AlreadyStoppedException());
    assertEquals(type2, result);
}
Also used : AlreadyStoppedException(org.apache.camel.AlreadyStoppedException) OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition)

Aggregations

OnExceptionDefinition (org.apache.camel.model.OnExceptionDefinition)24 IOException (java.io.IOException)9 FileNotFoundException (java.io.FileNotFoundException)6 ConnectException (java.net.ConnectException)5 AlreadyStoppedException (org.apache.camel.AlreadyStoppedException)4 CamelExchangeException (org.apache.camel.CamelExchangeException)4 MalformedURLException (java.net.MalformedURLException)3 SocketException (java.net.SocketException)3 ExchangeTimedOutException (org.apache.camel.ExchangeTimedOutException)3 RuntimeCamelException (org.apache.camel.RuntimeCamelException)3 ValidationException (org.apache.camel.ValidationException)3 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 AsyncCallback (org.apache.camel.AsyncCallback)1 AsyncProcessor (org.apache.camel.AsyncProcessor)1 Processor (org.apache.camel.Processor)1 DefaultRouteNode (org.apache.camel.impl.DefaultRouteNode)1