Skip to content

Commit c706fdc

Browse files
authored
Merge pull request #8571 from swagger-api/dynamic-jetty-port
dynamic jetty test port
2 parents fa96d39 + 8b17335 commit c706fdc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

modules/swagger-generator/pom.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<version>${jetty-version}</version>
6464
<configuration>
6565
<scanIntervalSeconds>10</scanIntervalSeconds>
66-
<stopPort>8079</stopPort>
66+
<stopPort>${JETTY_TEST_STOP_PORT}</stopPort>
6767
<stopKey>STOP</stopKey>
6868
<useTestScope>true</useTestScope>
6969
<systemProperties>
@@ -84,7 +84,7 @@
8484
<contextPath>/</contextPath>
8585
</webApp>
8686
<httpConnector>
87-
<port>8080</port>
87+
<port>${JETTY_TEST_HTTP_PORT}</port>
8888
<idleTimeout>60000</idleTimeout>
8989
</httpConnector>
9090
</configuration>
@@ -312,5 +312,7 @@
312312
<inflector-version>2.0.0-rc2</inflector-version>
313313
<junit-version>4.8.2</junit-version>
314314
<servlet-api.version>3.1.0</servlet-api.version>
315+
<JETTY_TEST_HTTP_PORT>8080</JETTY_TEST_HTTP_PORT>
316+
<JETTY_TEST_STOP_PORT>8079</JETTY_TEST_STOP_PORT>
315317
</properties>
316318
</project>

modules/swagger-generator/src/test/java/io/swagger/v3/generator/online/GeneratorControllerIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
public class GeneratorControllerIT {
2626

2727
protected final Logger LOGGER = LoggerFactory.getLogger(GeneratorControllerIT.class);
28-
static final String DEFAULT_HOST = "http://localhost:8080/api";
28+
static final String port = System.getProperty("JETTY_TEST_HTTP_PORT") == null ? "8080" : System.getProperty("JETTY_TEST_HTTP_PORT");
29+
static final String DEFAULT_HOST = "http://localhost:" + port + "/api";
2930
private HttpClient client = HttpClientBuilder.create().build();
3031

3132
@Test

0 commit comments

Comments
 (0)