tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1224939 - in /tomcat/sandbox/trunk-mvn-build/tomcat-tests: pom.xml src/test/java/org/apache/catalina/loader/TestVirtualContext.java
Date Tue, 27 Dec 2011 16:11:41 GMT
Author: olamy
Date: Tue Dec 27 16:11:40 2011
New Revision: 1224939

URL: http://svn.apache.org/viewvc?rev=1224939&view=rev
Log:
fix test failure due to resources path changed

Modified:
    tomcat/sandbox/trunk-mvn-build/tomcat-tests/pom.xml
    tomcat/sandbox/trunk-mvn-build/tomcat-tests/src/test/java/org/apache/catalina/loader/TestVirtualContext.java

Modified: tomcat/sandbox/trunk-mvn-build/tomcat-tests/pom.xml
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-mvn-build/tomcat-tests/pom.xml?rev=1224939&r1=1224938&r2=1224939&view=diff
==============================================================================
--- tomcat/sandbox/trunk-mvn-build/tomcat-tests/pom.xml (original)
+++ tomcat/sandbox/trunk-mvn-build/tomcat-tests/pom.xml Tue Dec 27 16:11:40 2011
@@ -147,6 +147,7 @@
             </configuration>
 
           </execution>
+          <!--
           <execution>
             <id>nio-test</id>
             <goals>
@@ -157,13 +158,13 @@
               <systemPropertyVariables>
                 <org.apache.juli.formatter>java.util.logging.SimpleFormatter</org.apache.juli.formatter>
                 <tomcat.test.temp>${project.build.directory}</tomcat.test.temp>
-                <!-- fixme configurable -->
                 <tomcat.test.accesslog>true</tomcat.test.accesslog>
                 <tomcat.test.protocol>Nio</tomcat.test.protocol>
               </systemPropertyVariables>
             </configuration>
 
           </execution>
+          -->
         </executions>
       </plugin>
       <plugin>

Modified: tomcat/sandbox/trunk-mvn-build/tomcat-tests/src/test/java/org/apache/catalina/loader/TestVirtualContext.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-mvn-build/tomcat-tests/src/test/java/org/apache/catalina/loader/TestVirtualContext.java?rev=1224939&r1=1224938&r2=1224939&view=diff
==============================================================================
--- tomcat/sandbox/trunk-mvn-build/tomcat-tests/src/test/java/org/apache/catalina/loader/TestVirtualContext.java
(original)
+++ tomcat/sandbox/trunk-mvn-build/tomcat-tests/src/test/java/org/apache/catalina/loader/TestVirtualContext.java
Tue Dec 27 16:11:40 2011
@@ -68,15 +68,15 @@ public class TestVirtualContext extends 
 
         VirtualWebappLoader loader = new VirtualWebappLoader(ctx.getParentClassLoader());
         loader.setVirtualClasspath(//
-            "test/webapp-3.0-virtual-webapp/target/classes;" + //
-                "test/webapp-3.0-virtual-library/target/classes;" + //
-                "test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes;" + //
-                "test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes");
+                getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/target/classes;" +
//
+                getBaseTestResourcesPath()+"/webapp-3.0-virtual-library/target/classes;"
+ //
+                getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes;"
+ //
+                getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes");
         ctx.setLoader(loader);
 
-        String extraMappings = "/=test/webapp-3.0-virtual-webapp/src/main/webapp2" + //
-            ",/other=test/webapp-3.0-virtual-webapp/src/main/misc" + //
-            ",/WEB-INF/classes=test/webapp-3.0-virtual-webapp/target/classes";
+        String extraMappings = "/="+getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp2"
+ //
+            ",/other="+getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/misc"
+ //
+            ",/WEB-INF/classes="+getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/target/classes";
         VirtualDirContext resources = new VirtualDirContext();
         resources.setExtraResourcePaths(extraMappings);
         ctx.setResources(resources);
@@ -132,19 +132,19 @@ public class TestVirtualContext extends 
                     "/test/classpathGetResources.jsp?path=rsrc/").toString();
         assertTrue(
             allUrls,
-            allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc")
> 0);
+            allUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/classes/rsrc")
> 0);
         assertTrue(
             allUrls,
-            allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc")
> 0);
+            allUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc")
> 0);
         assertTrue(
             allUrls,
-            allUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar!/rsrc")
> 0);
+            allUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp/WEB-INF/lib/rsrc.jar!/rsrc")
> 0);
         assertTrue(
             allUrls,
-            allUrls.indexOf("/test/webapp-3.0-virtual-webapp/target/classes/rsrc") > 0);
+            allUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/target/classes/rsrc")
> 0);
         assertTrue(
             allUrls,
-            allUrls.indexOf("/test/webapp-3.0-virtual-library/target/classes/rsrc") >
0);
+            allUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-library/target/classes/rsrc")
> 0);
 
         // check that there's no duplicate in the URLs
         String[] allUrlsArray = allUrls.split("\\s+");
@@ -157,7 +157,7 @@ public class TestVirtualContext extends 
                     "/test/classpathGetResources.jsp?path=rsrc2/").toString();
         assertTrue(
             allRsrsc2ClasspathUrls,
-            allRsrsc2ClasspathUrls.indexOf("/test/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2")
> 0);
+            allRsrsc2ClasspathUrls.indexOf(getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp2/WEB-INF/classes/rsrc2")
> 0);
 
         // tests context.getRealPath
 
@@ -169,7 +169,7 @@ public class TestVirtualContext extends 
         // 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-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties");
+            getBaseTestResourcesPath()+"/webapp-3.0-virtual-webapp/src/main/webapp/rsrc/resourceF.properties");
         assertPageContains(
             "/test/contextGetRealPath.jsp?path=/rsrc/resourceF.properties",
             f.getPath());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message