Skip to content

Commit

Permalink
conver servlet 5 tests from groovy to java (#12364)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger authored Oct 19, 2024
1 parent f422eec commit c165ca4
Show file tree
Hide file tree
Showing 56 changed files with 2,470 additions and 1,955 deletions.
23 changes: 0 additions & 23 deletions instrumentation/servlet/servlet-3.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,4 @@ dependencies {
bootstrap(project(":instrumentation:servlet:servlet-common:bootstrap"))

compileOnly("javax.servlet:javax.servlet-api:3.0.1")

testInstrumentation(project(":instrumentation:jetty:jetty-8.0:javaagent"))
testImplementation(project(":instrumentation:servlet:servlet-common:bootstrap"))

testLibrary("org.eclipse.jetty:jetty-server:8.0.0.v20110901")
testLibrary("org.eclipse.jetty:jetty-servlet:8.0.0.v20110901")
testLibrary("org.apache.tomcat.embed:tomcat-embed-core:8.0.41")
testLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:8.0.41")

latestDepTestLibrary("org.eclipse.jetty:jetty-server:10.+") // see servlet-5.0 module
latestDepTestLibrary("org.eclipse.jetty:jetty-servlet:10.+") // see servlet-5.0 module

latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-core:9.+") // see servlet-5.0 module
latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:9.+") // see servlet-5.0 module
}

tasks {
withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.servlet.experimental.capture-request-parameters=test-parameter")
// required on jdk17
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class ErrorHandlerValve extends ErrorReportValve {
// public, because it's loaded by reflection
public class ErrorHandlerValve extends ErrorReportValve {

private static final Logger logger = LoggerFactory.getLogger(ErrorHandlerValve.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;

class TestAccessLogValve extends ValveBase implements AccessLog {
// public, because it's loaded by reflection
public class TestAccessLogValve extends ValveBase implements AccessLog {

public final List<Map.Entry<String, String>> getLoggedIds() {
return loggedIds;
Expand Down
20 changes: 0 additions & 20 deletions instrumentation/servlet/servlet-5.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,4 @@ dependencies {
bootstrap(project(":instrumentation:servlet:servlet-common:bootstrap"))

compileOnly("jakarta.servlet:jakarta.servlet-api:5.0.0")

testInstrumentation(project(":instrumentation:jetty:jetty-11.0:javaagent"))

testImplementation(project(":instrumentation:servlet:servlet-5.0:testing"))

testLibrary("org.eclipse.jetty:jetty-server:11.0.0")
testLibrary("org.eclipse.jetty:jetty-servlet:11.0.0")
testLibrary("org.apache.tomcat.embed:tomcat-embed-core:10.0.0")
testLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:10.0.0")

// Tomcat 10.1 requires Java 11
latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-core:10.0.+")
latestDepTestLibrary("org.apache.tomcat.embed:tomcat-embed-jasper:10.0.+")
latestDepTestLibrary("org.eclipse.jetty:jetty-server:11.+")
}

tasks {
withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.servlet.experimental.capture-request-parameters=test-parameter")
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit c165ca4

Please sign in to comment.