Author: kkolinko Date: Thu Jan 10 12:10:50 2013 New Revision: 1431310 URL: http://svn.apache.org/viewvc?rev=1431310&view=rev Log: Tests for https://issues.apache.org/bugzilla/show_bug.cgi?id=54391
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=1431310&r1=1431309&r2=1431310&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContextResources.java Thu Jan 10 12:10:50 2013 @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; +import java.util.Arrays; import javax.servlet.ServletContext; import javax.servlet.ServletException; @@ -34,6 +35,7 @@ import static org.junit.Assert.assertTru import org.junit.Test; +import org.apache.catalina.Context; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; @@ -66,7 +68,7 @@ public class TestStandardContextResource File appDir = new File("test/webapp-3.0-fragments"); // app dir is relative to server home - tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); + Context ctx = tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); tomcat.start(); @@ -82,6 +84,10 @@ public class TestStandardContextResource "<p>resourceE.jsp in the web application</p>"); assertPageContains("/test/resourceG.jsp", "<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)); } @Test @@ -144,6 +150,10 @@ public class TestStandardContextResource assertPageContains("/test/getresource?path=/resourceB.jsp", "<p>resourceB.jsp in resources.jar</p>"); + // Check ordering, for BZ 54391 + assertEquals(Arrays.asList("resources.jar", "resources2.jar"), ctx + .getServletContext().getAttribute(ServletContext.ORDERED_LIBS)); + ctx.stop(); LifecycleListener[] listener1 = ctx.findLifecycleListeners(); @@ -173,6 +183,9 @@ public class TestStandardContextResource assertPageContains("/test/getresource?path=/resourceB.jsp", "<p>resourceB.jsp in resources2.jar</p>"); + // Check ordering, for BZ 54391 + assertEquals(Arrays.asList("resources2.jar", "resources.jar"), ctx + .getServletContext().getAttribute(ServletContext.ORDERED_LIBS)); } @Test --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org