diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml index ec30683987..d2e1046c13 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml @@ -10,6 +10,24 @@ + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-jmx-port + + reserve-network-port + + process-resources + + + jmx.port + + + + + @project.groupId@ @project.artifactId@ @@ -30,6 +48,7 @@ true + ${jmx.port} diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java index 1f97f2d0b3..dade96cd80 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java @@ -17,6 +17,7 @@ package org.test; import java.lang.management.ManagementFactory; + import javax.management.MBeanServer; import javax.management.ObjectName; @@ -47,7 +48,6 @@ public class SampleApplication { } waitAttempts++; } - System.out.println("Application has terminated gracefully"); } @@ -67,6 +67,7 @@ public class SampleApplication { @Override public boolean isReady() { + System.out.println("isReady: " + this.ready); return this.ready; } diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy index c987b04030..5aa87af683 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy @@ -1,6 +1,5 @@ import static org.junit.Assert.assertTrue def file = new File(basedir, "build.log") +assertTrue 'Start should have waited for application to be ready', file.text.contains("isReady: true") assertTrue 'Shutdown should have been invoked', file.text.contains("Shutdown requested") -assertTrue 'Application should have terminated', file.text.contains("Application has terminated gracefully") - diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java index 1f97f2d0b3..b06530087a 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java @@ -47,7 +47,6 @@ public class SampleApplication { } waitAttempts++; } - System.out.println("Application has terminated gracefully"); } @@ -67,6 +66,7 @@ public class SampleApplication { @Override public boolean isReady() { + System.out.println("isReady: " + this.ready); return this.ready; } diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy index c987b04030..5aa87af683 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy @@ -1,6 +1,5 @@ import static org.junit.Assert.assertTrue def file = new File(basedir, "build.log") +assertTrue 'Start should have waited for application to be ready', file.text.contains("isReady: true") assertTrue 'Shutdown should have been invoked', file.text.contains("Shutdown requested") -assertTrue 'Application should have terminated', file.text.contains("Application has terminated gracefully") -