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 13:44:25 UTC

svn commit: r1431324 - in /tomcat/tc7.0.x/trunk: ./ test/org/apache/catalina/core/TestStandardContextResources.java

Author: kkolinko
Date: Thu Jan 10 12:44:25 2013
New Revision: 1431324

URL: http://svn.apache.org/viewvc?rev=1431324&view=rev
Log:
Merged revision 1431310 from tomcat/trunk:
Tests for https://issues.apache.org/bugzilla/show_bug.cgi?id=54391

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1431310

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java?rev=1431324&r1=1431323&r2=1431324&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestStandardContextResources.java Thu Jan 10 12:44:25 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org