davsclaus commented on code in PR #29910:
URL: https://github.com/apache/camel/pull/29910#discussion_r4572931684
##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/RunTest.java:
##########
@@ -266,6 +267,50 @@ void theOptionsOfARunWithMavenAreInTheRequest() {
assertThat(request.dev).isTrue();
}
+ @Test
+ void theBackgroundAndDebugPropertiesStartAnotherJvm() {
+ Run command = new Run(new CamelJBangMain());
+ CommandLineTestHelper.parse(command, "route.yaml");
+ command.spawned = false;
+
+ command.applyProfileProperties(command.toRunRequest(null),
backgroundAndDebugProperties());
+
+ assertThat(command.background).isTrue();
+ assertThat(command.backgroundWait).isEqualTo(5000);
+ assertThat(command.jvmDebugPort).isEqualTo(4004);
+ }
+
+ @Test
+ void aJvmThatARunStartedDoesNotStartAnotherFromTheProperties() {
+ // the JVM in the background reads the same application.properties:
before, it went to the background
+ // again, and its own child too, without end (CAMEL-26930)
+ Run command = new Run(new CamelJBangMain());
+ CommandLineTestHelper.parse(command, "route.yaml");
+ command.spawned = true;
+
+ command.applyProfileProperties(command.toRunRequest(null),
backgroundAndDebugProperties());
+
+ assertThat(command.background).isFalse();
+ assertThat(command.jvmDebugPort).isZero();
Review Comment:
Added in 980acb6841b6: the spawned-run test now also asserts that
`backgroundWait` stays at `BackgroundWait.DEFAULT`.
_Claude Code on behalf of davsclaus_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]