This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 01e057268d6e2f7b8f85ce4dd918495b20385ed6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Oct 14 07:07:15 2021 +0200 CAMEL-17072: Using custom debug requires to be enabled. Using debug from camel-test fixed. --- .../main/java/org/apache/camel/test/junit5/CamelTestSupport.java | 4 ++-- .../apache/camel/test/spring/junit5/CamelAnnotationsHandler.java | 4 ++++ ...tedTest.java => CamelSpringProvidesBreakpointInheritedTest.java} | 2 +- .../java/org/apache/camel/test/spring/CamelAnnotationsHandler.java | 4 ++++ ...t.java => CamelSpringRunnerProvidesBreakpointInheritedTest.java} | 2 +- .../resources/org/apache/camel/test/patterns/applicationContext.xml | 2 +- .../main/java/org/apache/camel/test/junit4/CamelTestSupport.java | 3 ++- .../user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_13.adoc | 6 +++++- 8 files changed, 20 insertions(+), 7 deletions(-) diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java index 7e6aaa8..dfb8014 100644 --- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java +++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/CamelTestSupport.java @@ -442,10 +442,10 @@ public abstract class CamelTestSupport // we need to stop the context first to setup the debugger context.stop(); } + context.setDebugging(true); context.setDebugger(new DefaultDebugger()); context.getDebugger().addBreakpoint(breakpoint); - // when stopping CamelContext it will automatic remove the - // breakpoint + // when stopping CamelContext it will automatically remove the breakpoint } template = context.createProducerTemplate(); diff --git a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java index cd56b4c..59f6bff 100644 --- a/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java +++ b/components/camel-test/camel-test-spring-junit5/src/main/java/org/apache/camel/test/spring/junit5/CamelAnnotationsHandler.java @@ -210,6 +210,10 @@ public final class CamelAnnotationsHandler { public void execute(String contextName, SpringCamelContext camelContext) throws Exception { + + // automatic turn on debugging when we have breakpoints + camelContext.setDebugging(true); + Debugger debugger = camelContext.getDebugger(); if (debugger == null) { debugger = new DefaultDebugger(); diff --git a/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInherritedTest.java b/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInheritedTest.java similarity index 94% rename from components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInherritedTest.java rename to components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInheritedTest.java index 72f2516..6de0f8f 100644 --- a/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInherritedTest.java +++ b/components/camel-test/camel-test-spring-junit5/src/test/java/org/apache/camel/test/spring/CamelSpringProvidesBreakpointInheritedTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.test.spring; -public class CamelSpringProvidesBreakpointInherritedTest +public class CamelSpringProvidesBreakpointInheritedTest extends CamelSpringProvidesBreakpointTest { } diff --git a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java index 0d583a9..8e13b6d 100644 --- a/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java +++ b/components/camel-test/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelAnnotationsHandler.java @@ -211,6 +211,10 @@ public final class CamelAnnotationsHandler { public void execute(String contextName, SpringCamelContext camelContext) throws Exception { + + // automatic turn on debugging when we have breakpoints + camelContext.setDebugging(true); + Debugger debugger = camelContext.getDebugger(); if (debugger == null) { debugger = new DefaultDebugger(); diff --git a/components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInherritedTest.java b/components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInheritedTest.java similarity index 93% rename from components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInherritedTest.java rename to components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInheritedTest.java index 00b8058..9ce542a 100644 --- a/components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInherritedTest.java +++ b/components/camel-test/camel-test-spring/src/test/java/org/apache/camel/test/spring/CamelSpringRunnerProvidesBreakpointInheritedTest.java @@ -16,7 +16,7 @@ */ package org.apache.camel.test.spring; -public class CamelSpringRunnerProvidesBreakpointInherritedTest +public class CamelSpringRunnerProvidesBreakpointInheritedTest extends CamelSpringRunnerProvidesBreakpointTest { } diff --git a/components/camel-test/camel-test-spring/src/test/resources/org/apache/camel/test/patterns/applicationContext.xml b/components/camel-test/camel-test-spring/src/test/resources/org/apache/camel/test/patterns/applicationContext.xml index 17179a4..0216a61 100644 --- a/components/camel-test/camel-test-spring/src/test/resources/org/apache/camel/test/patterns/applicationContext.xml +++ b/components/camel-test/camel-test-spring/src/test/resources/org/apache/camel/test/patterns/applicationContext.xml @@ -25,7 +25,7 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd "> - <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" trace="true" autoStartup="true" > + <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring" debug="true" trace="true" autoStartup="true" > <route> <from uri="direct:start" /> diff --git a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java index f432731..e9dbd8b 100644 --- a/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java +++ b/components/camel-test/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java @@ -393,9 +393,10 @@ public abstract class CamelTestSupport extends TestSupport { // we need to stop the context first to setup the debugger context.stop(); } + context.setDebugging(true); context.setDebugger(new DefaultDebugger()); context.getDebugger().addBreakpoint(breakpoint); - // note: when stopping CamelContext it will automatic remove the breakpoint + // note: when stopping CamelContext it will automatically remove the breakpoint } template = context.createProducerTemplate(); diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_13.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_13.adoc index 9fe36bd..279eaf2 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_13.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_13.adoc @@ -12,6 +12,11 @@ Added method `getStartedEventNotifiers` to `org.apache.camel.spi.ManagementStrat Added method `scheduleQueue` to `org.apache.camel.spi.ReactiveExecutor`. +=== Using custom Debugger + +Previously when setting a custom org.apache.camel.spi.Debugger, then Camel would automatically +enable debug mode. Now debugging must be enabled by setting `setDebugging(true)` on `CamelContext`. + === Using transactions The routing engine has been changed to route exchanges in a different order @@ -44,7 +49,6 @@ In order to reduce memory pressure, the component was modified to avoid using Li - `GenericFileOperations`: the return type for the methods `listFiles` and `listFiles(String)` was modified to return an array of (generic) objects instead of a List - `GenericFileConsumer`: the signature of the methods `isValidFile` and `isMatched` was modified to receive an array of files. - === camel-ftp The `FtpConsumer`, `FtpOperations`, `SftConsumer` and `SftpOperations` classes were modified to comply with the API changes on the `camel-file` component.