Skip to content

Commit 7d2d2b7

Browse files
committed
Run HC5 tests also against VertxHttpClientHTTPConduit
1 parent c3a636c commit 7d2d2b7

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
testModule: ['client', 'client-server', 'fastinfoset', 'hc5', 'metrics', 'mtls', 'mtls -Djks', 'mtom-awt', 'opentelemetry', 'saaj', 'santuario-xmlsec', 'server', 'ws-rm-client', 'ws-security', 'ws-security -Djks', 'ws-security-policy', 'ws-security-policy -Djks', 'ws-trust', 'wsdl2java', 'wsdl2java-no-config']
41+
testModule: ['client', 'client-server', 'fastinfoset', 'hc5', 'hc5 -Djks', 'metrics', 'mtls', 'mtls -Djks', 'mtom-awt', 'opentelemetry', 'saaj', 'santuario-xmlsec', 'server', 'ws-rm-client', 'ws-security', 'ws-security -Djks', 'ws-security-policy', 'ws-security-policy -Djks', 'ws-trust', 'wsdl2java', 'wsdl2java-no-config']
4242
name: ${{matrix.testModule}} native tests
4343
needs: build-and-run-jvm-tests
4444
runs-on: ubuntu-latest

integration-tests/hc5/pom.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
<groupId>io.quarkiverse.cxf</groupId>
1818
<artifactId>quarkus-cxf</artifactId>
1919
</dependency>
20-
<dependency>
21-
<groupId>io.quarkiverse.cxf</groupId>
22-
<artifactId>quarkus-cxf-rt-transports-http-hc5</artifactId>
23-
</dependency>
2420
<dependency>
2521
<groupId>io.quarkiverse.cxf</groupId>
2622
<artifactId>quarkus-cxf-rt-features-metrics</artifactId>
@@ -112,6 +108,20 @@
112108
</build>
113109

114110
<profiles>
111+
<profile>
112+
<id>jks</id>
113+
<activation>
114+
<property>
115+
<name>jks</name>
116+
</property>
117+
</activation>
118+
<dependencies>
119+
<dependency>
120+
<groupId>io.quarkiverse.cxf</groupId>
121+
<artifactId>quarkus-cxf-rt-transports-http-hc5</artifactId>
122+
</dependency>
123+
</dependencies>
124+
</profile>
115125
<profile>
116126
<id>native</id>
117127
<activation>

integration-tests/hc5/src/test/java/io/quarkiverse/cxf/hc5/it/Hc5Test.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
import java.util.Map;
1313

1414
import org.assertj.core.api.Assertions;
15+
import org.assertj.core.api.Assumptions;
1516
import org.eclipse.microprofile.config.Config;
1617
import org.eclipse.microprofile.config.ConfigProvider;
1718
import org.junit.jupiter.api.Test;
1819
import org.junit.jupiter.params.ParameterizedTest;
1920
import org.junit.jupiter.params.provider.ValueSource;
2021

22+
import io.quarkiverse.cxf.HTTPConduitImpl;
2123
import io.quarkiverse.cxf.hc5.it.HeaderToMetricsTagRequestFilter.RequestScopedHeader;
2224
import io.quarkiverse.cxf.hc5.it.MultiplyingAddInterceptor.RequestScopedFactorHeader;
2325
import io.quarkus.test.common.QuarkusTestResource;
@@ -46,6 +48,13 @@ void add(String syncMode) {
4648
@ParameterizedTest
4749
@ValueSource(strings = { "sync-observable", "async-observable" })
4850
void addObservable(String syncMode) {
51+
52+
if (syncMode.contains("async")) {
53+
/* URLConnectionHTTPConduitFactory does not support async */
54+
Assumptions.assumeThat(HTTPConduitImpl.findDefaultHTTPConduitImpl())
55+
.isNotEqualTo(HTTPConduitImpl.URLConnectionHTTPConduitFactory);
56+
}
57+
4958
RestAssured.given()
5059
.header(RequestScopedHeader.header, syncMode + "-header-value")
5160
.queryParam("a", 7)
@@ -136,11 +145,23 @@ void wsdlUpToDate() throws IOException {
136145

137146
@Test
138147
void conduit() {
148+
Assumptions.assumeThat(HTTPConduitImpl.findDefaultHTTPConduitImpl())
149+
.isNotEqualTo(HTTPConduitImpl.URLConnectionHTTPConduitFactory);
150+
151+
boolean isHc5;
152+
try {
153+
Class<?> cl = Class.forName("org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduit");
154+
isHc5 = true;
155+
} catch (ClassNotFoundException e) {
156+
isHc5 = false;
157+
}
139158
RestAssured.given()
140159
.get("/hc5/conduit")
141160
.then()
142161
.statusCode(200)
143-
.body(is("org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduit"));
162+
.body(is(isHc5
163+
? "org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduit"
164+
: "io.quarkiverse.cxf.vertx.http.client.VertxHttpClientHTTPConduit"));
144165
}
145166

146167
private Map<String, Object> getMetrics() {

0 commit comments

Comments
 (0)