Skip to content

Commit 928d8d9

Browse files
authored
JPMS support (#87)
* Repackage src/test/classes to avoid split package with src/main/java * Avoid using vertx-core impl packages * JPMS descriptors for src/main and src/test * Fix incorrect assertEquals method usage * Remove useless dependencies
1 parent b6d4556 commit 928d8d9

22 files changed

+75
-63
lines changed

pom.xml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@
5252
<artifactId>vertx-core</artifactId>
5353
</dependency>
5454

55-
<!-- Only for fatjar -->
56-
<dependency>
57-
<!-- declare this dependency to force shiro to use this one. It is the version used by vert.x -->
58-
<groupId>org.slf4j</groupId>
59-
<artifactId>slf4j-api</artifactId>
60-
<version>1.7.16</version>
61-
<optional>true</optional>
62-
</dependency>
63-
6455
<dependency>
6556
<groupId>io.vertx</groupId>
6657
<artifactId>vertx-docgen</artifactId>
@@ -72,14 +63,6 @@
7263
<scope>provided</scope>
7364
</dependency>
7465

75-
<!--
76-
<dependency>
77-
<groupId>ch.qos.logback</groupId>
78-
<artifactId>logback-classic</artifactId>
79-
<version>1.0.13</version>
80-
</dependency>
81-
-->
82-
8366
<dependency>
8467
<groupId>junit</groupId>
8568
<artifactId>junit</artifactId>
@@ -94,7 +77,7 @@
9477
<dependency>
9578
<groupId>com.github.tomakehurst</groupId>
9679
<artifactId>wiremock-standalone</artifactId>
97-
<version>2.6.0</version>
80+
<version>3.0.1</version>
9881
<scope>test</scope>
9982
</dependency>
10083
</dependencies>
@@ -114,6 +97,16 @@
11497
<annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
11598
<annotationProcessor>io.vertx.docgen.JavaDocGenProcessor</annotationProcessor>
11699
</annotationProcessors>
100+
<annotationProcessorPaths>
101+
<annotationProcessorPath>
102+
<groupId>io.vertx</groupId>
103+
<artifactId>vertx-codegen</artifactId>
104+
</annotationProcessorPath>
105+
<annotationProcessorPath>
106+
<groupId>io.vertx</groupId>
107+
<artifactId>vertx-docgen</artifactId>
108+
</annotationProcessorPath>
109+
</annotationProcessorPaths>
117110
</configuration>
118111
</execution>
119112
</executions>

src/main/java/io/vertx/httpproxy/cache/CacheOptions.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import io.vertx.codegen.annotations.DataObject;
44
import io.vertx.codegen.json.annotations.JsonGen;
5-
import io.vertx.core.impl.Arguments;
65
import io.vertx.core.json.JsonObject;
76
import io.vertx.httpproxy.impl.CacheImpl;
87
import io.vertx.httpproxy.spi.cache.Cache;
@@ -39,7 +38,9 @@ public int getMaxSize() {
3938
* @return a reference to this, so the API can be used fluently
4039
*/
4140
public CacheOptions setMaxSize(int maxSize) {
42-
Arguments.require(maxSize > 0, "Max size must be > 0");
41+
if (maxSize <= 0) {
42+
throw new IllegalArgumentException("Max size must be > 0");
43+
}
4344
this.maxSize = maxSize;
4445
return this;
4546
}

src/main/java/io/vertx/httpproxy/impl/ReverseProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void handle(HttpServerRequest request) {
6565
}
6666

6767
// WebSocket upgrade tunneling
68-
if (supportWebSocket && io.vertx.core.http.impl.HttpUtils.canUpgradeToWebSocket(request)) {
68+
if (supportWebSocket && request.canUpgradeToWebSocket()) {
6969
handleWebSocketUpgrade(proxyRequest);
7070
return;
7171
}

src/main/java/module-info.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module io.vertx.httpproxy {
2+
requires transitive io.vertx.core;
3+
requires io.vertx.core.logging;
4+
requires static io.vertx.codegen.api;
5+
requires static io.vertx.codegen.json;
6+
requires static vertx.docgen;
7+
exports io.vertx.httpproxy;
8+
exports io.vertx.httpproxy.cache;
9+
exports io.vertx.httpproxy.spi.cache;
10+
exports io.vertx.httpproxy.impl to io.vertx.tests;
11+
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
Automatic-Module-Name: io.vertx.httpproxy
2-

src/test/java/io/vertx/httpproxy/BackendTest.java renamed to src/test/java/io/vertx/tests/BackendTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
package io.vertx.httpproxy;
1+
package io.vertx.tests;
22

33
import io.vertx.core.http.Cookie;
44
import io.vertx.core.http.HttpClient;
55
import io.vertx.core.http.HttpMethod;
66
import io.vertx.core.net.SocketAddress;
77
import io.vertx.ext.unit.Async;
88
import io.vertx.ext.unit.TestContext;
9+
import io.vertx.httpproxy.ProxyOptions;
910
import org.junit.Test;
1011

1112
/**

src/test/java/io/vertx/httpproxy/ProxyClientKeepAliveTest.java renamed to src/test/java/io/vertx/tests/ProxyClientKeepAliveTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
11-
package io.vertx.httpproxy;
11+
package io.vertx.tests;
1212

1313
import io.vertx.core.Future;
1414
import io.vertx.core.Promise;
@@ -20,6 +20,7 @@
2020
import io.vertx.core.streams.WriteStream;
2121
import io.vertx.ext.unit.Async;
2222
import io.vertx.ext.unit.TestContext;
23+
import io.vertx.httpproxy.*;
2324
import org.junit.Test;
2425

2526
import java.io.Closeable;

src/test/java/io/vertx/httpproxy/ProxyClientNotPersistentTest.java renamed to src/test/java/io/vertx/tests/ProxyClientNotPersistentTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
*
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
11-
package io.vertx.httpproxy;
11+
package io.vertx.tests;
1212

1313
import io.vertx.ext.unit.TestContext;
14+
import io.vertx.httpproxy.ProxyOptions;
1415

1516
/**
1617
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>

src/test/java/io/vertx/httpproxy/ProxyClientPipelinedTest.java renamed to src/test/java/io/vertx/tests/ProxyClientPipelinedTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
*
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
11-
package io.vertx.httpproxy;
11+
package io.vertx.tests;
12+
13+
import io.vertx.httpproxy.ProxyOptions;
1214

1315
/**
1416
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>

src/test/java/io/vertx/httpproxy/ProxyRequestTest.java renamed to src/test/java/io/vertx/tests/ProxyRequestTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
11-
package io.vertx.httpproxy;
11+
package io.vertx.tests;
1212

1313
import io.vertx.core.AsyncResult;
1414
import io.vertx.core.Future;
@@ -18,7 +18,6 @@
1818
import io.vertx.core.buffer.Buffer;
1919
import io.vertx.core.http.HttpClient;
2020
import io.vertx.core.http.HttpClientOptions;
21-
import io.vertx.core.http.HttpClientRequest;
2221
import io.vertx.core.http.HttpClientResponse;
2322
import io.vertx.core.http.HttpHeaders;
2423
import io.vertx.core.http.HttpMethod;
@@ -32,6 +31,7 @@
3231
import io.vertx.core.streams.ReadStream;
3332
import io.vertx.ext.unit.Async;
3433
import io.vertx.ext.unit.TestContext;
34+
import io.vertx.httpproxy.*;
3535
import org.junit.Ignore;
3636
import org.junit.Test;
3737

0 commit comments

Comments
 (0)