You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/08/19 12:36:19 UTC
[tomcat] branch master updated (ae5e5a9 -> ce0c320)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.
from ae5e5a9 Expand to ensure clean closure with connection flow control error
new d2c3c86 Add debug logging
new ce0c320 Remove debug logging
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/catalina/loader/TestVirtualContext.java | 385 +++++++++++----------
.../apache/coyote/http2/TestHttp2Section_5_1.java | 119 +++----
2 files changed, 252 insertions(+), 252 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 02/02: Remove debug logging
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ce0c320352f0728181502b6f5859dfbb71906187
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 19 13:35:40 2020 +0100
Remove debug logging
---
.../apache/coyote/http2/TestHttp2Section_5_1.java | 119 ++++++++++-----------
1 file changed, 54 insertions(+), 65 deletions(-)
diff --git a/test/org/apache/coyote/http2/TestHttp2Section_5_1.java b/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
index 6ec315a..4aa40fc 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_5_1.java
@@ -17,8 +17,6 @@
package org.apache.coyote.http2;
import java.nio.ByteBuffer;
-import java.util.logging.Level;
-import java.util.logging.LogManager;
import org.junit.Assert;
import org.junit.Test;
@@ -259,77 +257,68 @@ public class TestHttp2Section_5_1 extends Http2TestBase {
@Test
public void testExceedMaxActiveStreams02() throws Exception {
+ // http2Connect() - modified
+ enableHttp2(1);
+ configureAndStartWebApplication();
+ openClientConnection();
+ doHttpUpgrade();
+ sendClientPreface();
- LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.ALL);
- try {
- // temporary debug logging to investigate intermittent CI failures
+ // validateHttp2InitialResponse() - modified
+ parser.readFrame(true);
+ parser.readFrame(true);
+ parser.readFrame(true);
+ parser.readFrame(true);
+ parser.readFrame(true);
+ Assert.assertEquals("0-Settings-[3]-[1]\n" +
+ "0-Settings-End\n" +
+ "0-Settings-Ack\n" +
+ "0-Ping-[0,0,0,0,0,0,0,1]\n" +
+ getSimpleResponseTrace(1)
+ , output.getTrace());
+ output.clearTrace();
- // http2Connect() - modified
- enableHttp2(1);
- configureAndStartWebApplication();
- openClientConnection();
- doHttpUpgrade();
- sendClientPreface();
+ sendLargeGetRequest(3);
- // validateHttp2InitialResponse() - modified
- parser.readFrame(true);
- parser.readFrame(true);
- parser.readFrame(true);
- parser.readFrame(true);
- parser.readFrame(true);
+ sendSimpleGetRequest(5);
- Assert.assertEquals("0-Settings-[3]-[1]\n" +
- "0-Settings-End\n" +
- "0-Settings-Ack\n" +
- "0-Ping-[0,0,0,0,0,0,0,1]\n" +
- getSimpleResponseTrace(1)
- , output.getTrace());
- output.clearTrace();
-
- sendLargeGetRequest(3);
-
- sendSimpleGetRequest(5);
-
- // Default connection window size is 64k-1.
- // Initial request will have used 8k leaving 56k-1.
- // Stream window will be 64k-1.
- // Expecting
- // 1 * headers
- // 56k-1 of body (7 * ~8k)
- // 1 * error
- // for a total of 9 frames (could be in any order)
- for (int i = 0; i < 9; i++) {
- parser.readFrame(true);
- }
-
- Assert.assertTrue(output.getTrace(),
- output.getTrace().contains("5-RST-[" +
- Http2Error.REFUSED_STREAM.getCode() + "]"));
- output.clearTrace();
-
- // Connection window is zero.
- // Stream window is 8k
-
- // Reset stream 3 (client cancel)
- sendRst(3, Http2Error.NO_ERROR.getCode());
- // Client reset triggers a write error which in turn triggers a server
- // reset
+ // Default connection window size is 64k-1.
+ // Initial request will have used 8k leaving 56k-1.
+ // Stream window will be 64k-1.
+ // Expecting
+ // 1 * headers
+ // 56k-1 of body (7 * ~8k)
+ // 1 * error
+ // for a total of 9 frames (could be in any order)
+ for (int i = 0; i < 9; i++) {
parser.readFrame(true);
- Assert.assertEquals("3-RST-[5]\n", output.getTrace());
- output.clearTrace();
+ }
- // Open up the connection window.
- sendWindowUpdate(0, (1 << 31) - 2);
+ Assert.assertTrue(output.getTrace(),
+ output.getTrace().contains("5-RST-[" +
+ Http2Error.REFUSED_STREAM.getCode() + "]"));
+ output.clearTrace();
- // Confirm another request can be sent once concurrency falls back below limit
- sendSimpleGetRequest(7);
- parser.readFrame(true);
- parser.readFrame(true);
- Assert.assertEquals(getSimpleResponseTrace(7), output.getTrace());
- } finally {
- LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.INFO);
- }
+ // Connection window is zero.
+ // Stream window is 8k
+
+ // Reset stream 3 (client cancel)
+ sendRst(3, Http2Error.NO_ERROR.getCode());
+ // Client reset triggers a write error which in turn triggers a server
+ // reset
+ parser.readFrame(true);
+ Assert.assertEquals("3-RST-[5]\n", output.getTrace());
+ output.clearTrace();
+
+ // Open up the connection window.
+ sendWindowUpdate(0, (1 << 31) - 2);
+
+ // Confirm another request can be sent once concurrency falls back below limit
+ sendSimpleGetRequest(7);
+ parser.readFrame(true);
+ parser.readFrame(true);
+ Assert.assertEquals(getSimpleResponseTrace(7), output.getTrace());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 01/02: Add debug logging
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit d2c3c86d9443d70b451b26e7b9efa8333dde303f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 19 13:34:59 2020 +0100
Add debug logging
---
.../apache/catalina/loader/TestVirtualContext.java | 385 +++++++++++----------
1 file changed, 198 insertions(+), 187 deletions(-)
diff --git a/test/org/apache/catalina/loader/TestVirtualContext.java b/test/org/apache/catalina/loader/TestVirtualContext.java
index 30ef536..7c1ccb8 100644
--- a/test/org/apache/catalina/loader/TestVirtualContext.java
+++ b/test/org/apache/catalina/loader/TestVirtualContext.java
@@ -22,6 +22,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
import org.junit.Assert;
import org.junit.Test;
@@ -55,194 +57,203 @@ public class TestVirtualContext extends TomcatBaseTest {
@Test
public void testVirtualClassLoader() throws Exception {
- Tomcat tomcat = getTomcatInstance();
-
- File appDir = new File("test/webapp-virtual-webapp/src/main/webapp");
- // app dir is relative to server home
- StandardContext ctx = (StandardContext) tomcat.addWebapp(null, "/test",
- appDir.getAbsolutePath());
-
- ctx.setResources(new StandardRoot(ctx));
- File f1 = new File("test/webapp-virtual-webapp/target/classes");
- File f2 = new File("test/webapp-virtual-library/target/WEB-INF");
- File f3 = new File(
- "test/webapp-virtual-webapp/src/main/webapp/WEB-INF/classes");
- File f4 = new File(
- "test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes");
- File f5 = new File("test/webapp-virtual-webapp/src/main/misc");
- File f6 = new File("test/webapp-virtual-webapp/src/main/webapp2");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
- f1.getAbsolutePath(), null, "/");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/WEB-INF",
- f2.getAbsolutePath(), null, "/");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
- f3.getAbsolutePath(), null, "/");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
- f4.getAbsolutePath(), null, "/");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/other",
- f5.getAbsolutePath(), null, "/");
- ctx.getResources().createWebResourceSet(
- WebResourceRoot.ResourceSetType.POST, "/",
- f6.getAbsolutePath(), null, "/");
-
- StandardJarScanner jarScanner = new StandardJarScanner();
- jarScanner.setScanAllDirectories(true);
- ctx.setJarScanner(jarScanner);
- ctx.setAddWebinfClassesResources(true);
- tomcat.start();
-
- assertPageContains("/test/classpathGetResourceAsStream.jsp?path=nonexistent",
- "resourceAInWebInfClasses=true", 404);
-
- assertPageContains(
- "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceA.properties",
- "resourceAInWebInfClasses=true");
- assertPageContains(
- "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceA.properties",
- "resourceAInWebInfClasses=true");
-
- assertPageContains(
- "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceB.properties",
- "resourceBInTargetClasses=true");
- assertPageContains(
- "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceB.properties",
- "resourceBInTargetClasses=true");
-
- assertPageContains(
- "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceC.properties",
- "resourceCInDependentLibraryTargetClasses=true");
- assertPageContains(
- "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceC.properties",
- "resourceCInDependentLibraryTargetClasses=true");
-
- assertPageContains(
- "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceD.properties",
- "resourceDInPackagedJarInWebInfLib=true");
- assertPageContains(
- "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceD.properties",
- "resourceDInPackagedJarInWebInfLib=true");
-
- assertPageContains(
- "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceG.properties",
- "resourceGInWebInfClasses=true");
- assertPageContains(
- "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceG.properties",
- "resourceGInWebInfClasses=true");
-
- // test listing all possible paths for a classpath resource
- String allUrls =
- getUrl(
- "http://localhost:" + getPort() +
- "/test/classpathGetResources.jsp?path=rsrc/").toString();
- Assert.assertTrue(
- allUrls,
- allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc") > 0);
- Assert.assertTrue(
- allUrls,
- allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc") > 0);
- Assert.assertTrue(
- allUrls,
- allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar!/rsrc") > 0);
- Assert.assertTrue(
- allUrls,
- allUrls.indexOf("/test/webapp-virtual-webapp/target/classes/rsrc") > 0);
- Assert.assertTrue(
- allUrls,
- allUrls.indexOf("/test/webapp-virtual-library/target/WEB-INF/classes/rsrc") > 0);
-
- // check that there's no duplicate in the URLs
- String[] allUrlsArray = allUrls.split("\\s+");
- Assert.assertEquals(new HashSet<>(Arrays.asList(allUrlsArray)).size(),
- allUrlsArray.length);
-
- String allRsrsc2ClasspathUrls =
- getUrl(
- "http://localhost:" + getPort() +
- "/test/classpathGetResources.jsp?path=rsrc2/").toString();
- Assert.assertTrue(
- allRsrsc2ClasspathUrls,
- allRsrsc2ClasspathUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2") > 0);
-
- // tests context.getRealPath
-
- // the following fails because getRealPath always return a non-null path
- // even if there's no such resource
- // assertPageContains("/test/contextGetRealPath.jsp?path=nonexistent",
- // "resourceAInWebInfClasses=true", 404);
-
- // Real paths depend on the OS and this test has to work on all
- // platforms so use File to convert the path to a platform specific form
- File f = new File(
- "test/webapp-virtual-webapp/src/main/webapp/rsrc/resourceF.properties");
- assertPageContains(
- "/test/contextGetRealPath.jsp?path=/rsrc/resourceF.properties",
- f.getPath());
-
- // tests context.getResource then the content
-
- assertPageContains("/test/contextGetResource.jsp?path=/nonexistent",
- "resourceAInWebInfClasses=true", 404);
- assertPageContains(
- "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceA.properties",
- "resourceAInWebInfClasses=true");
- assertPageContains(
- "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceG.properties",
- "resourceGInWebInfClasses=true");
- assertPageContains(
- "/test/contextGetResource.jsp?path=/rsrc/resourceE.properties",
- "resourceEInDependentLibraryTargetClasses=true");
- assertPageContains(
- "/test/contextGetResource.jsp?path=/other/resourceI.properties",
- "resourceIInWebapp=true");
- assertPageContains(
- "/test/contextGetResource.jsp?path=/rsrc2/resourceJ.properties",
- "resourceJInWebapp=true");
-
- String allRsrcPaths =
- getUrl(
- "http://localhost:" + getPort() +
- "/test/contextGetResourcePaths.jsp?path=/rsrc/").toString();
- Assert.assertTrue(
- allRsrcPaths,
- allRsrcPaths.indexOf("/rsrc/resourceF.properties") > 0);
- Assert.assertTrue(
- allRsrcPaths,
- allRsrcPaths.indexOf("/rsrc/resourceE.properties") > 0);
- Assert.assertTrue(
- allRsrcPaths,
- allRsrcPaths.indexOf("/rsrc/resourceH.properties") > 0);
-
- // check that there's no duplicate in the URLs
- String[] allRsrcPathsArray = allRsrcPaths.split("\\s+");
- Assert.assertEquals(new HashSet<>(Arrays.asList(allRsrcPathsArray)).size(),
- allRsrcPathsArray.length);
-
- String allRsrc2Paths =
- getUrl(
- "http://localhost:" + getPort() +
- "/test/contextGetResourcePaths.jsp?path=/rsrc2/").toString();
- Assert.assertTrue(
- allRsrc2Paths,
- allRsrc2Paths.indexOf("/rsrc2/resourceJ.properties") > 0);
-
- assertPageContains(
- "/test/testTlds.jsp",
- "worldA");
- assertPageContains(
- "/test/testTlds.jsp",
- "worldB");
- assertPageContains(
- "/test/testTlds.jsp",
- "worldC");
- assertPageContains(
- "/test/testTlds.jsp",
- "worldD");
+ // debug logging for intermittent CI failures
+ LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.ALL);
+ LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.ALL);
+ try {
+ Tomcat tomcat = getTomcatInstance();
+
+ File appDir = new File("test/webapp-virtual-webapp/src/main/webapp");
+ // app dir is relative to server home
+ StandardContext ctx = (StandardContext) tomcat.addWebapp(null, "/test",
+ appDir.getAbsolutePath());
+
+ ctx.setResources(new StandardRoot(ctx));
+ File f1 = new File("test/webapp-virtual-webapp/target/classes");
+ File f2 = new File("test/webapp-virtual-library/target/WEB-INF");
+ File f3 = new File(
+ "test/webapp-virtual-webapp/src/main/webapp/WEB-INF/classes");
+ File f4 = new File(
+ "test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes");
+ File f5 = new File("test/webapp-virtual-webapp/src/main/misc");
+ File f6 = new File("test/webapp-virtual-webapp/src/main/webapp2");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
+ f1.getAbsolutePath(), null, "/");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/WEB-INF",
+ f2.getAbsolutePath(), null, "/");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
+ f3.getAbsolutePath(), null, "/");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/WEB-INF/classes",
+ f4.getAbsolutePath(), null, "/");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/other",
+ f5.getAbsolutePath(), null, "/");
+ ctx.getResources().createWebResourceSet(
+ WebResourceRoot.ResourceSetType.POST, "/",
+ f6.getAbsolutePath(), null, "/");
+
+ StandardJarScanner jarScanner = new StandardJarScanner();
+ jarScanner.setScanAllDirectories(true);
+ ctx.setJarScanner(jarScanner);
+ ctx.setAddWebinfClassesResources(true);
+
+ tomcat.start();
+
+ assertPageContains("/test/classpathGetResourceAsStream.jsp?path=nonexistent",
+ "resourceAInWebInfClasses=true", 404);
+
+ assertPageContains(
+ "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceA.properties",
+ "resourceAInWebInfClasses=true");
+ assertPageContains(
+ "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceA.properties",
+ "resourceAInWebInfClasses=true");
+
+ assertPageContains(
+ "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceB.properties",
+ "resourceBInTargetClasses=true");
+ assertPageContains(
+ "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceB.properties",
+ "resourceBInTargetClasses=true");
+
+ assertPageContains(
+ "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceC.properties",
+ "resourceCInDependentLibraryTargetClasses=true");
+ assertPageContains(
+ "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceC.properties",
+ "resourceCInDependentLibraryTargetClasses=true");
+
+ assertPageContains(
+ "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceD.properties",
+ "resourceDInPackagedJarInWebInfLib=true");
+ assertPageContains(
+ "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceD.properties",
+ "resourceDInPackagedJarInWebInfLib=true");
+
+ assertPageContains(
+ "/test/classpathGetResourceAsStream.jsp?path=rsrc/resourceG.properties",
+ "resourceGInWebInfClasses=true");
+ assertPageContains(
+ "/test/classpathGetResourceUrlThenGetStream.jsp?path=rsrc/resourceG.properties",
+ "resourceGInWebInfClasses=true");
+
+ // test listing all possible paths for a classpath resource
+ String allUrls =
+ getUrl(
+ "http://localhost:" + getPort() +
+ "/test/classpathGetResources.jsp?path=rsrc/").toString();
+ Assert.assertTrue(
+ allUrls,
+ allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc") > 0);
+ Assert.assertTrue(
+ allUrls,
+ allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc") > 0);
+ Assert.assertTrue(
+ allUrls,
+ allUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar!/rsrc") > 0);
+ Assert.assertTrue(
+ allUrls,
+ allUrls.indexOf("/test/webapp-virtual-webapp/target/classes/rsrc") > 0);
+ Assert.assertTrue(
+ allUrls,
+ allUrls.indexOf("/test/webapp-virtual-library/target/WEB-INF/classes/rsrc") > 0);
+
+ // check that there's no duplicate in the URLs
+ String[] allUrlsArray = allUrls.split("\\s+");
+ Assert.assertEquals(new HashSet<>(Arrays.asList(allUrlsArray)).size(),
+ allUrlsArray.length);
+
+ String allRsrsc2ClasspathUrls =
+ getUrl(
+ "http://localhost:" + getPort() +
+ "/test/classpathGetResources.jsp?path=rsrc2/").toString();
+ Assert.assertTrue(
+ allRsrsc2ClasspathUrls,
+ allRsrsc2ClasspathUrls.indexOf("/test/webapp-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2") > 0);
+
+ // tests context.getRealPath
+
+ // the following fails because getRealPath always return a non-null path
+ // even if there's no such resource
+ // assertPageContains("/test/contextGetRealPath.jsp?path=nonexistent",
+ // "resourceAInWebInfClasses=true", 404);
+
+ // Real paths depend on the OS and this test has to work on all
+ // platforms so use File to convert the path to a platform specific form
+ File f = new File(
+ "test/webapp-virtual-webapp/src/main/webapp/rsrc/resourceF.properties");
+ assertPageContains(
+ "/test/contextGetRealPath.jsp?path=/rsrc/resourceF.properties",
+ f.getPath());
+
+ // tests context.getResource then the content
+
+ assertPageContains("/test/contextGetResource.jsp?path=/nonexistent",
+ "resourceAInWebInfClasses=true", 404);
+ assertPageContains(
+ "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceA.properties",
+ "resourceAInWebInfClasses=true");
+ assertPageContains(
+ "/test/contextGetResource.jsp?path=/WEB-INF/classes/rsrc/resourceG.properties",
+ "resourceGInWebInfClasses=true");
+ assertPageContains(
+ "/test/contextGetResource.jsp?path=/rsrc/resourceE.properties",
+ "resourceEInDependentLibraryTargetClasses=true");
+ assertPageContains(
+ "/test/contextGetResource.jsp?path=/other/resourceI.properties",
+ "resourceIInWebapp=true");
+ assertPageContains(
+ "/test/contextGetResource.jsp?path=/rsrc2/resourceJ.properties",
+ "resourceJInWebapp=true");
+
+ String allRsrcPaths =
+ getUrl(
+ "http://localhost:" + getPort() +
+ "/test/contextGetResourcePaths.jsp?path=/rsrc/").toString();
+ Assert.assertTrue(
+ allRsrcPaths,
+ allRsrcPaths.indexOf("/rsrc/resourceF.properties") > 0);
+ Assert.assertTrue(
+ allRsrcPaths,
+ allRsrcPaths.indexOf("/rsrc/resourceE.properties") > 0);
+ Assert.assertTrue(
+ allRsrcPaths,
+ allRsrcPaths.indexOf("/rsrc/resourceH.properties") > 0);
+
+ // check that there's no duplicate in the URLs
+ String[] allRsrcPathsArray = allRsrcPaths.split("\\s+");
+ Assert.assertEquals(new HashSet<>(Arrays.asList(allRsrcPathsArray)).size(),
+ allRsrcPathsArray.length);
+
+ String allRsrc2Paths =
+ getUrl(
+ "http://localhost:" + getPort() +
+ "/test/contextGetResourcePaths.jsp?path=/rsrc2/").toString();
+ Assert.assertTrue(
+ allRsrc2Paths,
+ allRsrc2Paths.indexOf("/rsrc2/resourceJ.properties") > 0);
+
+ assertPageContains(
+ "/test/testTlds.jsp",
+ "worldA");
+ assertPageContains(
+ "/test/testTlds.jsp",
+ "worldB");
+ assertPageContains(
+ "/test/testTlds.jsp",
+ "worldC");
+ assertPageContains(
+ "/test/testTlds.jsp",
+ "worldD");
+ } finally {
+ LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.INFO);
+ LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.INFO);
+ }
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org