You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tv...@apache.org on 2023/08/23 19:58:00 UTC
[commons-jcs] 01/02: Update Tomcat libraries 7.0.22 to 9.0.79
This is an automated email from the ASF dual-hosted git repository.
tv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git
commit ebd8b53c6a997742cf87c95ae7043a3460b67d57
Author: Thomas Vandahl <tv...@apache.org>
AuthorDate: Wed Aug 23 21:54:40 2023 +0200
Update Tomcat libraries 7.0.22 to 9.0.79
---
commons-jcs3-jcache-extras/pom.xml | 47 +++++-----------------
.../jcs3/jcache/extras/web/JCacheFilterTest.java | 19 +++++----
2 files changed, 20 insertions(+), 46 deletions(-)
diff --git a/commons-jcs3-jcache-extras/pom.xml b/commons-jcs3-jcache-extras/pom.xml
index 3fda33ef..ae9d4345 100644
--- a/commons-jcs3-jcache-extras/pom.xml
+++ b/commons-jcs3-jcache-extras/pom.xml
@@ -40,45 +40,10 @@
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-jcache_1.0_spec</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>javax.inject</groupId>-->
-<!-- <artifactId>javax.inject</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-atinject_1.0_spec</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-jcdi_2.0_spec</artifactId>-->
-<!-- </dependency>-->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
</dependency>
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-interceptor_1.2_spec</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>javax.annotation</groupId>-->
-<!-- <artifactId>javax.annotation-api</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-annotation_1.2_spec</artifactId>-->
-<!-- </dependency>-->
-<!-- <dependency>-->
-<!-- <groupId>org.apache.geronimo.specs</groupId>-->
-<!-- <artifactId>geronimo-servlet_3.0_spec</artifactId>-->
-<!-- <version>1.0</version>-->
-<!-- <scope>provided</scope>-->
-<!-- </dependency>-->
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -98,22 +63,27 @@
<artifactId>commons-jcs3-jcache</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
- <version>7.0.72</version>
+ <version>${tomcat.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
- <version>7.0.72</version>
+ <version>${tomcat.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
- <version>7.0.72</version>
+ <version>${tomcat.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -127,5 +97,6 @@
<properties>
<commons.module.name>org.apache.commons.jcs3.jcache.extras</commons.module.name>
<project.build.outputTimestamp>2022-01-01T00:00:00Z</project.build.outputTimestamp>
+ <tomcat.version>9.0.79</tomcat.version>
</properties>
</project>
diff --git a/commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/web/JCacheFilterTest.java b/commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/web/JCacheFilterTest.java
index 204a5819..e0f828ac 100644
--- a/commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/web/JCacheFilterTest.java
+++ b/commons-jcs3-jcache-extras/src/test/java/org/apache/commons/jcs3/jcache/extras/web/JCacheFilterTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.ServletException;
@@ -34,10 +35,10 @@ import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.deploy.FilterDef;
-import org.apache.catalina.deploy.FilterMap;
import org.apache.catalina.startup.Tomcat;
import org.apache.commons.io.IOUtils;
+import org.apache.tomcat.util.descriptor.web.FilterDef;
+import org.apache.tomcat.util.descriptor.web.FilterMap;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -64,16 +65,16 @@ public class JCacheFilterTest
tomcat.start();
final Context ctx = tomcat.addWebapp("/sample", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "empty", Empty.class.getName());
- ctx.addServletMapping("/", "empty");
+ ctx.addServletMappingDecoded("/", "empty");
addJcsFilter(ctx);
StandardContext.class.cast(ctx).filterStart();
final URL url = new URL("http://localhost:" + tomcat.getConnector().getLocalPort() + "/sample/");
- assertEquals("", IOUtils.toString(url.openStream()));
+ assertEquals("", IOUtils.toString(url.openStream(), StandardCharsets.UTF_8));
assertEquals(1, Empty.COUNTER.get());
- assertEquals("", IOUtils.toString(url.openStream()));
+ assertEquals("", IOUtils.toString(url.openStream(), StandardCharsets.UTF_8));
assertEquals(1, Empty.COUNTER.get());
} finally {
stop(tomcat);
@@ -91,15 +92,15 @@ public class JCacheFilterTest
tomcat.start();
final Context ctx = tomcat.addContext("/sample", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "hello", Hello.class.getName());
- ctx.addServletMapping("/", "hello");
+ ctx.addServletMappingDecoded("/", "hello");
addJcsFilter(ctx);
StandardContext.class.cast(ctx).filterStart();
final URL url = new URL("http://localhost:" + tomcat.getConnector().getLocalPort() + "/sample/");
- assertEquals("hello", IOUtils.toString(url.openStream()));
+ assertEquals("hello", IOUtils.toString(url.openStream(), StandardCharsets.UTF_8));
assertEquals(1, Hello.COUNTER.get());
- assertEquals("hello", IOUtils.toString(url.openStream()));
+ assertEquals("hello", IOUtils.toString(url.openStream(), StandardCharsets.UTF_8));
assertEquals(1, Hello.COUNTER.get());
} finally {
stop(tomcat);
@@ -126,6 +127,7 @@ public class JCacheFilterTest
}
public static class Hello extends HttpServlet {
+ private static final long serialVersionUID = 3436497661391300025L;
public static final AtomicInteger COUNTER = new AtomicInteger();
@Override
@@ -136,6 +138,7 @@ public class JCacheFilterTest
}
public static class Empty extends HttpServlet {
+ private static final long serialVersionUID = 4131092201964167043L;
public static final AtomicInteger COUNTER = new AtomicInteger();
@Override