[jboss-cvs] JBossAS SVN: r76134 - in projects/jboss-deployers/trunk: deployers-vfs/src/tests/org/jboss/test/deployers and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 23 10:24:11 EDT 2008


Author: alesj
Date: 2008-07-23 10:24:11 -0400 (Wed, 23 Jul 2008)
New Revision: 76134

Modified:
   projects/jboss-deployers/trunk/build/pom.xml
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BootstrapDeployersTest.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
Log:
Use VFS snapshot with JBVFS-48 fixes.


Modified: projects/jboss-deployers/trunk/build/pom.xml
===================================================================
--- projects/jboss-deployers/trunk/build/pom.xml	2008-07-23 14:11:35 UTC (rev 76133)
+++ projects/jboss-deployers/trunk/build/pom.xml	2008-07-23 14:24:11 UTC (rev 76134)
@@ -30,7 +30,7 @@
     <version.jboss.common.logging.log4j>2.0.4.GA</version.jboss.common.logging.log4j>
     <version.jbossxb>2.0.0.CR10</version.jbossxb>
     <version.jboss.aop>2.0.0.CR11</version.jboss.aop>
-    <version.jboss.vfs>2.0.0.Beta19</version.jboss.vfs>
+    <version.jboss.vfs>2.0.0-SNAPSHOT</version.jboss.vfs>
     <version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
     <version.junit>4.4</version.junit>
     <version.javassist>3.7.1.GA</version.javassist>

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BootstrapDeployersTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BootstrapDeployersTest.java	2008-07-23 14:11:35 UTC (rev 76133)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BootstrapDeployersTest.java	2008-07-23 14:24:11 UTC (rev 76134)
@@ -27,7 +27,6 @@
 import java.util.List;
 
 import junit.framework.AssertionFailedError;
-
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.jboss.classloader.plugins.ClassLoaderUtils;
@@ -45,11 +44,8 @@
 import org.jboss.virtual.AssembledDirectory;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileVisitor;
-import org.jboss.virtual.VisitorAttributes;
 import org.jboss.virtual.plugins.context.file.FileSystemContext;
 import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.context.vfs.AssembledContext;
 import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
 
 /**
@@ -291,11 +287,9 @@
       }
    }
 
-   // FIXME Missing factor method in the public api
    protected AssembledDirectory createAssembledDirectory(String name) throws Exception
    {
-      AssembledContext ctx = new AssembledContext(name, "");
-      return (AssembledDirectory) ctx.getRoot().getVirtualFile();
+      return AssembledDirectory.createAssembledDirectory(name, "");
    }
 
    protected void addPackage(AssembledDirectory dir, Class<?> reference) throws Exception
@@ -304,43 +298,27 @@
       dir.addResources(reference, new String[] { packagePath + "/*.class" } , new String[0]);
    }
 
-   // FIXME why doesn't AssembledDirectory support this simple use case?
    protected void addPath(final AssembledDirectory dir, String path, String name) throws Exception
    {
       URL url = getResource(path);
       if (url == null)
          fail(path + " not found");
-      VirtualFile file = VFS.getVirtualFile(url, name);
 
-      final VisitorAttributes va = new VisitorAttributes();
-      va.setLeavesOnly(true);
+      VirtualFile file = VFS.getVirtualFile(url, name);
+      // TODO - remove this filter after new VFS relase
       SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
-      va.setRecurseFilter(noJars);
-
-      VirtualFileVisitor visitor = new VirtualFileVisitor()
-      {
-         public VisitorAttributes getAttributes()
-         {
-            return va; 
-         }
-
-         public void visit(VirtualFile virtualFile)
-         {
-            dir.mkdirs(virtualFile.getPathName()).addChild(virtualFile);
-         }
-      };
-      file.visit(visitor);
-   }
+      dir.addPath(file, noJars);
+  }
    
    protected DeploymentUnit assertChild(DeploymentUnit parent, String name)
    {
-      // FIXME AssembledContext URLs are broken
       String parentName = parent.getName();
-      if (parentName.endsWith("/"))
-         parentName = parentName.substring(0, parentName.length()-1);
-      name = name + "/";
-      
-      name = parentName + name ;
+      if (parentName.endsWith("/") == false)
+         parentName += "/";
+      name = parentName + name;
+      if (name.endsWith("/") == false)
+         name += "/";
+
       List<DeploymentUnit> children = parent.getChildren();
       for (DeploymentUnit child : children)
       {

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java	2008-07-23 14:11:35 UTC (rev 76133)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java	2008-07-23 14:24:11 UTC (rev 76134)
@@ -171,6 +171,16 @@
          {
 
          }
+
+         public boolean removeChild(String name) throws IOException
+         {
+            return false;
+         }
+
+         public boolean delete(int gracePeriod) throws IOException
+         {
+            return false;
+         }
       };
    }
 }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java	2008-07-23 14:11:35 UTC (rev 76133)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java	2008-07-23 14:24:11 UTC (rev 76134)
@@ -198,6 +198,16 @@
          {
 
          }
+
+         public boolean removeChild(String name) throws IOException
+         {
+            return false;
+         }
+
+         public boolean delete(int gracePeriod) throws IOException
+         {
+            return false;
+         }
       });
       return altDD;
    }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java	2008-07-23 14:11:35 UTC (rev 76133)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java	2008-07-23 14:24:11 UTC (rev 76134)
@@ -220,6 +220,16 @@
             {
                
             }
+
+            public boolean removeChild(String name) throws IOException
+            {
+               return false;
+            }
+
+            public boolean delete(int gracePeriod) throws IOException
+            {
+               return false;
+            }
          };
       }
 




More information about the jboss-cvs-commits mailing list