[jboss-cvs] JBossAS SVN: r80486 - in projects/jboss-deployers/branches/Branch_2_0: deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations and 8 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Nov 4 08:01:20 EST 2008
Author: alesj
Date: 2008-11-04 08:01:19 -0500 (Tue, 04 Nov 2008)
New Revision: 80486
Added:
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/DeploymentUnitClassPath.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuper.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuperAnnotated.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuper.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuperAnnotated.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml
Removed:
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml
Modified:
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationEnvironmentDeployer.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationEnvironmentDeployer.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClass.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClass.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AnnotationsScanningUnitTestCase.java
projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/test/ObjectMFDTestCase.java
projects/jboss-deployers/branches/Branch_2_0/pom.xml
Log:
Port trunk changes to branch.
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationEnvironmentDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationEnvironmentDeployer.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/AnnotationEnvironmentDeployer.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -113,6 +113,7 @@
* @param classLoader the class loader
* @return javassist class pool
*/
+ @Deprecated
protected ClassPool createClassPool(ClassLoader classLoader)
{
ClassPool pool = new ClassPool();
@@ -122,6 +123,23 @@
}
/**
+ * Create class pool.
+ *
+ * @param unit the deployment unit
+ * @return javassist class pool
+ */
+ protected ClassPool createClassPool(VFSDeploymentUnit unit)
+ {
+ ClassPool pool = new ClassPool();
+ ClassPath deploymentPath = new DeploymentUnitClassPath(unit);
+ pool.appendClassPath(deploymentPath);
+ // fall back to classloader classpath
+ ClassPath classPath = new LoaderClassPath(unit.getClassLoader());
+ pool.appendClassPath(classPath);
+ return pool;
+ }
+
+ /**
* Visit module.
*
* Util method to add some behavior to Module
@@ -196,7 +214,7 @@
log.trace("Creating AnnotationEnvironment for " + unit.getName() + ", module: " + module + ", force annotations: " + forceAnnotations);
ClassLoader classLoader = unit.getClassLoader();
- ClassPool pool = createClassPool(classLoader);
+ ClassPool pool = createClassPool(unit);
GenericAnnotationResourceVisitor visitor = createGenericAnnotationResourceVisitor(unit, pool, classLoader);
// something in javassist uses TCL
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/DeploymentUnitClassPath.java (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/DeploymentUnitClassPath.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/DeploymentUnitClassPath.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/DeploymentUnitClassPath.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,136 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.deployers.vfs.plugins.annotations;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javassist.ClassPath;
+import javassist.NotFoundException;
+import org.jboss.classloader.plugins.ClassLoaderUtils;
+import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.util.collection.SoftValueHashMap;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Javassist ClassPath impl based on deployment unit
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DeploymentUnitClassPath implements ClassPath
+{
+ private VFSDeploymentUnit unit;
+ @SuppressWarnings("unchecked")
+ private Map<String, VirtualFile> cache = Collections.synchronizedMap(new SoftValueHashMap());
+ /** By default exclude jdk classes */
+ private ClassFilter excludeFilter = ClassFilter.JAVA_ONLY;
+
+ public DeploymentUnitClassPath(VFSDeploymentUnit unit)
+ {
+ if (unit == null)
+ throw new IllegalArgumentException("Null deployment unit.");
+ this.unit = unit;
+ }
+
+ /**
+ * Set exclude filter.
+ *
+ * @param excludeFilter the exclude filter
+ */
+ public void setExcludeFilter(ClassFilter excludeFilter)
+ {
+ this.excludeFilter = excludeFilter;
+ }
+
+ /**
+ * Find file.
+ *
+ * @param className the classname we're looking for
+ * @return virtual file or null if not found
+ * @throws IOException for any exception
+ */
+ protected VirtualFile findFile(String className) throws IOException
+ {
+ if (excludeFilter != null && excludeFilter.matchesClassName(className))
+ return null;
+
+ VirtualFile file = cache.get(className);
+ if (file != null)
+ return file;
+
+ List<VirtualFile> classPath = unit.getClassPath();
+ if (classPath != null && classPath.isEmpty() == false)
+ {
+ String path = ClassLoaderUtils.classNameToPath(className);
+ for (VirtualFile cp : classPath)
+ {
+ file = cp.getChild(path);
+ if (file != null)
+ {
+ cache.put(className, file);
+ return file;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public InputStream openClassfile(String className) throws NotFoundException
+ {
+ try
+ {
+ VirtualFile file = findFile(className);
+ if (file != null)
+ return file.openStream();
+ }
+ catch (IOException e)
+ {
+ throw new NotFoundException("Exception finding file: " + className, e);
+ }
+ throw new NotFoundException("ClassName '" + className + "' not found in deployment unit: " + unit);
+ }
+
+ public URL find(String className)
+ {
+ try
+ {
+ VirtualFile file = findFile(className);
+ if (file != null)
+ return file.toURL();
+ }
+ catch (Exception ignored)
+ {
+ }
+ return null;
+ }
+
+ public void close()
+ {
+ cache.clear();
+ }
+}
\ No newline at end of file
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationEnvironmentDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationEnvironmentDeployer.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/annotations/ScopedAnnotationEnvironmentDeployer.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -23,6 +23,7 @@
import javassist.ClassPool;
import javassist.scopedpool.ScopedClassPoolRepository;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
/**
* Scoped class pool usage annotation environment deployer.
@@ -52,6 +53,7 @@
this.repository = repository;
}
+ @Deprecated
protected ClassPool createClassPool(ClassLoader classLoader)
{
if (repository != null)
@@ -59,4 +61,12 @@
return super.createClassPool(classLoader);
}
+
+ protected ClassPool createClassPool(VFSDeploymentUnit unit)
+ {
+ if (repository != null)
+ return repository.findClassPool(unit.getClassLoader());
+
+ return super.createClassPool(unit);
+ }
}
\ No newline at end of file
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -66,6 +66,9 @@
String modificationType = attrs.getValue("modification");
if (modificationType != null)
child.setModificationType(ModificationType.getModificationType(modificationType));
+ String comparator = attrs.getValue("comparator");
+ if (comparator != null)
+ child.setComparatorClassName(comparator);
return child;
}
return null;
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClass.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClass.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClass.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -27,6 +27,6 @@
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
@Marked
-public class JarMarkOnClass
+public class JarMarkOnClass extends JarMarkOnClassSuper
{
}
\ No newline at end of file
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuper.java (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuper.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuper.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuper.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,29 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.annotations.support.jar;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JarMarkOnClassSuper extends JarMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuperAnnotated.java (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuperAnnotated.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuperAnnotated.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/jar/JarMarkOnClassSuperAnnotated.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.annotations.support.jar;
+
+import org.jboss.test.deployers.vfs.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class JarMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClass.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClass.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClass.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -27,6 +27,6 @@
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
@Marked
-public class WebMarkOnClass
+public class WebMarkOnClass extends WebMarkOnClassSuper
{
}
\ No newline at end of file
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuper.java (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuper.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuper.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuper.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,29 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.annotations.support.war;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class WebMarkOnClassSuper extends WebMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuperAnnotated.java (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuperAnnotated.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuperAnnotated.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/war/WebMarkOnClassSuperAnnotated.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.annotations.support.war;
+
+import org.jboss.test.deployers.vfs.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class WebMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AnnotationsScanningUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AnnotationsScanningUnitTestCase.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AnnotationsScanningUnitTestCase.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -70,9 +70,9 @@
try
{
DeploymentUnit jarUnit = assertChild(unit, "simple.jar");
- assertAnnotations(jarUnit, 1, 1, 1);
+ assertAnnotations(jarUnit, 2, 1, 1);
DeploymentUnit webUnit = assertChild(unit, "simple.war");
- assertAnnotations(webUnit, 1, 1, 1);
+ assertAnnotations(webUnit, 2, 1, 1);
}
finally
{
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/test/ObjectMFDTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/test/ObjectMFDTestCase.java 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/test/ObjectMFDTestCase.java 2008-11-04 13:01:19 UTC (rev 80486)
@@ -25,6 +25,7 @@
import junit.framework.Test;
import org.jboss.deployers.spi.deployer.Deployer;
+import org.jboss.deployers.spi.structure.ContextInfo;
import org.jboss.deployers.spi.structure.StructureMetaData;
import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext;
import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentUnit;
@@ -70,4 +71,34 @@
deployer.undeploy(unit);
}
}
+
+ public void testComparator() throws Exception
+ {
+ VirtualFile file = getVirtualFile("/structure/explicit", "comparator.jar");
+ VFSDeploymentContext deployment = new AbstractVFSDeploymentContext(file, "");
+ deployment.setMetaDataPath(Collections.singletonList("META-INF"));
+ VFSDeploymentUnit unit = new AbstractVFSDeploymentUnit(deployment);
+ Deployer deployer = new StructureOMFDeployer();
+
+ deployer.deploy(unit);
+ try
+ {
+ StructureMetaData metaData = unit.getAttachment(StructureMetaData.class);
+ assertNotNull(metaData);
+ assertComparator(metaData, "", "org.jboss.test.deployment.test.SomeDeploymentComparatorTop");
+ assertComparator(metaData, "sub.jar", "org.jboss.test.deployment.test.SomeDeploymentComparatorSub");
+ assertComparator(metaData, "x.war", "org.jboss.test.deployment.test.SomeDeploymentComparatorX");
+ }
+ finally
+ {
+ deployer.undeploy(unit);
+ }
+ }
+
+ protected void assertComparator(StructureMetaData metaData, String path, String comparator)
+ {
+ ContextInfo ci = metaData.getContext(path);
+ assertNotNull(ci);
+ assertEquals(comparator, ci.getComparatorClassName());
+ }
}
\ No newline at end of file
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structure/explicit/comparator.jar)
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF)
Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml 2008-11-04 13:01:19 UTC (rev 80486)
@@ -1,28 +0,0 @@
- <structure>
- <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorTop">
- <path name=""/>
- <metaDataPath>
- <path name="META-INF"/>
- </metaDataPath>
- <classpath>
- <path name="jar1.jar"/>
- <path name="lib-dir" suffixes=".jar"/>
- </classpath>
- </context>
- <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorSub">
- <path name="sub.jar"/>
- <metaDataPath>
- <path name="META-INF"/>
- </metaDataPath>
- </context>
- <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorX">
- <path name="x.war"/>
- <metaDataPath>
- <path name="WEB-INF"/>
- </metaDataPath>
- <classpath>
- <path name="x.war/WEB-INF/classes"/>
- <path name="x.war/WEB-INF/lib" suffixes=".jar"/>
- </classpath>
- </context>
-</structure>
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml (from rev 80485, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/explicit/comparator.jar/META-INF/jboss-structure.xml 2008-11-04 13:01:19 UTC (rev 80486)
@@ -0,0 +1,28 @@
+ <structure>
+ <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorTop">
+ <path name=""/>
+ <metaDataPath>
+ <path name="META-INF"/>
+ </metaDataPath>
+ <classpath>
+ <path name="jar1.jar"/>
+ <path name="lib-dir" suffixes=".jar"/>
+ </classpath>
+ </context>
+ <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorSub">
+ <path name="sub.jar"/>
+ <metaDataPath>
+ <path name="META-INF"/>
+ </metaDataPath>
+ </context>
+ <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorX">
+ <path name="x.war"/>
+ <metaDataPath>
+ <path name="WEB-INF"/>
+ </metaDataPath>
+ <classpath>
+ <path name="x.war/WEB-INF/classes"/>
+ <path name="x.war/WEB-INF/lib" suffixes=".jar"/>
+ </classpath>
+ </context>
+</structure>
Modified: projects/jboss-deployers/branches/Branch_2_0/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/pom.xml 2008-11-04 12:42:08 UTC (rev 80485)
+++ projects/jboss-deployers/branches/Branch_2_0/pom.xml 2008-11-04 13:01:19 UTC (rev 80486)
@@ -22,16 +22,16 @@
<properties>
<version.jboss.man>2.0.0.CR2</version.jboss.man>
- <version.jboss.mdr>2.0.0.GA</version.jboss.mdr>
- <version.jboss.microcontainer>2.0.0.CR3</version.jboss.microcontainer>
- <version.jboss.classloader>2.0.0.CR4</version.jboss.classloader>
+ <version.jboss.mdr>2.0.1.GA</version.jboss.mdr>
+ <version.jboss.microcontainer>2.0.0.CR4</version.jboss.microcontainer>
+ <version.jboss.classloader>2.0.0.CR5</version.jboss.classloader>
<version.jboss.classloading.spi>5.0.0.CR2</version.jboss.classloading.spi>
- <version.jboss.common.core>2.2.8.GA</version.jboss.common.core>
+ <version.jboss.common.core>2.2.9.GA</version.jboss.common.core>
<version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
<version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
<version.jbossxb>2.0.0.GA</version.jbossxb>
<version.jboss.aop>2.0.0.GA</version.jboss.aop>
- <version.jboss.vfs>2.0.0.CR1</version.jboss.vfs>
+ <version.jboss.vfs>2.0.0.CR2</version.jboss.vfs>
<version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
<version.junit>4.4</version.junit>
<version.javassist>3.9.0.GA</version.javassist>
More information about the jboss-cvs-commits
mailing list