Attempt to fix Windows CI

pull/1165/merge
Phillip Webb 11 years ago
parent e383d13ad9
commit b01c1d36ae

@ -109,10 +109,12 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
this.container = factory this.container = factory
.getEmbeddedServletContainer(exampleServletRegistration()); .getEmbeddedServletContainer(exampleServletRegistration());
this.container.start(); this.container.start();
int port = this.container.getPort();
this.container.stop(); this.container.stop();
this.thrown.expect(IOException.class); this.thrown.expect(IOException.class);
String response = getResponse(getLocalUrl("/hello")); String response = getResponse(getLocalUrl(port, "/hello"));
throw new RuntimeException(this.container.getPort() + " " + response); throw new RuntimeException("Unexpected response on port " + port + " : "
+ response);
} }
@Test @Test
@ -302,6 +304,10 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
return "http://localhost:" + this.container.getPort() + resourcePath; return "http://localhost:" + this.container.getPort() + resourcePath;
} }
protected String getLocalUrl(int port, String resourcePath) {
return "http://localhost:" + port + resourcePath;
}
protected String getResponse(String url) throws IOException, URISyntaxException { protected String getResponse(String url) throws IOException, URISyntaxException {
ClientHttpResponse response = getClientResponse(url); ClientHttpResponse response = getClientResponse(url);
try { try {

Loading…
Cancel
Save