You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2013/01/10 22:29:42 UTC
svn commit: r1431661 -
/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
Author: kkolinko
Date: Thu Jan 10 21:29:42 2013
New Revision: 1431661
URL: http://svn.apache.org/viewvc?rev=1431661&view=rev
Log:
Relax the test.
Relative ordering can pick more JARs than those two that belong to the web application.
E.g., Tomcat 8 has npn-8.1.2.v20120308.jar (Jetty NPN).
Running with other JDKs may pick other JARs that are not on our jarsToSkip list.
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java?rev=1431661&r1=1431660&r2=1431661&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java Thu Jan 10 21:29:42 2013
@@ -23,6 +23,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.Arrays;
+import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -86,8 +87,16 @@ public class TestStandardContextResource
"<p>resourceG.jsp in WEB-INF/classes</p>", 404);
// For BZ 54391. Relative ordering is specified in resources2.jar.
- assertEquals(Arrays.asList("resources.jar", "resources2.jar"), ctx
- .getServletContext().getAttribute(ServletContext.ORDERED_LIBS));
+ // It is not absolute-ordering, so there may be other jars in the list
+ List<String> orderedLibs = (List<String>) ctx.getServletContext()
+ .getAttribute(ServletContext.ORDERED_LIBS);
+ if (orderedLibs.size() > 2) {
+ log.warn("testResources(): orderedLibs: " + orderedLibs);
+ }
+ int index = orderedLibs.indexOf("resources.jar");
+ int index2 = orderedLibs.indexOf("resources2.jar");
+ assertTrue(orderedLibs.toString(), index >= 0 && index2 >= 0
+ && index < index2);
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org