Browse Source

Revert "Use random port for DevTools tests"

This reverts commit 4630c2292f.
pull/16246/head
Phillip Webb 7 years ago
parent
commit
744cdf43e9
  1. 4
      spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java
  2. 6
      spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java

4
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 @After
public void stopApplication() throws InterruptedException { public void stopApplication() throws InterruptedException {
if (this.launchedApplication != null) { this.launchedApplication.stop();
this.launchedApplication.stop();
}
} }
@Test @Test

6
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 { throws Exception {
LaunchedJvm applicationJvm = javaLauncher.launch("app", LaunchedJvm applicationJvm = javaLauncher.launch("app",
createApplicationClassPath(), "com.example.DevToolsTestApplication", createApplicationClassPath(), "com.example.DevToolsTestApplication",
"--server.port=0", "--spring.devtools.remote.secret=secret"); "--server.port=12345", "--spring.devtools.remote.secret=secret");
int port = awaitServerPort(applicationJvm.getStandardOut()); awaitServerPort(applicationJvm.getStandardOut());
LaunchedJvm remoteSpringApplicationJvm = javaLauncher.launch( LaunchedJvm remoteSpringApplicationJvm = javaLauncher.launch(
"remote-spring-application", createRemoteSpringApplicationClassPath(), "remote-spring-application", createRemoteSpringApplicationClassPath(),
RemoteSpringApplication.class.getName(), RemoteSpringApplication.class.getName(),
"--spring.devtools.remote.secret=secret", "http://localhost:" + port); "--spring.devtools.remote.secret=secret", "http://localhost:12345");
awaitRemoteSpringApplication(remoteSpringApplicationJvm.getStandardOut()); awaitRemoteSpringApplication(remoteSpringApplicationJvm.getStandardOut());
return new LaunchedApplication(new File("target/remote"), return new LaunchedApplication(new File("target/remote"),
applicationJvm.getStandardOut(), applicationJvm.getStandardError(), applicationJvm.getStandardOut(), applicationJvm.getStandardError(),

Loading…
Cancel
Save