Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit cd4b43e

Browse files
committed
travis build: get back random port
1 parent 72f54d0 commit cd4b43e

File tree

17 files changed

+226
-208
lines changed

17 files changed

+226
-208
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
language: java
22

3+
before_install:
4+
- export MAVEN_OPTS=-Xmx1024m
5+
36
script:
4-
- mvn -Dlogback.configurationFile=logback-travis.xml clean package coveralls:report -P coverage
7+
- ./travis.sh
58

69
jdk:
710
- oraclejdk8

coverage-report/src/test/java/org/jooby/HelloHttpsFeature.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package org.jooby;
22

3+
import com.typesafe.config.ConfigFactory;
4+
import com.typesafe.config.ConfigValueFactory;
35
import org.jooby.test.ServerFeature;
46
import org.junit.AfterClass;
57
import org.junit.BeforeClass;
68
import org.junit.Test;
79

8-
import com.typesafe.config.ConfigFactory;
9-
import com.typesafe.config.ConfigValueFactory;
10-
1110
public class HelloHttpsFeature extends ServerFeature {
1211

1312
{
13+
securePort(9443);
1414
use(ConfigFactory.empty().withValue("application.securePort",
15-
ConfigValueFactory.fromAnyRef(9943)));
15+
ConfigValueFactory.fromAnyRef(securePort)));
1616

1717
get("/", () -> "Hello");
1818

coverage-report/src/test/java/org/jooby/issues/Issue221.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package org.jooby.issues;
22

3+
import com.typesafe.config.ConfigFactory;
4+
import com.typesafe.config.ConfigValueFactory;
35
import org.jooby.test.ServerFeature;
46
import org.junit.AfterClass;
57
import org.junit.BeforeClass;
68
import org.junit.Test;
79

8-
import com.typesafe.config.ConfigFactory;
9-
import com.typesafe.config.ConfigValueFactory;
10-
1110
public class Issue221 extends ServerFeature {
1211

1312
{
1413

14+
securePort(9943);
1515
use(ConfigFactory.empty()
16-
.withValue("application.securePort", ConfigValueFactory.fromAnyRef(9943))
16+
.withValue("application.securePort", ConfigValueFactory.fromAnyRef(securePort))
1717
.withValue("application.redirect_https",
18-
ConfigValueFactory.fromAnyRef("https://localhost:9943/{0}")));
18+
ConfigValueFactory.fromAnyRef("https://localhost:" + securePort + "/{0}")));
1919

2020
get("/https", req -> req.secure());
2121
}

coverage-report/src/test/java/org/jooby/issues/Issue250b.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package org.jooby.issues;
22

3+
import com.typesafe.config.ConfigFactory;
4+
import com.typesafe.config.ConfigValueFactory;
35
import org.jooby.test.ServerFeature;
46
import org.junit.AfterClass;
57
import org.junit.BeforeClass;
68
import org.junit.Test;
79

8-
import com.typesafe.config.ConfigFactory;
9-
import com.typesafe.config.ConfigValueFactory;
10-
1110
public class Issue250b extends ServerFeature {
1211

1312
{
13+
securePort(9943);
1414
use(ConfigFactory.empty().withValue("application.securePort",
15-
ConfigValueFactory.fromAnyRef(9943)));
15+
ConfigValueFactory.fromAnyRef(securePort)));
1616

1717
get("/", req -> {
1818
req.port();

coverage-report/src/test/java/org/jooby/issues/Issue342.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package org.jooby.issues;
22

3-
import java.util.Arrays;
4-
import java.util.stream.Collectors;
5-
3+
import cz.jiripinkas.jsitemapgenerator.WebPage;
64
import org.jooby.sitemap.Sitemap;
75
import org.jooby.sitemap.WebPageProvider;
86
import org.jooby.test.ServerFeature;
97
import org.junit.Test;
108

11-
import cz.jiripinkas.jsitemapgenerator.WebPage;
9+
import java.util.Arrays;
10+
import java.util.stream.Collectors;
1211

1312
public class Issue342 extends ServerFeature {
1413

@@ -41,16 +40,16 @@ public void sitemap() throws Exception {
4140
.expect("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
4241
"<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n" +
4342
"<url>\n" +
44-
"<loc>http://localhost:9999/</loc>\n" +
43+
"<loc>http://localhost:" + port + "/</loc>\n" +
4544
"</url>\n" +
4645
"<url>\n" +
47-
"<loc>http://localhost:9999/tags</loc>\n" +
46+
"<loc>http://localhost:" + port + "/tags</loc>\n" +
4847
"</url>\n" +
4948
"<url>\n" +
50-
"<loc>http://localhost:9999/tags/bar</loc>\n" +
49+
"<loc>http://localhost:" + port + "/tags/bar</loc>\n" +
5150
"</url>\n" +
5251
"<url>\n" +
53-
"<loc>http://localhost:9999/tags/foo</loc>\n" +
52+
"<loc>http://localhost:" + port + "/tags/foo</loc>\n" +
5453
"</url>\n" +
5554
"</urlset>")
5655
.header("Content-Type", "application/xml;charset=utf-8");

coverage-report/src/test/java/org/jooby/issues/Issue378.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public void shouldGenerateAValidRaml() throws Exception {
3838
request()
3939
.get("/raml/api.raml")
4040
.expect("#%RAML 1.0\n" +
41-
"title: issues API\n" +
42-
"version: 0.0.0\n" +
43-
"protocols: [HTTP]\n" +
44-
"baseUri: http://localhost:9999/\n" +
45-
"mediaType: application/json\n" +
41+
"baseUri: http://localhost:" + port + "/\n"
42+
+ "mediaType: application/json\n"
43+
+ "protocols: [HTTP]\n"
44+
+ "title: issues API\n"
45+
+ "version: 0.0.0\n" +
4646
"types:\n" +
4747
" Cat:\n" +
4848
" type: object\n" +

coverage-report/src/test/java/org/jooby/issues/Issue418.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
package org.jooby.issues;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertNotNull;
5-
import static org.junit.Assert.assertTrue;
6-
7-
import java.io.IOException;
8-
import java.io.InputStream;
9-
import java.io.OutputStream;
10-
import java.net.InetSocketAddress;
11-
import java.net.Socket;
12-
import java.net.SocketTimeoutException;
13-
import java.nio.ByteBuffer;
14-
import java.nio.charset.StandardCharsets;
15-
import java.util.HashMap;
16-
import java.util.Map;
17-
import java.util.concurrent.CountDownLatch;
18-
import java.util.concurrent.Phaser;
19-
import java.util.concurrent.TimeUnit;
20-
import java.util.concurrent.atomic.AtomicReference;
21-
3+
import com.google.common.collect.ImmutableMap;
224
import org.eclipse.jetty.http.HttpFields;
235
import org.eclipse.jetty.http.HttpURI;
246
import org.eclipse.jetty.http.HttpVersion;
@@ -46,7 +28,24 @@
4628
import org.jooby.test.ServerFeature;
4729
import org.junit.Test;
4830

49-
import com.google.common.collect.ImmutableMap;
31+
import java.io.IOException;
32+
import java.io.InputStream;
33+
import java.io.OutputStream;
34+
import java.net.InetSocketAddress;
35+
import java.net.Socket;
36+
import java.net.SocketTimeoutException;
37+
import java.nio.ByteBuffer;
38+
import java.nio.charset.StandardCharsets;
39+
import java.util.HashMap;
40+
import java.util.Map;
41+
import java.util.concurrent.CountDownLatch;
42+
import java.util.concurrent.Phaser;
43+
import java.util.concurrent.TimeUnit;
44+
import java.util.concurrent.atomic.AtomicReference;
45+
46+
import static org.junit.Assert.assertEquals;
47+
import static org.junit.Assert.assertNotNull;
48+
import static org.junit.Assert.assertTrue;
5049

5150
public class Issue418 extends ServerFeature {
5251

@@ -139,7 +138,7 @@ public void h2cpush() throws Throwable {
139138
Map<String, Object> pushPromise = (Map<String, Object>) stream2.get("push-promise");
140139
assertEquals(1, pushPromise.get("streamId"));
141140
assertEquals(2, pushPromise.get("promisedStreamId"));
142-
assertEquals("http://localhost:9999/app.js", pushPromise.get("uri"));
141+
assertEquals("http://localhost:" + port + "/app.js", pushPromise.get("uri"));
143142
assertEquals("GET", pushPromise.get("method"));
144143
}
145144

@@ -191,7 +190,7 @@ public void h2cpushWithHeader() throws Throwable {
191190
assertEquals(1, pushPromise.get("streamId"));
192191
assertEquals(2, pushPromise.get("promisedStreamId"));
193192
assertEquals("123", pushPromise.get("etag"));
194-
assertEquals("http://localhost:9999/app.js", pushPromise.get("uri"));
193+
assertEquals("http://localhost:" + port + "/app.js", pushPromise.get("uri"));
195194
assertEquals("GET", pushPromise.get("method"));
196195
}
197196

coverage-report/src/test/java/org/jooby/issues/Issue491.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.jooby.issues;
22

3-
import javax.inject.Inject;
4-
import javax.inject.Named;
5-
63
import org.jooby.test.ServerFeature;
74
import org.junit.Test;
85

6+
import javax.inject.Inject;
7+
import javax.inject.Named;
8+
99
public class Issue491 extends ServerFeature {
1010

1111
@Inject
@@ -22,7 +22,7 @@ public class Issue491 extends ServerFeature {
2222
public void injectableFields() throws Exception {
2323
request()
2424
.get("/491")
25-
.expect("9999");
25+
.expect(port + "");
2626
}
2727

2828
}

0 commit comments

Comments
 (0)