Fix cxf latest dep tests (#8449)

This commit is contained in:
Lauri Tulmin 2023-05-09 10:56:18 +03:00 committed by GitHub
parent b43be080d6
commit b800213196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -3,8 +3,6 @@ plugins {
} }
dependencies { dependencies {
testInstrumentation(project(":instrumentation:http-url-connection:javaagent"))
testImplementation("javax.ws.rs:javax.ws.rs-api:2.0.1") testImplementation("javax.ws.rs:javax.ws.rs-api:2.0.1")
testLibrary("org.glassfish.jersey.core:jersey-client:2.0") testLibrary("org.glassfish.jersey.core:jersey-client:2.0")
@ -17,6 +15,8 @@ dependencies {
testImplementation("javax.xml.bind:jaxb-api:2.2.3") testImplementation("javax.xml.bind:jaxb-api:2.2.3")
testInstrumentation(project(":instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent")) testInstrumentation(project(":instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent"))
testInstrumentation(project(":instrumentation:http-url-connection:javaagent"))
testInstrumentation(project(":instrumentation:java-http-client:javaagent"))
latestDepTestLibrary("org.glassfish.jersey.inject:jersey-hk2:2.+") latestDepTestLibrary("org.glassfish.jersey.inject:jersey-hk2:2.+")
latestDepTestLibrary("org.glassfish.jersey.core:jersey-client:2.+") latestDepTestLibrary("org.glassfish.jersey.core:jersey-client:2.+")
@ -31,4 +31,6 @@ tasks.withType<Test>().configureEach {
// required on jdk17 // required on jdk17
jvmArgs("--add-opens=java.base/java.net=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.net=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
} }

View File

@ -174,6 +174,10 @@ class CxfClientTest extends JaxRsClientTest {
Throwable clientSpanError(URI uri, Throwable exception) { Throwable clientSpanError(URI uri, Throwable exception) {
switch (uri.toString()) { switch (uri.toString()) {
case "http://localhost:61/": // unopened port case "http://localhost:61/": // unopened port
if (exception.getCause() instanceof ConnectException) {
exception = exception.getCause()
}
break
case "https://192.0.2.1/": // non routable address case "https://192.0.2.1/": // non routable address
if (exception.getCause() != null) { if (exception.getCause() != null) {
exception = exception.getCause() exception = exception.getCause()
@ -182,6 +186,11 @@ class CxfClientTest extends JaxRsClientTest {
return exception return exception
} }
@Override
boolean testWithClientParent() {
!Boolean.getBoolean("testLatestDeps")
}
@Override @Override
String userAgent() { String userAgent() {
"Apache" "Apache"
@ -191,6 +200,7 @@ class CxfClientTest extends JaxRsClientTest {
ClientBuilder builder() { ClientBuilder builder() {
return new ClientBuilderImpl() return new ClientBuilderImpl()
.property("http.connection.timeout", (long) CONNECT_TIMEOUT_MS) .property("http.connection.timeout", (long) CONNECT_TIMEOUT_MS)
.property("org.apache.cxf.transport.http.forceVersion", "1.1")
} }
@Override @Override

View File

@ -42,7 +42,7 @@ dependencies {
testLibrary("org.apache.cxf:cxf-rt-transports-http-jetty:3.2.0") testLibrary("org.apache.cxf:cxf-rt-transports-http-jetty:3.2.0")
testLibrary("org.apache.cxf:cxf-rt-ws-policy:3.2.0") testLibrary("org.apache.cxf:cxf-rt-ws-policy:3.2.0")
latestDepTestLibrary("org.eclipse.jetty:jetty-webapp:9.+") latestDepTestLibrary("org.eclipse.jetty:jetty-webapp:10.+")
latestDepTestLibrary("org.apache.cxf:cxf-rt-frontend-jaxrs:3.+") latestDepTestLibrary("org.apache.cxf:cxf-rt-frontend-jaxrs:3.+")
latestDepTestLibrary("org.apache.cxf:cxf-rt-transports-http-jetty:3.+") latestDepTestLibrary("org.apache.cxf:cxf-rt-transports-http-jetty:3.+")
latestDepTestLibrary("org.apache.cxf:cxf-rt-ws-policy:3.+") latestDepTestLibrary("org.apache.cxf:cxf-rt-ws-policy:3.+")