Introduce default constructor in TomcatHttpServer

This commit is contained in:
Sam Brannen
2019-09-05 13:43:03 +02:00
parent 40a55b412d
commit d9e3b8b9a5
4 changed files with 14 additions and 11 deletions

View File

@@ -16,7 +16,6 @@
package org.springframework.http.server.reactive;
import java.io.File;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -125,11 +124,10 @@ public abstract class AbstractHttpHandlerIntegrationTests {
}
static Stream<HttpServer> httpServers() {
File base = new File(System.getProperty("java.io.tmpdir"));
return Stream.of(
new JettyHttpServer(),
new ReactorHttpServer(),
new TomcatHttpServer(base.getAbsolutePath()),
new TomcatHttpServer(),
new UndertowHttpServer()
);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,15 @@ public class TomcatHttpServer extends AbstractHttpServer {
private Tomcat tomcatServer;
/**
* Create a new Tomcat HTTP server using the {@code java.io.tmpdir} JVM
* system property as the {@code baseDir}.
* @since 5.2
*/
public TomcatHttpServer() {
this(new File(System.getProperty("java.io.tmpdir")).getAbsolutePath());
}
public TomcatHttpServer(String baseDir) {
this(baseDir, null);
}