From 744cdf43e9745ec9e4d50e85eb6fc97cb38cc671 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 29 Oct 2018 22:33:00 -0700 Subject: [PATCH] Revert "Use random port for DevTools tests" This reverts commit 4630c2292f232e541c3c8118100cba05e14c5129. --- .../boot/devtools/tests/DevToolsIntegrationTests.java | 4 +--- .../boot/devtools/tests/RemoteApplicationLauncher.java | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java index 0c6921167cf..199d3e6328b 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java @@ -80,9 +80,7 @@ public class DevToolsIntegrationTests { @After public void stopApplication() throws InterruptedException { - if (this.launchedApplication != null) { - this.launchedApplication.stop(); - } + this.launchedApplication.stop(); } @Test diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java index 38249f20e16..29b8b3b25da 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java @@ -40,12 +40,12 @@ abstract class RemoteApplicationLauncher implements ApplicationLauncher { throws Exception { LaunchedJvm applicationJvm = javaLauncher.launch("app", createApplicationClassPath(), "com.example.DevToolsTestApplication", - "--server.port=0", "--spring.devtools.remote.secret=secret"); - int port = awaitServerPort(applicationJvm.getStandardOut()); + "--server.port=12345", "--spring.devtools.remote.secret=secret"); + awaitServerPort(applicationJvm.getStandardOut()); LaunchedJvm remoteSpringApplicationJvm = javaLauncher.launch( "remote-spring-application", createRemoteSpringApplicationClassPath(), RemoteSpringApplication.class.getName(), - "--spring.devtools.remote.secret=secret", "http://localhost:" + port); + "--spring.devtools.remote.secret=secret", "http://localhost:12345"); awaitRemoteSpringApplication(remoteSpringApplicationJvm.getStandardOut()); return new LaunchedApplication(new File("target/remote"), applicationJvm.getStandardOut(), applicationJvm.getStandardError(),