CAMEL-6944: Exchange should include id in toString so users can use that for tracking etc.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/404246e8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/404246e8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/404246e8 Branch: refs/heads/master Commit: 404246e8f348297d4aa770e9dc0c2590711c1021 Parents: 7bfdef2 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Jul 10 15:57:58 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Jul 10 16:21:55 2015 +0200 ---------------------------------------------------------------------- .../direct/SendToNonExistingDirectEndpointTest.java | 1 - .../apache/camel/component/mock/MockEndpointTest.java | 12 ++++++------ .../CharlesSplitAndTryCatchRollbackIssueTest.java | 8 ++++---- .../apache/camel/issues/MockValueBuilderIssueTest.java | 4 ++-- .../processor/MulticastParallelStopOnExceptionTest.java | 2 +- .../camel/processor/RollbackCustomMessageTest.java | 2 +- .../processor/SplitterParallelStopOnExceptionTest.java | 2 +- .../camel/processor/SplitterStopOnExceptionTest.java | 2 +- .../org/apache/camel/processor/ValidateRegExpTest.java | 2 +- .../org/apache/camel/processor/ValidateSimpleTest.java | 4 ++-- .../aggregator/AggregateClosedCorrelationKeyTest.java | 6 +++--- .../AggregateIgnoreInvalidCorrelationKeysTest.java | 2 +- .../processor/aggregator/AggregateProcessorTest.java | 4 ++-- ...ncOnExceptionFailureProcessorWithRedeliveryTest.java | 2 +- 14 files changed, 26 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/component/direct/SendToNonExistingDirectEndpointTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/component/direct/SendToNonExistingDirectEndpointTest.java b/camel-core/src/test/java/org/apache/camel/component/direct/SendToNonExistingDirectEndpointTest.java index 666e80f..74c9f8e 100644 --- a/camel-core/src/test/java/org/apache/camel/component/direct/SendToNonExistingDirectEndpointTest.java +++ b/camel-core/src/test/java/org/apache/camel/component/direct/SendToNonExistingDirectEndpointTest.java @@ -37,7 +37,6 @@ public class SendToNonExistingDirectEndpointTest extends ContextTestSupport { } catch (CamelExecutionException e) { DirectConsumerNotAvailableException cause = assertIsInstanceOf(DirectConsumerNotAvailableException.class, e.getCause()); assertIsInstanceOf(CamelExchangeException.class, cause); // ensure backwards compatibility - assertEquals("No consumers available on endpoint: Endpoint[direct://foo]. Exchange[Message: Hello World]", cause.getMessage()); assertNotNull(cause.getExchange()); } } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java b/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java index 7d5ab01..9d2a64d 100644 --- a/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java +++ b/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java @@ -549,8 +549,8 @@ public class MockEndpointTest extends ContextTestSupport { assertMockEndpointsSatisfied(); fail("Should have thrown exception"); } catch (AssertionError e) { - assertEquals("Assertion error at index 1 on mock mock://result with predicate: header(bar) == 444" - + " evaluated as: 234 == 444 on Exchange[Message: Hello World]", e.getMessage()); + String s = "Assertion error at index 1 on mock mock://result with predicate: header(bar) == 444 evaluated as: 234 == 444"; + assertTrue(e.getMessage().startsWith(s)); } } @@ -567,8 +567,8 @@ public class MockEndpointTest extends ContextTestSupport { assertMockEndpointsSatisfied(); fail("Should have thrown exception"); } catch (AssertionError e) { - assertEquals("Assertion error at index 1 on mock mock://result with predicate: header(bar) is null" - + " evaluated as: 234 is null on Exchange[Message: Hello World]", e.getMessage()); + String s = "Assertion error at index 1 on mock mock://result with predicate: header(bar) is null evaluated as: 234 is null"; + assertTrue(e.getMessage().startsWith(s)); } } @@ -585,8 +585,8 @@ public class MockEndpointTest extends ContextTestSupport { assertMockEndpointsSatisfied(); fail("Should have thrown exception"); } catch (AssertionError e) { - assertEquals("Assertion error at index 1 on mock mock://result with predicate: header(bar) instanceof" - + " java.lang.String on Exchange[Message: Hello World]", e.getMessage()); + String s = "Assertion error at index 1 on mock mock://result with predicate: header(bar) instanceof java.lang.String"; + assertTrue(e.getMessage().startsWith(s)); } } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/issues/CharlesSplitAndTryCatchRollbackIssueTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/issues/CharlesSplitAndTryCatchRollbackIssueTest.java b/camel-core/src/test/java/org/apache/camel/issues/CharlesSplitAndTryCatchRollbackIssueTest.java index fd0e683..3f8e3a9 100644 --- a/camel-core/src/test/java/org/apache/camel/issues/CharlesSplitAndTryCatchRollbackIssueTest.java +++ b/camel-core/src/test/java/org/apache/camel/issues/CharlesSplitAndTryCatchRollbackIssueTest.java @@ -72,9 +72,9 @@ public class CharlesSplitAndTryCatchRollbackIssueTest extends ContextTestSupport fail("Should thrown an exception"); } catch (CamelExecutionException e) { CamelExchangeException ee = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); - assertTrue(ee.getMessage().startsWith("Sequential processing failed for number 2. Exchange[Message: Kaboom]")); + assertTrue(ee.getMessage().startsWith("Sequential processing failed for number 2.")); RollbackExchangeException re = assertIsInstanceOf(RollbackExchangeException.class, ee.getCause()); - assertEquals("Intended rollback. Exchange[Message: Kaboom]", re.getMessage()); + assertTrue(re.getMessage().startsWith("Intended rollback")); } assertMockEndpointsSatisfied(); @@ -94,9 +94,9 @@ public class CharlesSplitAndTryCatchRollbackIssueTest extends ContextTestSupport fail("Should thrown an exception"); } catch (CamelExecutionException e) { CamelExchangeException ee = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); - assertTrue(ee.getMessage().startsWith("Sequential processing failed for number 3. Exchange[Message: Kaboom]")); + assertTrue(ee.getMessage().startsWith("Sequential processing failed for number 3.")); RollbackExchangeException re = assertIsInstanceOf(RollbackExchangeException.class, ee.getCause()); - assertEquals("Intended rollback. Exchange[Message: Kaboom]", re.getMessage()); + assertTrue(re.getMessage().startsWith("Intended rollback")); } assertMockEndpointsSatisfied(); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/issues/MockValueBuilderIssueTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/issues/MockValueBuilderIssueTest.java b/camel-core/src/test/java/org/apache/camel/issues/MockValueBuilderIssueTest.java index 7d64925..8b3ce47 100644 --- a/camel-core/src/test/java/org/apache/camel/issues/MockValueBuilderIssueTest.java +++ b/camel-core/src/test/java/org/apache/camel/issues/MockValueBuilderIssueTest.java @@ -43,8 +43,8 @@ public class MockValueBuilderIssueTest extends ContextTestSupport { assertMockEndpointsSatisfied(); fail("Should fail"); } catch (Throwable e) { - assertEquals("Assertion error at index 0 on mock mock://result with predicate: exchangeProperty(foo) contains 4" - + " evaluated as: 123 contains 4 on Exchange[Message: Hello World]", e.getMessage()); + String s = "Assertion error at index 0 on mock mock://result with predicate: exchangeProperty(foo) contains 4 evaluated as: 123 contains 4"; + assertTrue(e.getMessage().startsWith(s)); } } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStopOnExceptionTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStopOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStopOnExceptionTest.java index 7d8a5b6..a07832d 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStopOnExceptionTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/MulticastParallelStopOnExceptionTest.java @@ -68,7 +68,7 @@ public class MulticastParallelStopOnExceptionTest extends ContextTestSupport { } catch (CamelExecutionException e) { CamelExchangeException cause = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); assertTrue(cause.getMessage().startsWith("Parallel processing failed for number ")); - assertTrue(cause.getMessage().contains("Exchange[Message: Kaboom]")); + assertTrue(cause.getMessage().contains("[Message: Kaboom]")); assertEquals("Forced", cause.getCause().getMessage()); } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/RollbackCustomMessageTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/RollbackCustomMessageTest.java b/camel-core/src/test/java/org/apache/camel/processor/RollbackCustomMessageTest.java index a2a29d6..eb508cd 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/RollbackCustomMessageTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/RollbackCustomMessageTest.java @@ -32,7 +32,7 @@ public class RollbackCustomMessageTest extends ContextTestSupport { fail("Should have thrown an exception"); } catch (CamelExecutionException e) { assertIsInstanceOf(RollbackExchangeException.class, e.getCause()); - assertEquals("boo. Exchange[Message: Hello World]", e.getCause().getMessage()); + assertTrue(e.getCause().getMessage().startsWith("boo")); } } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelStopOnExceptionTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelStopOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelStopOnExceptionTest.java index d8240f3..13f4c85 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelStopOnExceptionTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelStopOnExceptionTest.java @@ -65,7 +65,7 @@ public class SplitterParallelStopOnExceptionTest extends ContextTestSupport { } catch (CamelExecutionException e) { CamelExchangeException cause = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); assertTrue(cause.getMessage().startsWith("Parallel processing failed for number ")); - assertTrue(cause.getMessage().contains("Exchange[Message: Kaboom]")); + assertTrue(cause.getMessage().contains("[Message: Kaboom]")); assertEquals("Forced", cause.getCause().getMessage()); } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/SplitterStopOnExceptionTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/SplitterStopOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/SplitterStopOnExceptionTest.java index da81831..bc215ee 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/SplitterStopOnExceptionTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/SplitterStopOnExceptionTest.java @@ -48,7 +48,7 @@ public class SplitterStopOnExceptionTest extends ContextTestSupport { fail("Should thrown an exception"); } catch (CamelExecutionException e) { CamelExchangeException cause = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); - assertTrue(cause.getMessage().startsWith("Sequential processing failed for number 1. Exchange[Message: Kaboom]")); + assertTrue(cause.getMessage().startsWith("Sequential processing failed for number 1.")); assertEquals("Forced", cause.getCause().getMessage()); } http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/ValidateRegExpTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/ValidateRegExpTest.java b/camel-core/src/test/java/org/apache/camel/processor/ValidateRegExpTest.java index 28058d1..ee3f345 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/ValidateRegExpTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/ValidateRegExpTest.java @@ -59,7 +59,7 @@ public class ValidateRegExpTest extends ContextTestSupport { // as the Expression could be different between the DSL and simple language, here we just check part of the message assertTrue("Get a wrong exception message", e.getCause().getMessage().startsWith("Validation failed for Predicate")); assertTrue(e.getCause().getMessage().contains("^\\d{2}\\.\\d{2}\\.\\d{4}$")); - assertTrue("Get a wrong exception message", e.getCause().getMessage().endsWith("Exchange[Message: 1.1.2010]")); + assertTrue("Get a wrong exception message", e.getCause().getMessage().endsWith("[Message: 1.1.2010]")); } assertMockEndpointsSatisfied(); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/ValidateSimpleTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/ValidateSimpleTest.java b/camel-core/src/test/java/org/apache/camel/processor/ValidateSimpleTest.java index aed83a5..97f13aa 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/ValidateSimpleTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/ValidateSimpleTest.java @@ -56,8 +56,8 @@ public class ValidateSimpleTest extends ContextTestSupport { } catch (CamelExecutionException e) { // expected assertIsInstanceOf(PredicateValidationException.class, e.getCause()); - assertEquals("Validation failed for Predicate[Simple: ${body} contains 'Camel']." - + " Exchange[Message: Bye World]", e.getCause().getMessage()); + String s = "Validation failed for Predicate[Simple: ${body} contains 'Camel']."; + assertTrue(e.getCause().getMessage().startsWith(s)); } assertMockEndpointsSatisfied(); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateClosedCorrelationKeyTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateClosedCorrelationKeyTest.java b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateClosedCorrelationKeyTest.java index b59e0c7..a9efbd4 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateClosedCorrelationKeyTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateClosedCorrelationKeyTest.java @@ -56,7 +56,7 @@ public class AggregateClosedCorrelationKeyTest extends ContextTestSupport { } catch (CamelExecutionException e) { ClosedCorrelationKeyException cause = assertIsInstanceOf(ClosedCorrelationKeyException.class, e.getCause()); assertEquals("1", cause.getCorrelationKey()); - assertEquals("The correlation key [1] has been closed. Exchange[Message: C]", cause.getMessage()); + assertTrue(cause.getMessage().startsWith("The correlation key [1] has been closed.")); } assertMockEndpointsSatisfied(); @@ -93,7 +93,7 @@ public class AggregateClosedCorrelationKeyTest extends ContextTestSupport { } catch (CamelExecutionException e) { ClosedCorrelationKeyException cause = assertIsInstanceOf(ClosedCorrelationKeyException.class, e.getCause()); assertEquals("2", cause.getCorrelationKey()); - assertEquals("The correlation key [2] has been closed. Exchange[Message: H]", cause.getMessage()); + assertTrue(cause.getMessage().startsWith("The correlation key [2] has been closed.")); } // should be closed @@ -103,7 +103,7 @@ public class AggregateClosedCorrelationKeyTest extends ContextTestSupport { } catch (CamelExecutionException e) { ClosedCorrelationKeyException cause = assertIsInstanceOf(ClosedCorrelationKeyException.class, e.getCause()); assertEquals("3", cause.getCorrelationKey()); - assertEquals("The correlation key [3] has been closed. Exchange[Message: I]", cause.getMessage()); + assertTrue(cause.getMessage().startsWith("The correlation key [3] has been closed.")); } assertMockEndpointsSatisfied(); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateIgnoreInvalidCorrelationKeysTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateIgnoreInvalidCorrelationKeysTest.java b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateIgnoreInvalidCorrelationKeysTest.java index 2fe59d2..fa0410b 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateIgnoreInvalidCorrelationKeysTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateIgnoreInvalidCorrelationKeysTest.java @@ -77,7 +77,7 @@ public class AggregateIgnoreInvalidCorrelationKeysTest extends ContextTestSuppor fail("Should throw an exception"); } catch (CamelExecutionException e) { CamelExchangeException cause = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); - assertEquals("Invalid correlation key. Exchange[Message: B]", cause.getMessage()); + assertTrue(cause.getMessage().startsWith("Invalid correlation key")); } template.sendBodyAndHeader("direct:start", "C", "id", 1); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java index daef63d..21d58ce 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateProcessorTest.java @@ -354,7 +354,7 @@ public class AggregateProcessorTest extends ContextTestSupport { ap.process(e2); Exception e = e2.getException(); assertNotNull(e); - assertEquals("Invalid correlation key. Exchange[Message: B]", e.getMessage()); + assertTrue(e.getMessage().startsWith("Invalid correlation key.")); ap.process(e3); ap.process(e4); @@ -402,7 +402,7 @@ public class AggregateProcessorTest extends ContextTestSupport { ap.process(e4); Exception e = e4.getException(); assertNotNull(e); - assertEquals("The correlation key [123] has been closed. Exchange[Message: C]", e.getMessage()); + assertTrue(e.getMessage().startsWith("The correlation key [123] has been closed.")); assertMockEndpointsSatisfied(); http://git-wip-us.apache.org/repos/asf/camel/blob/404246e8/camel-core/src/test/java/org/apache/camel/processor/async/AsyncOnExceptionFailureProcessorWithRedeliveryTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncOnExceptionFailureProcessorWithRedeliveryTest.java b/camel-core/src/test/java/org/apache/camel/processor/async/AsyncOnExceptionFailureProcessorWithRedeliveryTest.java index b40a655..a8f97b3 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncOnExceptionFailureProcessorWithRedeliveryTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/async/AsyncOnExceptionFailureProcessorWithRedeliveryTest.java @@ -40,7 +40,7 @@ public class AsyncOnExceptionFailureProcessorWithRedeliveryTest extends ContextT fail("Should throw exception"); } catch (CamelExecutionException e) { CamelExchangeException cause = assertIsInstanceOf(CamelExchangeException.class, e.getCause()); - assertEquals("Simulated error at attempt 1. Exchange[Message: Hello Camel]", cause.getMessage()); + assertTrue(cause.getMessage().startsWith("Simulated error at attempt 1.")); } assertMockEndpointsSatisfied();