tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1382972 - /tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
Date Mon, 10 Sep 2012 16:32:43 GMT
Author: markt
Date: Mon Sep 10 16:32:43 2012
New Revision: 1382972

URL: http://svn.apache.org/viewvc?rev=1382972&view=rev
Log:
Migrate test to new Resources implementation

Modified:
    tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java

Modified: tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java?rev=1382972&r1=1382971&r2=1382972&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
(original)
+++ tomcat/sandbox/trunk-resources/test/org/apache/catalina/loader/TestVirtualWebappLoader.java
Mon Sep 10 16:32:43 2012
@@ -24,10 +24,11 @@ import static org.junit.Assert.assertNul
 
 import org.junit.Test;
 
+import org.apache.catalina.WebResourceRoot;
 import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
-import org.apache.naming.resources.FileDirContext;
+import org.apache.catalina.webresources.StandardRoot;
 
 public class TestVirtualWebappLoader extends TomcatBaseTest {
 
@@ -46,25 +47,30 @@ public class TestVirtualWebappLoader ext
         StandardContext ctx =
             (StandardContext)tomcat.addContext("",  appDir.getAbsolutePath());
 
-        VirtualWebappLoader loader = new VirtualWebappLoader();
+
+        WebappLoader loader = new WebappLoader();
 
         loader.setContext(ctx);
         ctx.setLoader(loader);
-        ctx.setResources(new FileDirContext());
+
+        ctx.setResources(new StandardRoot(ctx));
         ctx.resourcesStart();
-        File dir = new File("test/webapp-3.0-fragments/WEB-INF/lib");
-        loader.setVirtualClasspath(dir.getAbsolutePath() + "/*.jar");
+
+        File f1 = new File("test/webapp-3.0-fragments/WEB-INF/lib");
+        ctx.getResources().createWebResourceSet(
+                WebResourceRoot.ResourceSetType.POST, f1, "/WEB-INF/lib", "");
+
         loader.start();
-        String[] repos = loader.getRepositories();
+        String[] repos = loader.getLoaderRepositories();
         assertEquals(2,repos.length);
         loader.stop();
         // ToDo: Why doesn't remove repositories?
-        repos = loader.getRepositories();
+        repos = loader.getLoaderRepositories();
         assertEquals(2, repos.length);
 
         // no leak
         loader.start();
-        repos = loader.getRepositories();
+        repos = loader.getLoaderRepositories();
         assertEquals(2,repos.length);
 
         // clear loader



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


Mime
View raw message