[jboss-cvs] JBossAS SVN: r63687 - in projects/microcontainer/trunk: deployers-vfs and 149 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jun 27 12:00:12 EDT 2007
Author: adrian at jboss.org
Date: 2007-06-27 12:00:12 -0400 (Wed, 27 Jun 2007)
New Revision: 63687
Added:
projects/microcontainer/trunk/deployers-vfs/
projects/microcontainer/trunk/deployers-vfs/.classpath
projects/microcontainer/trunk/deployers-vfs/.project
projects/microcontainer/trunk/deployers-vfs/pom.xml
projects/microcontainer/trunk/deployers-vfs/src/
projects/microcontainer/trunk/deployers-vfs/src/main/
projects/microcontainer/trunk/deployers-vfs/src/main/org/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/KernelDeploymentDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PackageVisitor.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSClassLoaderPolicy.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSTopLevelClassLoaderSystemDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/AbstractVFSDeployment.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/DefaultVFSDeploymentFactory.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/MetaDataMatchFilter.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/SecurityActions.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/StructureDeployerWrapper.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSDeploymentResourceLoaderImpl.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructureBuilder.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/
projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java
projects/microcontainer/trunk/deployers-vfs/src/resources/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/my-beans.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/META-INF/my-beans.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/dummy/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/dummy/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/jaxp/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/jaxp/somebean.jbean
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/exact/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/exact/jboss-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata-nometainf.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata-nometainf.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/1-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/2-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/partial/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/partial/mydb-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/META-INF/application.properties
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/lib0.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/lib0.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean1ejb.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean1ejb.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean2.ejb3/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean2.ejb3/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-client1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-client1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/META-INF/jboss-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/extensions.aop/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/extensions.aop/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean.sar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean.sar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean2-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1.rar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1.rar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-web1.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-web1.war/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean1ejb.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean1ejb.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean2.ejb3/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean2.ejb3/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-client1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-client1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mbean1.sar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mbean1.sar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1.rar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1.rar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-web1.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-web1.war/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/relative.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/relative.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/notanear/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/META-INF/application.properties
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/lib0.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/lib0.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean1ejb.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean1ejb.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean2.ejb3/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean2.ejb3/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-client1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-client1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mbean1.sar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mbean1.sar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1.rar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1.rar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-web1.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-web1.war/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean1ejb.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean1ejb.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean2.ejb3/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean2.ejb3/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-client1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-client1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mbean1.sar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mbean1.sar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1-ds.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1.rar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1.rar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-web1.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-web1.war/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/cp-mf.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/cp-mf.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/jar1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/jar1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar0.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar0.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/META-INF/MANIFEST.MF
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/META-INF/MANIFEST.MF
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/classes/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/classes/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/w0.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/w0.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/directory/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/directory/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/simple/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/simple/simple-service.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/unknown/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/unknown/test-unknown.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/unknown/unknown.xml
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.jar
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.zip
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.jar
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.zip
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple1.txt
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple2.txt
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/META-INF/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/sub.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/sub.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/sub/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/sub/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directory.war/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directory.war/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorynotawar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorynotawar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/classes/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/classes/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j0.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j0.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j1.jar/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j1.jar/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/notanarchive/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/notanarchive/notanarchive.war
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/simple/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/simple/simple.war
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child1
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child2
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child3
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/META-INF/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/META-INF/empty
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testOneChild/
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testOneChild/child1
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimple
projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimpleWithAttachment
projects/microcontainer/trunk/deployers-vfs/src/tests/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BaseDeployersVFSTest.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/Simple.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/TestBeanDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/BeanDeployerUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/KernelDeployerUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/VFSDeployerTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/SomeBean.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/TestXmlDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/test/JAXPDeployerUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/VFSDeploymentFactoryTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/test/VFSDeploymentFactoryUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/VFSMetaDataTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/test/MetaDataUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/VFSStructureTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/EarModule.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/AbstractFileStructureTest.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/CombinedFileStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/ConfiguredSuffixFileStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/AbstractJARStructureTest.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/CombinedJARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/ConfiguredSuffixJARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/JARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/AbstractWARStructureTest.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/CombinedWARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/WARStructureUnitTestCase.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/VFSStructureBuilderTestSuite.java
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/
projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
Log:
Import refactored deployers code
Added: projects/microcontainer/trunk/deployers-vfs/.classpath
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/.classpath (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/.classpath 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="src" path="src/tests"/>
+ <classpathentry kind="lib" path="src/resources/tests"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-vfs/2.0.4.snapshot/jboss-vfs-2.0.4.snapshot.jar" sourcepath="M2_REPO/jboss/jboss-vfs/2.0.4.snapshot/jboss-vfs-2.0.4.snapshot-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA.jar" sourcepath="M2_REPO/jboss/jboss-logging-log4j/2.0.2.GA/jboss-logging-log4j-2.0.2.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-test/1.0.4-SNAPSHOT/jboss-test-1.0.4-SNAPSHOT.jar" sourcepath="M2_REPO/jboss/jboss-test/1.0.4-SNAPSHOT/jboss-test-1.0.4-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jbossxb/2.0.0.CR3/jbossxb-2.0.0.CR3.jar" sourcepath="M2_REPO/jboss/jbossxb/2.0.0.CR3/jbossxb-2.0.0.CR3-sources.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-core-spi"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-client-spi"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-client"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-structure-spi"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-vfs-spi"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-spi"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-deployers-impl"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-classloader"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-container"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-dependency"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-kernel"/>
+ <classpathentry kind="output" path="target/eclipse-classes"/>
+</classpath>
Added: projects/microcontainer/trunk/deployers-vfs/.project
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/.project (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/.project 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-deployers-vfs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/microcontainer/trunk/deployers-vfs/pom.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/pom.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/pom.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,75 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers VFS</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers VFS</description>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/resources/tests</directory>
+ </testResource>
+ </testResources>
+ </build>
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>1.0.4-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,55 @@
+/*
+* 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.deployer.kernel;
+
+import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * BeanDeployer.<p>
+ *
+ * This deployer is responsible for looking for -beans.xml
+ * and creating the metadata object.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanDeployer extends SchemaResolverDeployer<KernelDeployment>
+{
+ /**
+ * Create a new BeanDeployer.
+ */
+ public BeanDeployer()
+ {
+ super(KernelDeployment.class);
+ setSuffix("-beans.xml");
+ }
+
+ @Override
+ protected void init(VFSDeploymentUnit unit, KernelDeployment metaData, VirtualFile file) throws Exception
+ {
+ String name = file.toURI().toString();
+ metaData.setName(name);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,82 @@
+/*
+* 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.deployer.kernel;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * BeanMetaDataDeployer.<p>
+ *
+ * This deployer is responsible for deploying all metadata of
+ * type {@link org.jboss.beans.metadata.spi.BeanMetaData}.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanMetaDataDeployer extends AbstractSimpleRealDeployer<BeanMetaData>
+{
+ /** The kernel controller */
+ private final KernelController controller;
+
+ /**
+ * Create a new BeanDeployer.
+ *
+ * @param kernel the kernel
+ * @throws IllegalArgumentException for a null kernel
+ */
+ public BeanMetaDataDeployer(Kernel kernel)
+ {
+ super(BeanMetaData.class);
+ if (kernel == null)
+ throw new IllegalArgumentException("Null kernel");
+ controller = kernel.getController();
+ setComponentsOnly(true);
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit, BeanMetaData deployment) throws DeploymentException
+ {
+ KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
+
+ try
+ {
+ controller.install(context);
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + deployment.getName(), t);
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit unit, BeanMetaData deployment)
+ {
+ controller.uninstall(deployment.getName());
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/KernelDeploymentDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/KernelDeploymentDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/deployer/kernel/KernelDeploymentDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,100 @@
+/*
+* 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.deployer.kernel;
+
+import java.util.List;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer;
+import org.jboss.deployers.spi.deployer.helpers.DeploymentVisitor;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+
+public class KernelDeploymentDeployer extends AbstractComponentDeployer<KernelDeployment, BeanMetaData>
+{
+ /**
+ * Create a new KernelDeploymentDeployer.
+ */
+ public KernelDeploymentDeployer()
+ {
+ setDeploymentVisitor(new KernelDeploymentVisitor());
+ setComponentVisitor(new BeanMetaDataVisitor());
+ }
+
+ protected static void addBeanComponent(DeploymentUnit unit, BeanMetaData bean)
+ {
+ DeploymentUnit component = unit.addComponent(bean.getName());
+ component.addAttachment(BeanMetaData.class.getName(), bean);
+ }
+
+ protected static void removeBeanComponent(DeploymentUnit unit, BeanMetaData bean)
+ {
+ unit.removeComponent(bean.getName());
+ }
+
+ /**
+ * KernelDeploymentVisitor.
+ */
+ public static class KernelDeploymentVisitor implements DeploymentVisitor<KernelDeployment>
+ {
+ public Class<KernelDeployment> getVisitorType()
+ {
+ return KernelDeployment.class;
+ }
+
+ public void deploy(DeploymentUnit unit, KernelDeployment deployment) throws DeploymentException
+ {
+ List<BeanMetaData> beans = deployment.getBeans();
+ for (BeanMetaData bean : beans)
+ addBeanComponent(unit, bean);
+ }
+
+ public void undeploy(DeploymentUnit unit, KernelDeployment deployment)
+ {
+ List<BeanMetaData> beans = deployment.getBeans();
+ for (BeanMetaData bean : beans)
+ removeBeanComponent(unit, bean);
+ }
+ }
+
+ /**
+ * BeanMetaDataVisitor.
+ */
+ public static class BeanMetaDataVisitor implements DeploymentVisitor<BeanMetaData>
+ {
+ public Class<BeanMetaData> getVisitorType()
+ {
+ return BeanMetaData.class;
+ }
+
+ public void deploy(DeploymentUnit unit, BeanMetaData deployment) throws DeploymentException
+ {
+ addBeanComponent(unit, deployment);
+ }
+
+ public void undeploy(DeploymentUnit unit, BeanMetaData deployment)
+ {
+ removeBeanComponent(unit, deployment);
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PackageVisitor.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PackageVisitor.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/PackageVisitor.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.classloader;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.deployers.structure.spi.classloading.ExportAll;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileVisitor;
+import org.jboss.virtual.VisitorAttributes;
+
+/**
+ * Visits a virtual file system recursively
+ * to determine package names based on the exportAll policy
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+class PackageVisitor implements VirtualFileVisitor
+{
+ /** The packages */
+ private Set<String> packages = new HashSet<String>();
+
+ /** The exportAll policy */
+ private ExportAll exportAll;
+
+ /**
+ * Create a new PackageVisitor.
+ *
+ * @param exportAll the export all policy
+ * @throws IllegalArgumentException for a null exportAll policy
+ */
+ public PackageVisitor(ExportAll exportAll)
+ {
+ if (exportAll == null)
+ throw new IllegalArgumentException("Null exportAll policy");
+ this.exportAll = exportAll;
+ }
+
+ /**
+ * Get the packages.
+ *
+ * @return the packages.
+ */
+ public Set<String> getPackages()
+ {
+ return packages;
+ }
+
+ public VisitorAttributes getAttributes()
+ {
+ VisitorAttributes attributes = new VisitorAttributes();
+ attributes.setIncludeRoot(true);
+ attributes.setRecurseFilter(VisitorAttributes.RECURSE_ALL);
+ return attributes;
+ }
+
+ public void visit(VirtualFile file)
+ {
+ try
+ {
+ // We only want only directories
+ if (file.isLeaf() == false)
+ {
+ boolean empty = true;
+ // Include empty directories?
+ if (exportAll == ExportAll.ALL)
+ empty = false;
+ else
+ {
+ // Determine whether there is anything there
+ List<VirtualFile> children = file.getChildren();
+ if (children != null && children.isEmpty() == false)
+ {
+ for (VirtualFile child : children)
+ {
+ // We must have a leaf to be non-empty
+ if (child.isLeaf())
+ {
+ empty = false;
+ break;
+ }
+ }
+ }
+ }
+ // This looks interesting
+ if (empty == false)
+ {
+ String path = file.getPathName();
+ packages.add(path.replace('/', '.'));
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new Error("Error visiting " + file, e);
+ }
+ }
+}
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSClassLoaderPolicy.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSClassLoaderPolicy.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSClassLoaderPolicy.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,276 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.classloader;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+import java.security.cert.Certificate;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.jar.Manifest;
+
+import org.jboss.classloader.spi.ClassLoaderPolicy;
+import org.jboss.classloader.spi.PackageInformation;
+import org.jboss.deployers.structure.spi.classloading.ExportAll;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSClassLoaderPolicy.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSClassLoaderPolicy extends ClassLoaderPolicy
+{
+ /** The log */
+ private static Logger log = Logger.getLogger(VFSClassLoaderPolicy.class);
+
+ /** The roots */
+ private VirtualFile[] roots;
+
+ /** Whether to export all */
+ private ExportAll exportAll;
+
+ /** The exported packages */
+ private String[] exportedPackages;
+
+ /**
+ * Create a new VFSClassLoaderPolicy.
+ *
+ * @param roots the roots
+ * @return the classloader policy
+ * @throws IllegalArgumentException for null roots
+ */
+ public static VFSClassLoaderPolicy createVFSClassLoaderPolicy(VirtualFile... roots)
+ {
+ return new VFSClassLoaderPolicy(roots);
+ }
+
+ /**
+ * Create a new VFSClassLoaderPolicy.
+ *
+ * @param roots the roots
+ * @throws IllegalArgumentException for null roots
+ */
+ public VFSClassLoaderPolicy(VirtualFile[] roots)
+ {
+ if (roots == null)
+ throw new IllegalArgumentException("Null roots");
+ for (VirtualFile root : roots)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root in " + Arrays.asList(roots));
+ }
+
+ this.roots = roots;
+ }
+
+ /**
+ * Get the exportAll.
+ *
+ * @return the exportAll.
+ */
+ public ExportAll isExportAll()
+ {
+ return exportAll;
+ }
+
+ /**
+ * Set the exportAll.
+ *
+ * @param exportAll the exportAll.
+ */
+ public void setExportAll(ExportAll exportAll)
+ {
+ this.exportAll = exportAll;
+ if (exportAll != null)
+ exportedPackages = determineAllPackages().toArray(new String[0]);
+ else
+ exportedPackages = null;
+ }
+
+ @Override
+ public String[] getPackageNames()
+ {
+ return exportedPackages;
+ }
+
+ /**
+ * Set the exportedPackages.
+ *
+ * @param exportedPackages the exportedPackages.
+ */
+ public void setExportedPackages(String[] exportedPackages)
+ {
+ this.exportedPackages = exportedPackages;
+ }
+
+ @Override
+ public URL getResource(String path)
+ {
+ VirtualFile child = findChild(path);
+ if (child != null)
+ {
+ try
+ {
+ return child.toURL();
+ }
+ catch (Exception ignored)
+ {
+ log.trace("Error determining URL for " + child, ignored);
+ return null;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public InputStream getResourceAsStream(String path)
+ {
+ VirtualFile child = findChild(path);
+ if (child != null)
+ {
+ try
+ {
+ return child.openStream();
+ }
+ catch (Exception ignored)
+ {
+ log.trace("Error opening stream for " + child, ignored);
+ return null;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void getResources(String name, Set<URL> urls) throws IOException
+ {
+ for (VirtualFile root : roots)
+ {
+ try
+ {
+ VirtualFile child = root.findChild(name);
+ urls.add(child.toURL());
+ }
+ catch (Exception ignored)
+ {
+ log.trace("Error getting resources for " + root, ignored);
+ }
+ }
+ }
+
+ /**
+ * Find a child from a path
+ *
+ * @param path the path
+ * @return the child if found in the roots
+ */
+ protected VirtualFile findChild(String path)
+ {
+ for (VirtualFile root : roots)
+ {
+ try
+ {
+ return root.findChild(path);
+ }
+ catch (Exception ignored)
+ {
+ // not found
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public PackageInformation getPackageInformation(String packageName)
+ {
+ String path = packageName.replace('.', '/');
+ VirtualFile pkge = findChild(path);
+ if (pkge == null)
+ return null;
+ try
+ {
+ Manifest manifest = VFSUtils.getManifest(pkge.getVFS());
+ return new PackageInformation(packageName, manifest);
+ }
+ catch (IOException ignored)
+ {
+ log.trace("Unable to retrieve manifest for " + pkge + " " + ignored.getMessage());
+ return null;
+ }
+ }
+
+ @Override
+ protected ProtectionDomain getProtectionDomain(String className, String path)
+ {
+ VirtualFile clazz = findChild(path);
+ if (clazz == null)
+ {
+ log.trace("Unable to determine class file for " + className);
+ return null;
+ }
+ try
+ {
+ VirtualFile root = clazz.getVFS().getRoot();
+ URL codeSourceURL = root.toURL();
+ Certificate[] certs = null; // TODO determine certificates
+ CodeSource cs = new CodeSource(codeSourceURL, certs);
+ PermissionCollection permissions = Policy.getPolicy().getPermissions(cs);
+ return new ProtectionDomain(cs, permissions);
+ }
+ catch (Exception e)
+ {
+ throw new Error("Error determining protection domain for " + clazz, e);
+ }
+ }
+
+ /**
+ * Determine all the packages
+ *
+ * @return the packages
+ * @throws IllegalArgumentException if there is no exportAll policy
+ */
+ protected Set<String> determineAllPackages()
+ {
+ PackageVisitor visitor = new PackageVisitor(exportAll);
+ for (VirtualFile root : roots)
+ {
+ try
+ {
+ root.visit(visitor);
+ }
+ catch (Exception e)
+ {
+ throw new Error("Error visiting " + root, e);
+ }
+ }
+ return visitor.getPackages();
+ }
+}
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSTopLevelClassLoaderSystemDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSTopLevelClassLoaderSystemDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/classloader/VFSTopLevelClassLoaderSystemDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.classloader;
+
+import java.util.Set;
+
+import org.jboss.deployers.plugins.classloading.AbstractTopLevelClassLoaderSystemDeployer;
+import org.jboss.deployers.plugins.classloading.Module;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.helpers.ClassPathVisitor;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSTopLevelClassLoaderSystemDeployer.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSTopLevelClassLoaderSystemDeployer extends AbstractTopLevelClassLoaderSystemDeployer
+{
+ @Override
+ protected VFSClassLoaderPolicy createTopLevelClassLoaderPolicy(DeploymentContext context, Module module) throws Exception
+ {
+ ClassPathVisitor visitor = new ClassPathVisitor();
+ visitor.visit(context);
+ Set<VirtualFile> roots = visitor.getClassPath();
+ VFSClassLoaderPolicy policy = new VFSClassLoaderPolicy(roots.toArray(new VirtualFile[roots.size()]));
+ policy.setExportAll(module.getExportAll());
+ // TODO more policy from "module"
+ return policy;
+ }
+
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/AbstractVFSDeployment.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/AbstractVFSDeployment.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/AbstractVFSDeployment.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.client;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.jboss.deployers.client.plugins.deployment.AbstractDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractVFSDeployment.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractVFSDeployment extends AbstractDeployment implements VFSDeployment
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 3992263833911364088L;
+
+ /** The root */
+ private VirtualFile root;
+
+ /**
+ * Get the vfs file name safely
+ *
+ * @param root the virutal file
+ * @return the name
+ */
+ static final String safeVirtualFileName(VirtualFile root)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root");
+ try
+ {
+ return root.toURI().toString();
+ }
+ catch (Exception e)
+ {
+ return root.getName();
+ }
+ }
+
+ /**
+ * For serialization
+ */
+ public AbstractVFSDeployment()
+ {
+ }
+
+ /**
+ * Create a new VFSDeployment.
+ *
+ * @param root the root
+ * @throws IllegalArgumentException for a null root
+ */
+ public AbstractVFSDeployment(VirtualFile root)
+ {
+ super(safeVirtualFileName(root));
+ this.root = root;
+ }
+
+ public VirtualFile getRoot()
+ {
+ return root;
+ }
+
+ @Override
+ public String getSimpleName()
+ {
+ return root.getPathName();
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ root = (VirtualFile) in.readObject();
+ }
+
+ /**
+ * @serialData root from {@link #getRoot()}
+ * @param out the output
+ * @throws IOException for any error
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ out.writeObject(root);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/DefaultVFSDeploymentFactory.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/DefaultVFSDeploymentFactory.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/client/DefaultVFSDeploymentFactory.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.client;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * DefaultVFSDeploymentFactory.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DefaultVFSDeploymentFactory extends VFSDeploymentFactory
+{
+ @Override
+ protected VFSDeployment newVFSDeployment(VirtualFile root)
+ {
+ return new AbstractVFSDeployment(root);
+ }
+
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.structure;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractVFSDeploymentContext.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractVFSDeploymentContext extends AbstractDeploymentContext implements VFSDeploymentContext
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4474515937180482776L;
+
+ /** The root virtual file */
+ private VirtualFile root;
+
+ /** The meta data location */
+ private VirtualFile metaDataLocation;
+
+ /** The class paths */
+ private List<VirtualFile> classPath;
+
+ /** The loader */
+ private transient VFSDeploymentResourceLoader loader;
+
+ /**
+ * Get the vfs file name safely
+ *
+ * @param root the virutal file
+ * @return the name
+ */
+ static final String safeVirtualFileName(VirtualFile root)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root");
+ try
+ {
+ return root.toURI().toString();
+ }
+ catch (Exception e)
+ {
+ return root.getName();
+ }
+ }
+
+ /**
+ * For serialization
+ */
+ public AbstractVFSDeploymentContext()
+ {
+ }
+
+ /**
+ * Create a new AbstractVFSDeploymentContext.
+ *
+ * @param root the virtual file
+ * @param relativePath the relative path
+ */
+ public AbstractVFSDeploymentContext(VirtualFile root, String relativePath)
+ {
+ super(safeVirtualFileName(root), root.getName(), relativePath);
+ this.root = root;
+ }
+
+ public VirtualFile getRoot()
+ {
+ return root;
+ }
+
+ public void setMetaDataPath(String path)
+ {
+ if (path == null)
+ setMetaDataLocation(null);
+ try
+ {
+ setMetaDataLocation(root.findChild(path));
+ }
+ catch (IOException e)
+ {
+ log.debug("Meta data path does not exist: root=" + root.getPathName() + " path=" + path);
+ }
+ }
+
+ public VirtualFile getMetaDataLocation()
+ {
+ return metaDataLocation;
+ }
+
+ public void setMetaDataLocation(VirtualFile location)
+ {
+ this.metaDataLocation = location;
+ }
+
+ public VirtualFile getMetaDataFile(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ try
+ {
+ // There isn't a metadata location so let's see whether the root matches.
+ if (metaDataLocation == null)
+ {
+ // It has to be a plain file
+ if (root != null && SecurityActions.isLeaf(root))
+ {
+ String fileName = root.getName();
+ if (fileName.equals(name))
+ return root;
+ }
+
+ // No match
+ return null;
+ }
+ // Look in the meta data location
+ VirtualFile result = metaDataLocation.findChild(name);
+ if (result != null)
+ {
+ log.trace("Found " + name + " in " + metaDataLocation.getName());
+ deployed();
+ }
+ return result;
+ }
+ catch (Exception e)
+ {
+ log.trace("Error retrieving meta data: " + name + " reason=" + e);
+ return null;
+ }
+ }
+
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix)
+ {
+ if (name == null && suffix == null)
+ throw new IllegalArgumentException("Null name and suffix");
+ try
+ {
+ // There isn't a metadata location so let's see whether the root matches.
+ // i.e. the top level is an xml
+ if (metaDataLocation == null)
+ {
+ // It has to be a plain file
+ if (root != null && SecurityActions.isLeaf(root))
+ {
+ String fileName = root.getName();
+ if (name != null && fileName.equals(name))
+ return Collections.singletonList(root);
+ if (suffix != null && fileName.endsWith(suffix))
+ return Collections.singletonList(root);
+ }
+
+ // No match
+ return Collections.emptyList();
+ }
+ // Look in the meta data location
+ List<VirtualFile> result = metaDataLocation.getChildren(new MetaDataMatchFilter(name, suffix));
+ if (result != null && result.isEmpty() == false)
+ {
+ log.trace("Found " + name + " in " + metaDataLocation.getName());
+ deployed();
+ }
+ return result;
+ }
+ catch (Exception e)
+ {
+ log.debug("Error retrieving meta data: name=" + name + " suffix=" + suffix, e);
+ return Collections.emptyList();
+ }
+ }
+
+ public VirtualFile getFile(String name)
+ {
+ return getResourceLoader().getFile(name);
+ }
+
+ public List<VirtualFile> getClassPath()
+ {
+ return classPath;
+ }
+
+ public void setClassPath(List<VirtualFile> paths)
+ {
+ this.classPath = paths;
+ if (log.isTraceEnabled() && paths != null)
+ log.trace("ClassPath for " + root.getPathName() + " is " + VFSUtils.getPathsString(paths));
+ }
+
+ @Override
+ public VFSDeploymentContext getTopLevel()
+ {
+ return (VFSDeploymentContext) super.getTopLevel();
+ }
+
+ @Override
+ public VFSDeploymentResourceLoader getResourceLoader()
+ {
+ if (loader != null)
+ return loader;
+
+ loader = new VFSDeploymentResourceLoaderImpl(getRoot());
+ return loader;
+ }
+
+ protected DeploymentUnit createDeploymentUnit()
+ {
+ return new AbstractVFSDeploymentUnit(this);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ root = (VirtualFile) in.readObject();
+ metaDataLocation = (VirtualFile) in.readObject();
+ classPath = (List) in.readObject();
+ }
+
+ /**
+ * @serialData root
+ * @serialData metaDataLocation
+ * @serialData classPath
+ * @param out the output
+ * @throws IOException for any error
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ out.writeObject(root);
+ out.writeObject(metaDataLocation);
+ out.writeObject(classPath);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.structure;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractVFSDeploymentUnit.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractVFSDeploymentUnit extends AbstractDeploymentUnit implements VFSDeploymentUnit
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3300229322654319315L;
+
+ /**
+ * For serialization
+ */
+ public AbstractVFSDeploymentUnit()
+ {
+ }
+
+ /**
+ * Create a new AbstractVFSDeploymentUnit.
+ *
+ * @param deploymentContext the deployment context
+ * @throws IllegalArgumentException for a null deployment context
+ */
+ public AbstractVFSDeploymentUnit(VFSDeploymentContext deploymentContext)
+ {
+ super(deploymentContext);
+ }
+
+ public VirtualFile getMetaDataFile(String name)
+ {
+ return getDeploymentContext().getMetaDataFile(name);
+ }
+
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix)
+ {
+ return getDeploymentContext().getMetaDataFiles(name, suffix);
+ }
+
+ @Override
+ public VFSDeploymentResourceLoader getResourceLoader()
+ {
+ return getDeploymentContext().getResourceLoader();
+ }
+
+ public VirtualFile getFile(String path)
+ {
+ return getDeploymentContext().getFile(path);
+ }
+
+ public VirtualFile getRoot()
+ {
+ return getDeploymentContext().getRoot();
+ }
+
+ public List<VirtualFile> getClassPath()
+ {
+ return getDeploymentContext().getClassPath();
+ }
+
+ public void setClassPath(List<VirtualFile> classPath)
+ {
+ getDeploymentContext().setClassPath(classPath);
+ }
+
+ @Override
+ public VFSDeploymentUnit getParent()
+ {
+ return (VFSDeploymentUnit) super.getParent();
+ }
+
+ @Override
+ public VFSDeploymentUnit getTopLevel()
+ {
+ return (VFSDeploymentUnit) super.getTopLevel();
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<VFSDeploymentUnit> getVFSChildren()
+ {
+ return (List) super.getChildren();
+ }
+
+ @Override
+ protected VFSDeploymentContext getDeploymentContext()
+ {
+ return (VFSDeploymentContext) super.getDeploymentContext();
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ }
+
+ /**
+ * @param out the output
+ * @throws IOException for any error
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/MetaDataMatchFilter.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/MetaDataMatchFilter.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/MetaDataMatchFilter.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.structure;
+
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilterWithAttributes;
+import org.jboss.virtual.VisitorAttributes;
+
+/**
+ * Matches meta data
+ *
+ * @author adrian at jboss.org
+ * @version $Revision: 44223 $
+ */
+public class MetaDataMatchFilter implements VirtualFileFilterWithAttributes
+{
+ /** The name */
+ private String name;
+
+ /** The suffix */
+ private String suffix;
+
+ /** The attributes */
+ private VisitorAttributes attributes;
+
+ /**
+ * Create a new MetaDataMatchFilter.
+ * using {@link VisitorAttributes#LEAVES_ONLY}
+ *
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ public MetaDataMatchFilter(String name, String suffix)
+ {
+ this(name, suffix, null);
+ }
+
+ /**
+ * Create a new MetaDataMatchFilter.
+ *
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @param attributes the attributes, pass null to use {@link VisitorAttributes#LEAVES_ONLY}
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ public MetaDataMatchFilter(String name, String suffix, VisitorAttributes attributes)
+ {
+ if (name == null && suffix == null)
+ throw new IllegalArgumentException("Null name and suffix");
+ this.name = name;
+ this.suffix = suffix;
+ if (attributes == null)
+ attributes = VisitorAttributes.LEAVES_ONLY;
+ this.attributes = attributes;
+ }
+
+ public VisitorAttributes getAttributes()
+ {
+ return attributes;
+ }
+
+ public boolean accepts(VirtualFile file)
+ {
+ String fileName = file.getName();
+ if (name != null && fileName.equals(name))
+ return true;
+ if (suffix != null)
+ return fileName.endsWith(suffix);
+ return false;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/SecurityActions.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/SecurityActions.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/SecurityActions.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.structure;
+
+import java.io.IOException;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 60921 $
+ */
+public class SecurityActions
+{
+ /**
+ * Actions for File access
+ */
+ interface FileActions
+ {
+ FileActions PRIVILEGED = new FileActions()
+ {
+ public Boolean isLeaf(final VirtualFile f) throws IOException
+ {
+ try
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>()
+ {
+ public Boolean run() throws Exception
+ {
+ return f.isLeaf();
+ }
+ });
+ }
+ catch(PrivilegedActionException e)
+ {
+ Exception ex = e.getException();
+ if( ex instanceof IOException )
+ throw (IOException) ex;
+ else if( ex instanceof RuntimeException )
+ throw (RuntimeException) ex;
+ else
+ throw new UndeclaredThrowableException(ex);
+ }
+ }
+ };
+
+ FileActions NON_PRIVILEGED = new FileActions()
+ {
+ public Boolean isLeaf(VirtualFile f) throws IOException
+ {
+ return f.isLeaf();
+ }
+
+ };
+
+ public Boolean isLeaf(VirtualFile f) throws IOException;
+ }
+
+ static boolean isLeaf(VirtualFile f) throws IOException
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if( sm != null )
+ return FileActions.PRIVILEGED.isLeaf(f);
+ else
+ return FileActions.NON_PRIVILEGED.isLeaf(f);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/StructureDeployerWrapper.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/StructureDeployerWrapper.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/StructureDeployerWrapper.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,116 @@
+/*
+* 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.structure;
+
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * StructureDeployerWrapper.<p>
+ *
+ * To avoid any problems with error handling by the deployers.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class StructureDeployerWrapper implements StructureDeployer
+{
+ /** The log */
+ private Logger log;
+
+ /** The structure deployer */
+ private StructureDeployer deployer;
+
+ /**
+ * Create a new StructureDeployerWrapper.
+ *
+ * @param deployer the deployer
+ */
+ public StructureDeployerWrapper(StructureDeployer deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Null deployer");
+ this.deployer = deployer;
+ log = Logger.getLogger(deployer.getClass());
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ if (file == null)
+ throw new IllegalArgumentException("Null file");
+
+ try
+ {
+ boolean result = deployer.determineStructure(root, parent, file, metaData, deployers);
+ if (log.isTraceEnabled())
+ {
+ if (result == false)
+ log.trace("Not recognised: " + file.getName());
+ else
+ log.trace("Recognised: " + file.getName());
+ }
+ return result;
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error during determineStructure: " + file.getName(), t);
+ return false;
+ }
+ }
+
+ public int getRelativeOrder()
+ {
+ return deployer.getRelativeOrder();
+ }
+
+ public void setRelativeOrder(int order)
+ {
+ deployer.setRelativeOrder(order);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ return true;
+ if (obj == null || obj instanceof StructureDeployer == false)
+ return false;
+ if (obj instanceof StructureDeployerWrapper)
+ obj = ((StructureDeployerWrapper) obj).deployer;
+ return deployer.equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return deployer.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return deployer.toString();
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSDeploymentResourceLoaderImpl.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSDeploymentResourceLoaderImpl.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSDeploymentResourceLoaderImpl.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.structure;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Vector;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSDeploymentResourceLoader.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSDeploymentResourceLoaderImpl implements VFSDeploymentResourceLoader
+{
+ /** The deployment resource loader */
+ private VirtualFile root;
+
+ /**
+ * Create a new VFSDeploymentResourceLoader.
+ *
+ * @param root the root
+ * @throws IllegalArgumentException for a null root
+ */
+ public VFSDeploymentResourceLoaderImpl(VirtualFile root)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root");
+ this.root = root;
+ }
+
+ public VirtualFile getFile(String path)
+ {
+ try
+ {
+ VirtualFile child = root.findChild(path);
+ return child;
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+
+ public URL getResource(String name)
+ {
+ try
+ {
+ VirtualFile child = root.findChild(name);
+ return child.toURL();
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ catch (MalformedURLException e)
+ {
+ return null;
+ }
+ catch (IOException e)
+ {
+ return null;
+ }
+ }
+
+ public Enumeration<URL> getResources(String name) throws IOException
+ {
+ try
+ {
+ VirtualFile child = root.findChild(name);
+ Vector<URL> vector = new Vector<URL>();
+ vector.add(child.toURL());
+ return vector.elements();
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ catch (MalformedURLException e)
+ {
+ return null;
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,219 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.structure;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.Ordered;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
+import org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSStructuralDeployersImpl.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructuralDeployersImpl extends AbstractStructuralDeployers implements VFSStructuralDeployers
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(VFSStructuralDeployersImpl.class);
+
+ /** The deployers */
+ private Set<StructureDeployer> structureDeployers = new TreeSet<StructureDeployer>(Ordered.COMPARATOR);
+
+ /**
+ * Create a new VFSStructuralDeployers.
+ */
+ public VFSStructuralDeployersImpl()
+ {
+ }
+
+ /**
+ * Create a new VFSStructurealDeployers.
+ *
+ * @param structureDeployers the given deployers
+ * @throws IllegalArgumentException for null deployers
+ */
+ public VFSStructuralDeployersImpl(Set<StructureDeployer> structureDeployers)
+ {
+ setDeployers(structureDeployers);
+ }
+
+ /**
+ * Get the structureDeployers.
+ *
+ * @return the structureDeployers.
+ */
+ public Set<StructureDeployer> getDeployers()
+ {
+ return structureDeployers;
+ }
+
+ /**
+ * Set the structureDeployers.
+ *
+ * @param deployers the structureDeployers.
+ * @throws IllegalArgumentException for null deployers
+ */
+ public void setDeployers(Set<StructureDeployer> deployers)
+ {
+ if (deployers == null)
+ throw new IllegalArgumentException("Null deployers");
+
+ // Remove all the old deployers that are not in the new set
+ HashSet<StructureDeployer> oldDeployers = new HashSet<StructureDeployer>(structureDeployers);
+ oldDeployers.removeAll(deployers);
+ for (StructureDeployer deployer : oldDeployers)
+ removeDeployer(deployer);
+
+ // Add all the new deployers that were not already present
+ HashSet<StructureDeployer> newDeployers = new HashSet<StructureDeployer>(deployers);
+ newDeployers.removeAll(structureDeployers);
+ for (StructureDeployer deployer : newDeployers)
+ addDeployer(deployer);
+ }
+
+ /**
+ * Add a structure deployer
+ *
+ * @param deployer the deployer
+ */
+ public synchronized void addDeployer(StructureDeployer deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Null deployer");
+ structureDeployers.add(new StructureDeployerWrapper(deployer));
+ log.debug("Added structure deployer " + deployer);
+ }
+
+ /**
+ * Remove a structure deployer
+ *
+ * @param deployer the deployer
+ */
+ public synchronized void removeDeployer(StructureDeployer deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Null deployer");
+ structureDeployers.remove(deployer);
+ log.debug("Removed structure deployer " + deployer);
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData structureMetaData)
+ {
+ StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
+ boolean result = doDetermineStructure(root, parent, file, structure);
+ if (result)
+ {
+ String relativePath = AbstractStructureDeployer.getRelativePath(parent, file);
+
+ // Something said it recognised it
+ ContextInfo recognised = structure.getContext("");
+ if (recognised == null)
+ throw new IllegalStateException("Something recognised the deployment, but there is no context? " + file);
+
+ // Create the context in the parent structure
+ ContextInfo parentContext;
+ String metaDataPath = recognised.getMetaDataPath();
+ if (metaDataPath == null)
+ parentContext = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
+ else
+ parentContext = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());
+
+ structureMetaData.addContext(parentContext);
+ MutableAttachments attachments = (MutableAttachments) parentContext.getPredeterminedManagedObjects();
+ attachments.addAttachment(StructureMetaData.class, structure);
+ }
+ return result;
+ }
+
+ /**
+ * Determine the structure
+ *
+ * @param root the root file
+ * @param parent the parent file
+ * @param file the file
+ * @param structureMetaData the structure metadata
+ * @return true when recognised
+ */
+ protected boolean doDetermineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData structureMetaData)
+ {
+ StructureDeployer[] theDeployers;
+ synchronized (this)
+ {
+ if (structureDeployers.isEmpty())
+ throw new IllegalStateException("No structure deployers");
+
+ theDeployers = structureDeployers.toArray(new StructureDeployer[structureDeployers.size()]);
+ }
+
+ boolean trace = log.isTraceEnabled();
+ if (trace)
+ log.trace("Determining structure for " + file.getName() + " deployers=" + Arrays.asList(theDeployers));
+
+
+ boolean result = false;
+ for (StructureDeployer deployer : theDeployers)
+ {
+ if (deployer.determineStructure(root, parent, file, structureMetaData, this))
+ {
+ if (trace)
+ log.trace(file.getName() + " recognised by " + deployer);
+ result = true;
+ break;
+ }
+ }
+ if (result == false && trace)
+ log.trace(file.getName() + " not recognised");
+ return result;
+ }
+
+ @Override
+ protected void determineStructure(Deployment deployment, StructureMetaData structure) throws Exception
+ {
+ if (deployment instanceof VFSDeployment == false)
+ throw new DeploymentException("Structure can only be determined for VFSDeployments " + deployment);
+
+ VFSDeployment vfsDeployment = (VFSDeployment) deployment;
+
+ VirtualFile root = vfsDeployment.getRoot();
+ if (root == null)
+ throw new IllegalStateException("Deployment has no root " + deployment);
+ if (doDetermineStructure(root, null, root, structure) == false)
+ throw new DeploymentException("No deployer recognised the structure of " + deployment.getName());
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructureBuilder.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructureBuilder.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/VFSStructureBuilder.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.structure;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
+
+/**
+ * VFSStructureBuilder.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructureBuilder extends AbstractStructureBuilder
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(VFSStructureBuilder.class);
+
+ protected DeploymentContext createRootDeploymentContext(Deployment deployment) throws Exception
+ {
+ if (deployment instanceof VFSDeployment)
+ {
+ VFSDeployment vfsDeployment = (VFSDeployment) deployment;
+ return new AbstractVFSDeploymentContext(vfsDeployment.getRoot(), "");
+ }
+ return super.createRootDeploymentContext(deployment);
+ }
+
+ protected DeploymentContext createChildDeploymentContext(DeploymentContext parent, ContextInfo child) throws Exception
+ {
+ if (parent instanceof VFSDeploymentContext)
+ {
+ VFSDeploymentContext vfsParent = (VFSDeploymentContext) parent;
+ String path = child.getPath();
+ try
+ {
+ VirtualFile parentFile = vfsParent.getRoot();
+ VirtualFile file = parentFile.findChild(path);
+ return new AbstractVFSDeploymentContext(file, path);
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Unable to determine child " + path + " from parent " + vfsParent.getRoot().getName(), t);
+ }
+ }
+ return super.createChildDeploymentContext(parent, child);
+ }
+
+ protected void applyContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ super.applyContextInfo(context, contextInfo);
+
+ if (context instanceof VFSDeploymentContext)
+ {
+ boolean trace = log.isTraceEnabled();
+ log.trace("Apply context: " + context.getName() + " " + contextInfo);
+
+ VFSDeploymentContext vfsContext = (VFSDeploymentContext) context;
+ String metaDataPath = contextInfo.getMetaDataPath();
+ if (metaDataPath != null)
+ vfsContext.setMetaDataPath(contextInfo.getMetaDataPath());
+
+ boolean classPathHadVF = false;
+
+ List<ClassPathEntry> classPathEntries = contextInfo.getClassPath();
+ VFSDeploymentContext top = vfsContext.getTopLevel();
+ VirtualFile root = top.getRoot();
+ List<VirtualFile> classPath = new ArrayList<VirtualFile>();
+
+ if (classPathEntries != null)
+ {
+ for (ClassPathEntry entry : classPathEntries)
+ {
+ if (trace)
+ log.trace("Resolving classpath entry " + entry + " for " + context.getName());
+ String suffixes = entry.getSuffixes();
+ VirtualFile child;
+ if (entry.getPath().length() == 0)
+ child = root;
+ else
+ {
+ try
+ {
+ child = root.findChild(entry.getPath());
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Unable to find class path entry " + entry + " from " + root.getName(), t);
+ }
+ }
+ if (suffixes == null)
+ {
+ classPath.add(child);
+ if (classPathHadVF == false)
+ classPathHadVF = child.equals(root);
+ }
+ else
+ {
+ String[] suffs = suffixes.split(",");
+ SuffixMatchFilter filter = new SuffixMatchFilter(Arrays.asList(suffs), VisitorAttributes.DEFAULT);
+ List<VirtualFile> matches = child.getChildren(filter);
+ if( matches != null )
+ {
+ classPath.addAll(matches);
+ if (trace)
+ log.trace("Added classpath matches: " + matches);
+ // Process any Manifest Class-Path refs
+ for (VirtualFile file : matches)
+ {
+ VFSUtils.addManifestLocations(file, classPath);
+ if (classPathHadVF == false)
+ classPathHadVF = file.equals(root);
+ }
+ }
+ }
+ }
+ }
+
+ VirtualFile file = vfsContext.getRoot();
+ if (classPathHadVF == false && SecurityActions.isLeaf(file) == false)
+ VFSUtils.addManifestLocations(file, classPath);
+
+ if (classPath.isEmpty() == false)
+ vfsContext.setClassPath(classPath);
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,88 @@
+/*
+* 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.structure.explicit;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+/**
+ * A structural deployer that looks for a jboss-structure.xml descriptor as
+ * the defining structure.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class DeclaredStructure extends AbstractStructureDeployer
+{
+ /**
+ * Set the relative order to 0 by default.
+ */
+ public DeclaredStructure()
+ {
+ setRelativeOrder(0);
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ try
+ {
+ boolean trace = log.isTraceEnabled();
+ if (isLeaf(file) == false)
+ {
+ boolean isJBossStructure = false;
+ if (trace)
+ log.trace(file + " is not a leaf");
+ try
+ {
+ VirtualFile jbossStructure = file.findChild("META-INF/jboss-structure.xml");
+ log.trace("... context has a META-INF/jboss-structure.xml");
+ URL url = jbossStructure.toURL();
+ UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
+ Unmarshaller unmarshaller = factory.newUnmarshaller();
+ StructureMetaDataObjectFactory ofactory = new StructureMetaDataObjectFactory();
+ unmarshaller.unmarshal(url.toString(), ofactory, metaData);
+ isJBossStructure = true;
+ }
+ catch (IOException e)
+ {
+ if (trace)
+ log.trace("... no META-INF/jboss-structure.xml.");
+ }
+ if (trace)
+ log.trace(file + " isJBossStructure: " + isJBossStructure);
+ return isJBossStructure;
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Error determining structure: " + file.getName(), e);
+ }
+ return false;
+ }
+}
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
___________________________________________________________________
Name: svn:executable
+
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.structure.explicit;
+
+import java.util.ArrayList;
+
+import org.jboss.deployers.plugins.structure.ClassPathEntryImpl;
+import org.jboss.deployers.plugins.structure.ContextInfoImpl;
+import org.jboss.deployers.plugins.structure.StructureMetaDataImpl;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * An ObjectModelFactory for the jboss-structure.xml descriptor.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class StructureMetaDataObjectFactory implements ObjectModelFactory
+{
+ public StructureMetaDataImpl newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ StructureMetaDataImpl metaData = null;
+ if (root != null)
+ metaData = (StructureMetaDataImpl) root;
+ else
+ metaData = new StructureMetaDataImpl();
+
+ return metaData;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ public Object newChild(StructureMetaDataImpl parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("context"))
+ child = new ContextInfoImpl("", null);
+ return child;
+ }
+
+ public Object newChild(ContextInfoImpl parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("classpath"))
+ child = new ArrayList<ClassPathEntry>();
+ else if (localName.equals("path"))
+ {
+ String path = attrs.getValue("name");
+ parent.setPath(path);
+ }
+ else if (localName.equals("metaDataPath"))
+ {
+ String path = attrs.getValue("name");
+ parent.setMetaDataPath(path);
+ }
+ return child;
+ }
+ public Object newChild(ArrayList<ClassPathEntry> parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if( localName.equals("path") )
+ {
+ String name = attrs.getValue("name");
+ String suffixes = attrs.getValue("suffixes");
+ ClassPathEntry path = new ClassPathEntryImpl(name, suffixes);
+ parent.add(path);
+ }
+ return child;
+ }
+
+ public void addChild(StructureMetaDataImpl parent, ContextInfoImpl context, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.addContext(context);
+ }
+
+ public void addChild(ContextInfoImpl context, ArrayList<ClassPathEntry> classpath, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ context.setClassPath(classpath);
+ }
+}
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/StructureMetaDataObjectFactory.java
___________________________________________________________________
Name: svn:executable
+
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.structure.file;
+
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * FileStructure is a simple suffix recognition structure deployer.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class FileStructure extends AbstractStructureDeployer
+{
+ /** The file suffixes */
+ private static Set<String> fileSuffixes = new CopyOnWriteArraySet<String>();
+
+ // Initialise known suffixes
+ static
+ {
+ fileSuffixes.add("-service.xml");
+ fileSuffixes.add("-beans.xml");
+ fileSuffixes.add("-ds.xml");
+ fileSuffixes.add("-aop.xml");
+ }
+
+ /**
+ * Create a new FileStructure.
+ */
+ public FileStructure()
+ {
+ }
+
+ /**
+ * Create a new FileStructure.
+ *
+ * @param suffixes the recognised suffixes
+ * @throws IllegalArgumentException for null suffixes
+ */
+ public FileStructure(Set<String> suffixes)
+ {
+ if (suffixes == null)
+ throw new IllegalArgumentException("Null suffixes");
+ fileSuffixes.clear();
+ fileSuffixes.addAll(suffixes);
+ }
+
+ /**
+ * Gets the list of suffixes recognised as files
+ *
+ * @return the list of suffixes
+ */
+ public Set<String> getSuffixes()
+ {
+ return fileSuffixes;
+ }
+
+
+ /**
+ * Add a file suffix
+ *
+ * @param suffix the suffix
+ * @return true when added
+ * @throws IllegalArgumentException for a null suffix
+ */
+ public static boolean addFileSuffix(String suffix)
+ {
+ if (suffix == null)
+ throw new IllegalArgumentException("Null suffix");
+ return fileSuffixes.add(suffix);
+ }
+
+ /**
+ * Remove a file suffix
+ *
+ * @param suffix the suffix
+ * @return true when removed
+ * @throws IllegalArgumentException for a null suffix
+ */
+ public static boolean removeFileSuffix(String suffix)
+ {
+ if (suffix == null)
+ throw new IllegalArgumentException("Null suffix");
+ return fileSuffixes.remove(suffix);
+ }
+
+ /**
+ * Whether this is an archive
+ *
+ * @param name the name
+ * @return true when an archive
+ * @throws IllegalArgumentException for a null name
+ */
+ public static boolean isKnownFile(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+
+ int index = name.lastIndexOf('-');
+ if (index == -1)
+ return false;
+ String suffix = name.substring(index);
+ return fileSuffixes.contains(suffix);
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ ContextInfo context = null;
+ try
+ {
+ boolean trace = log.isTraceEnabled();
+ if (isLeaf(file) == true)
+ {
+ boolean isFile = false;
+ if( trace )
+ log.trace(file + " is not a leaf");
+ // See if this is a top-level by checking the parent
+ if (isTopLevel(parent) == false)
+ {
+ if (isKnownFile(file.getName()) == false)
+ {
+ if (trace)
+ log.trace("... no - it is not a top level file and not a known name");
+ }
+ else
+ {
+ if (trace)
+ log.trace("... ok - not a top level file but it is a known name");
+ isFile = true;
+ }
+ }
+ else
+ {
+ if (trace)
+ log.trace("... ok - it is a top level file");
+ isFile = true;
+ }
+
+ // Create a context info for this file
+ context = createContext(file, null, metaData);
+ // There are no subdeployments for files
+ if (trace)
+ log.trace(file + " isFile: " + isFile);
+ return isFile;
+ }
+ else
+ {
+ if (trace)
+ log.trace("... no - not a file.");
+ return false;
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Error determining structure: " + file.getName(), e);
+ if (context != null)
+ metaData.removeContext(context);
+ return false;
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,140 @@
+/*
+* 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.structure.jar;
+
+import java.io.IOException;
+import java.util.Set;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+
+/**
+ * JARStructure.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JARStructure extends AbstractStructureDeployer
+{
+ /**
+ * Create a new JARStructure. with the default suffixes
+ */
+ public JARStructure()
+ {
+ this(null);
+ }
+
+ /**
+ * Sets the default relative order 10000.
+ *
+ * @param suffixes the suffixes
+ */
+ public JARStructure(Set<String> suffixes)
+ {
+ if (suffixes != null)
+ setSuffixes(suffixes);
+ setRelativeOrder(10000);
+ }
+
+ /**
+ * Gets the set of suffixes recognised as jars
+ *
+ * @return the set of suffixes
+ */
+ public Set<String> getSuffixes()
+ {
+ return JarUtils.getSuffixes();
+ }
+ /**
+ * Gets the set of suffixes recognised as jars
+ *
+ * @param suffixes - the set of suffixes
+ */
+ public void setSuffixes(Set<String> suffixes)
+ {
+ JarUtils.setJarSuffixes(suffixes);
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ ContextInfo context = null;
+ try
+ {
+ if (isLeaf(file) == false)
+ {
+ // For non top level directories that don't look like jars
+ // we require a META-INF otherwise each subdirectory would be a subdeployment
+ if (JarUtils.isArchive(file.getName()) == false)
+ {
+ if (isTopLevel(parent) == false)
+ {
+ try
+ {
+ file.findChild("META-INF");
+ log.trace("... ok - non top level directory has a META-INF subdirectory");
+ }
+ catch (IOException e)
+ {
+ log.trace("... no - doesn't look like a jar and no META-INF subdirectory.");
+ return false;
+ }
+ }
+ else
+ {
+ log.trace("... ok - doesn't look like a jar but it is a top level directory.");
+ }
+ }
+ }
+ else if (JarUtils.isArchive(file.getName()))
+ {
+ log.trace("... ok - its an archive or at least pretending to be.");
+ }
+ else
+ {
+ log.trace("... no - not a directory or an archive.");
+ return false;
+ }
+
+ // Create a context for this jar file with META-INF as the location for metadata
+ context = createContext(file, "META-INF", metaData);
+
+ // The classpath is the root
+ super.addClassPath(root, file, true, true, context);
+
+ // We try all the children as potential subdeployments
+ addAllChildren(root, file, metaData, deployers);
+ return true;
+ }
+ catch (Exception e)
+ {
+ log.warn("Error determining structure: " + file.getName(), e);
+ // Remove the invalid context
+ if( context != null )
+ metaData.removeContext(context);
+ return false;
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.structure.war;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
+
+/**
+ * WARStructure.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WARStructure extends AbstractStructureDeployer
+{
+ /** The default filter which allows jars/jar directories */
+ public static final VirtualFileFilter DEFAULT_WEB_INF_LIB_FILTER = new SuffixMatchFilter(".jar", VisitorAttributes.DEFAULT);
+
+ /** The web-inf/lib filter */
+ private VirtualFileFilter webInfLibFilter = DEFAULT_WEB_INF_LIB_FILTER;
+
+ /**
+ * Sets the default relative order 1000.
+ *
+ */
+ public WARStructure()
+ {
+ setRelativeOrder(1000);
+ }
+
+ /**
+ * Get the webInfLibFilter.
+ *
+ * @return the webInfLibFilter.
+ */
+ public VirtualFileFilter getWebInfLibFilter()
+ {
+ return webInfLibFilter;
+ }
+
+ /**
+ * Set the webInfLibFilter.
+ *
+ * @param webInfLibFilter the webInfLibFilter.
+ * @throws IllegalArgumentException for a null filter
+ */
+ public void setWebInfLibFilter(VirtualFileFilter webInfLibFilter)
+ {
+ if (webInfLibFilter == null)
+ throw new IllegalArgumentException("Null filter");
+ this.webInfLibFilter = webInfLibFilter;
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ ContextInfo context = null;
+ try
+ {
+ if (isLeaf(file) == false)
+ {
+ // We require either a WEB-INF or the name ends in .war
+ if (file.getName().endsWith(".war") == false)
+ {
+ try
+ {
+ file.findChild("WEB-INF");
+ log.trace("... ok - directory has a WEB-INF subdirectory");
+ }
+ catch (IOException e)
+ {
+ log.trace("... no - doesn't look like a war and no WEB-INF subdirectory.");
+ return false;
+ }
+ }
+ else
+ {
+ log.trace("... ok - name ends in .war.");
+ }
+
+ // Create a context for this war file with WEB-INF as the location for metadata
+ context = createContext(file, "WEB-INF", metaData);
+
+ // Add the war manifest classpath entries
+ addClassPath(root, file, false, true, context);
+ try
+ {
+ // The classpath is WEB-INF/classes
+ VirtualFile classes = file.findChild("WEB-INF/classes");
+ // Add the war manifest classpath entries
+ addClassPath(root, classes, true, false, context);
+ }
+ catch(IOException e)
+ {
+ log.trace("No WEB-INF/classes for: " + file.getPathName());
+ }
+ // and the top level jars in WEB-INF/lib
+ try
+ {
+ VirtualFile webinfLib = file.findChild("WEB-INF/lib");
+ List<VirtualFile> archives = webinfLib.getChildren(webInfLibFilter);
+ for (VirtualFile jar : archives)
+ addClassPath(root, jar, true, true, context);
+ }
+ catch (IOException ignored)
+ {
+ log.trace("No WEB-INF/lib for: " + file.getPathName());
+ }
+
+ // There are no subdeployments for wars
+ return true;
+ }
+ else
+ {
+ log.trace("... no - not a directory or an archive.");
+ return false;
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Error determining structure: " + file.getName(), e);
+ // Remove the invalid context
+ if (context != null)
+ metaData.removeContext(context);
+ return false;
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/my-beans.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/my-beans.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/my-beans.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="Test" class="org.jboss.test.deployers.vfs.deployer.bean.support.Simple"/>
+</deployment>
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/META-INF/my-beans.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/META-INF/my-beans.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/bean/toplevel/test.jar/META-INF/my-beans.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="Test" class="org.jboss.test.deployers.vfs.deployer.bean.support.Simple"/>
+</deployment>
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/dummy/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/dummy/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/dummy/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/jaxp/somebean.jbean
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/jaxp/somebean.jbean (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/jaxp/somebean.jbean 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<somebean name="bean1" version="1.0" />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/exact/jboss-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/exact/jboss-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/exact/jboss-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata-nometainf.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata-nometainf.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata-nometainf.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/1-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/1-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/1-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/2-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/2-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/2-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/partial/mydb-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/partial/mydb-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/metadata/toplevel/partial/mydb-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/META-INF/application.properties
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/META-INF/application.properties (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/META-INF/application.properties 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,9 @@
+service1=module-service.xml
+bean1ejb=module-bean1ejb.jar
+bean2=module-bean2.ejb3
+client1=module-client1.jar
+mbean1=module-mbean1.sar
+mcf1-ds=module-mcf1-ds.xml
+rar1=module-mcf1.rar
+war1=module-web1.war
+bean2ejb=subdir/relative.jar
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/lib0.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/lib0.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/lib/lib0.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean1ejb.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean1ejb.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean1ejb.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean2.ejb3/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean2.ejb3/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-bean2.ejb3/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-client1.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-client1.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-client1.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/META-INF/jboss-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/META-INF/jboss-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/META-INF/jboss-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<server />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/extensions.aop/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/extensions.aop/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/extensions.aop/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean.sar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean.sar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean.sar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean2-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean2-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mbean1.sar/submbean2-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<server />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<datasource />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1.rar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1.rar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-mcf1.rar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<service/>
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-web1.war/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-web1.war/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/module-web1.war/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean1ejb.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean1ejb.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean1ejb.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean2.ejb3/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean2.ejb3/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-bean2.ejb3/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-client1.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-client1.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-client1.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mbean1.sar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mbean1.sar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mbean1.sar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<datasource />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1.rar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1.rar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-mcf1.rar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<service />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-web1.war/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-web1.war/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/notinapp-web1.war/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/relative.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/relative.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/complexwithappxml.ear/subdir/relative.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/META-INF/application.properties
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/META-INF/application.properties (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/META-INF/application.properties 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,8 @@
+service1=module-service.xml
+bean1ejb=module-bean1ejb.jar
+bean2=module-bean2.ejb3
+client1=module-client1.jar
+mbean1=module-mbean1.sar
+mcf1-ds=module-mcf1-ds.xml
+rar1=module-mcf1.rar
+war1=module-web1.war
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/lib0.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/lib0.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/lib/lib0.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean1ejb.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean1ejb.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean1ejb.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean2.ejb3/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean2.ejb3/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-bean2.ejb3/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-client1.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-client1.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-client1.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mbean1.sar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mbean1.sar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mbean1.sar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<datasource />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1.rar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1.rar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-mcf1.rar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<service/>
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-web1.war/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-web1.war/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/module-web1.war/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean1ejb.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean1ejb.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean1ejb.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean2.ejb3/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean2.ejb3/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-bean2.ejb3/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-client1.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-client1.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-client1.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mbean1.sar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mbean1.sar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mbean1.sar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1-ds.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1-ds.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1-ds.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<datasource />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1.rar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1.rar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-mcf1.rar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+<service />
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-web1.war/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-web1.war/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/ear/simplewithappxml.ear/notinapp-web1.war/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,22 @@
+<structure>
+ <context>
+ <path name=""/>
+ <metaDataPath name="META-INF"/>
+ <classpath>
+ <path name="jar1.jar"/>
+ <path name="lib-dir" suffixes=".jar"/>
+ </classpath>
+ </context>
+ <context>
+ <path name="sub.jar"/>
+ <metaDataPath name="META-INF" />
+ </context>
+ <context>
+ <path name="x.war"/>
+ <metaDataPath name="WEB-INF"/>
+ <classpath>
+ <path name="x.war/WEB-INF/classes"/>
+ <path name="x.war/WEB-INF/lib" suffixes=".jar"/>
+ </classpath>
+ </context>
+</structure>
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/META-INF/jboss-structure.xml
___________________________________________________________________
Name: svn:executable
+
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/cp-mf.jar/empty
===================================================================
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/jar1.jar/empty
===================================================================
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar0.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar0.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar0.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/META-INF/MANIFEST.MF (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/lib-dir/jar2.jar/META-INF/MANIFEST.MF 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+Class-Path: bad.jar ../cp-mf.jar
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/META-INF/MANIFEST.MF (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/sub.jar/META-INF/MANIFEST.MF 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+Class-Path: cp-mf.jar
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/classes/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/classes/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/classes/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/w0.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/w0.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/explicit/complex.deployer/x.war/WEB-INF/lib/w0.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/directory/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/directory/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/directory/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/simple/simple-service.xml
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/simple/simple-service.xml (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/simple/simple-service.xml 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/unknown/test-unknown.xml
===================================================================
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/file/unknown/unknown.xml
===================================================================
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.jar
===================================================================
(Binary files differ)
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.zip
===================================================================
(Binary files differ)
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/indirectory/archive.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.jar
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.jar (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.jar 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.zip
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.zip (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/notanarchive/NotAnArchive.zip 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple1.txt
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple1.txt (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple1.txt 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple2.txt
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple2.txt (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/simple/simple2.txt 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/META-INF/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/META-INF/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirhasmetainf/sub/META-INF/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/sub.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/sub.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirisajar/sub.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/sub/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/sub/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/jar/subdirnotajar/sub/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directory.war/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directory.war/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directory.war/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorynotawar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorynotawar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorynotawar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/classes/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/classes/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/classes/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j0.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j0.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j0.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j1.jar/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j1.jar/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/WEB-INF/lib/j1.jar/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/directorywithwebinf/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/notanarchive/notanarchive.war
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/notanarchive/notanarchive.war (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/notanarchive/notanarchive.war 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/simple/simple.war
===================================================================
(Binary files differ)
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structure/war/simple/simple.war
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child1
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child1 (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child1 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child2
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child2 (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child2 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child3
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child3 (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testManyChildren/child3 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/META-INF/empty
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/META-INF/empty (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testMetaDataLocation/META-INF/empty 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testOneChild/child1
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testOneChild/child1 (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testOneChild/child1 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimple
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimple (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimple 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimpleWithAttachment
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimpleWithAttachment (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/resources/tests/structurebuilder/predetermined/testSimpleWithAttachment 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1 @@
+empty
\ No newline at end of file
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BaseDeployersVFSTest.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BaseDeployersVFSTest.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/BaseDeployersVFSTest.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,162 @@
+/*
+* 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;
+
+import java.net.URL;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.structure.spi.StructuralDeployers;
+import org.jboss.deployers.structure.spi.StructureBuilder;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+
+/**
+ * BaseDeployersVFSTest.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class BaseDeployersVFSTest extends AbstractDeployerTest
+{
+ public BaseDeployersVFSTest(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public URL getResource(String path)
+ {
+ URL url = super.getResource(path);
+ assertNotNull("Resource not found: " + path, url);
+ return url;
+ }
+
+ /**
+ * Get a virtual file
+ *
+ * @param root the root
+ * @param path the path
+ * @return the file
+ * @throws Exception for any error
+ */
+ protected VirtualFile getVirtualFile(String root, String path) throws Exception
+ {
+ URL url = getResource(root);
+ return VFS.getVirtualFile(url, path);
+ }
+
+ /**
+ * Get a url string from a path
+ *
+ * @param path the path
+ * @return the string
+ * @throws Exception for any error
+ */
+ protected String getURL(String path) throws Exception
+ {
+ URL url = getResource(path);
+ return url.toString();
+ }
+ /**
+ * Get a vfs url string from a path
+ *
+ * @param path
+ * @return the url
+ * @throws Exception
+ */
+ protected String getVfsURL(String path) throws Exception
+ {
+ URL url = getResource(path);
+ return "vfs"+url.toString();
+ }
+
+ /**
+ * Get a jar url string from a path
+ *
+ * @param path the path
+ * @return the string
+ * @throws Exception for any error
+ */
+ protected String getJarURL(String path) throws Exception
+ {
+ URL url = getResource(path);
+ url = JarUtils.createJarURL(url);
+ return url.toString();
+ }
+
+ protected StructureBuilder createStructureBuilder()
+ {
+ return new VFSStructureBuilder();
+ }
+
+ protected StructuralDeployers createStructuralDeployers()
+ {
+ StructureBuilder builder = createStructureBuilder();
+ VFSStructuralDeployersImpl structure = new VFSStructuralDeployersImpl();
+ structure.setStructureBuilder(builder);
+ return structure;
+ }
+
+ protected void addStructureDeployer(DeployerClient main, StructureDeployer deployer)
+ {
+ MainDeployerImpl mainDeployerImpl = (MainDeployerImpl) main;
+ VFSStructuralDeployersImpl structure = (VFSStructuralDeployersImpl) mainDeployerImpl.getStructuralDeployers();
+ structure.addDeployer(deployer);
+ }
+
+ /**
+ * Create a deployment
+ *
+ * @param root the root
+ * @param path the path
+ * @return the deployment
+ * @throws Exception for any error
+ */
+ protected VFSDeployment createDeployment(String root, String path) throws Exception
+ {
+ VirtualFile file = getVirtualFile(root, path);
+ return VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+ }
+
+ /**
+ * Create a deployment context
+ *
+ * @param root the root
+ * @param path the path
+ * @return the context
+ * @throws Exception for any error
+ */
+ protected VFSDeploymentContext createDeploymentContext(String root, String path) throws Exception
+ {
+ VirtualFile file = getVirtualFile(root, path);
+ return new AbstractVFSDeploymentContext(file, "");
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/DeployersVFSTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,61 @@
+/*
+* 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;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.jaxp.VFSDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deploymentfactory.VFSDeploymentFactoryTestSuite;
+import org.jboss.test.deployers.vfs.metadata.VFSMetaDataTestSuite;
+import org.jboss.test.deployers.vfs.structure.VFSStructureTestSuite;
+import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
+
+/**
+ * Deployers VFS Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class DeployersVFSTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Deployers VFS Tests");
+
+ suite.addTest(VFSDeploymentFactoryTestSuite.suite());
+ suite.addTest(VFSStructureBuilderTestSuite.suite());
+ suite.addTest(VFSStructureTestSuite.suite());
+ suite.addTest(VFSMetaDataTestSuite.suite());
+ suite.addTest(VFSDeployerTestSuite.suite());
+ suite.addTest(BeanDeployerTestSuite.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/BeanDeployerTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,53 @@
+/*
+* 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.deployer.bean;
+
+import org.jboss.test.deployers.vfs.deployer.bean.test.BeanDeployerUnitTestCase;
+import org.jboss.test.deployers.vfs.deployer.bean.test.KernelDeployerUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * BeanDeployerTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanDeployerTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Bean Deployer Tests");
+
+ suite.addTest(BeanDeployerUnitTestCase.suite());
+ suite.addTest(KernelDeployerUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/Simple.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/Simple.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/Simple.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -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.deployer.bean.support;
+
+/**
+ * Simple.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Simple
+{
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/TestBeanDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/TestBeanDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/TestBeanDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,60 @@
+/*
+* 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.deployer.bean.support;
+
+import java.util.Collections;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+
+/**
+ * TestBeanDeployer.<p>
+ *
+ * This just creates some metadata for use by the KernelDeployer
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestBeanDeployer extends AbstractDeployer
+{
+ public TestBeanDeployer()
+ {
+ setStage(DeploymentStages.PARSE);
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setName("KernelDeployerTest");
+
+ BeanMetaDataFactory metaData = new AbstractBeanMetaData("Test", Simple.class.getName());
+ deployment.setBeanFactories(Collections.singletonList(metaData));
+
+ unit.getTransientManagedObjects().addAttachment("KernelDeployerTest", deployment);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/BeanDeployerUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/BeanDeployerUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/BeanDeployerUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,122 @@
+/*
+* 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.deployer.bean.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.vfs.deployer.kernel.BeanDeployer;
+import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer;
+import org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer;
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+
+/**
+ * BeanDeployerUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanDeployerUnitTestCase extends BaseDeployersVFSTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(BeanDeployerUnitTestCase.class);
+ }
+
+ private DeployerClient main;
+
+ private KernelController controller;
+
+ public BeanDeployerUnitTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ try
+ {
+ BasicBootstrap bootstrap = new BasicBootstrap();
+ bootstrap.run();
+ Kernel kernel = bootstrap.getKernel();
+ controller = kernel.getController();
+
+ main = createMainDeployer();
+ addStructureDeployer(main, new JARStructure());
+ addStructureDeployer(main, new FileStructure());
+
+ BeanDeployer beanDeployer = new BeanDeployer();
+ KernelDeploymentDeployer kernelDeploymentDeployer = new KernelDeploymentDeployer();
+ BeanMetaDataDeployer beanMetaDataDeployer = new BeanMetaDataDeployer(kernel);
+ addDeployer(main, beanDeployer);
+ addDeployer(main, kernelDeploymentDeployer);
+ addDeployer(main, beanMetaDataDeployer);
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+
+ public void testTopLevelFile() throws Exception
+ {
+ VFSDeployment context = createDeployment("/bean", "toplevel/my-beans.xml");
+ assertDeploy(context);
+ assertNotNull(controller.getInstalledContext("Test"));
+
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+
+ public void testMetaInfFile() throws Exception
+ {
+ VFSDeployment context = createDeployment("/bean", "toplevel/test.jar");
+ assertDeploy(context);
+ assertNotNull(controller.getInstalledContext("Test"));
+
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+
+ protected void assertDeploy(VFSDeployment context) throws Exception
+ {
+ main.addDeployment(context);
+ main.process();
+ assertEquals("Should be Deployed " + context, DeploymentState.DEPLOYED, main.getDeploymentState(context.getName()));
+ }
+
+ protected void assertUndeploy(VFSDeployment context) throws Exception
+ {
+ main.removeDeployment(context.getName());
+ main.process();
+ assertEquals("Should be Undeployed " + context, DeploymentState.UNDEPLOYED, main.getDeploymentState(context.getName()));
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/KernelDeployerUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/KernelDeployerUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/KernelDeployerUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -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.test.deployers.vfs.deployer.bean.test;
+
+import java.util.Collections;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer;
+import org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+import org.jboss.test.deployers.vfs.deployer.bean.support.Simple;
+import org.jboss.test.deployers.vfs.deployer.bean.support.TestBeanDeployer;
+
+/**
+ * BeanDeployerUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class KernelDeployerUnitTestCase extends BaseDeployersVFSTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(KernelDeployerUnitTestCase.class);
+ }
+
+ private DeployerClient main;
+
+ private KernelController controller;
+
+ public KernelDeployerUnitTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ try
+ {
+ BasicBootstrap bootstrap = new BasicBootstrap();
+ bootstrap.run();
+ Kernel kernel = bootstrap.getKernel();
+ controller = kernel.getController();
+
+ main = createMainDeployer();
+
+ TestBeanDeployer testDeployer = new TestBeanDeployer();
+ KernelDeploymentDeployer kernelDeploymentDeployer = new KernelDeploymentDeployer();
+ BeanMetaDataDeployer beanMetaDataDeployer = new BeanMetaDataDeployer(kernel);
+ addDeployer(main, testDeployer);
+ addDeployer(main, kernelDeploymentDeployer);
+ addDeployer(main, beanMetaDataDeployer);
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+
+ public void testKernelDeployerPredetermined() throws Exception
+ {
+ Deployment context = createSimpleDeployment("KernelDeployerTest");
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setName("KernelDeployerTest");
+
+ BeanMetaDataFactory metaData = new AbstractBeanMetaData("Test", Simple.class.getName());
+ deployment.setBeanFactories(Collections.singletonList(metaData));
+
+ MutableAttachments attachments = (MutableAttachments) context.getPredeterminedManagedObjects();
+ attachments.addAttachment("KernelDeployerTest", deployment);
+
+ assertDeploy(context);
+ assertNotNull(controller.getInstalledContext("Test"));
+
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+
+ public void testKernelDeployerTransient() throws Exception
+ {
+ Deployment context = createSimpleDeployment("KernelDeployerTransient");
+
+ assertDeploy(context);
+ assertNotNull(controller.getInstalledContext("Test"));
+
+ assertUndeploy(context);
+ assertNull(controller.getContext("Test", null));
+ }
+
+ protected void assertDeploy(Deployment context) throws Exception
+ {
+ main.addDeployment(context);
+ main.process();
+ assertEquals("Should be Deployed " + context, DeploymentState.DEPLOYED, main.getDeploymentState(context.getName()));
+ }
+
+ protected void assertUndeploy(Deployment context) throws Exception
+ {
+ main.removeDeployment(context.getName());
+ main.process();
+ assertEquals("Should be Undeployed " + context, DeploymentState.UNDEPLOYED, main.getDeploymentState(context.getName()));
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/VFSDeployerTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/VFSDeployerTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/VFSDeployerTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,51 @@
+/*
+* 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.deployer.jaxp;
+
+import org.jboss.test.deployers.vfs.deployer.jaxp.test.JAXPDeployerUnitTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * VFSDeployerTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSDeployerTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Deployer Tests");
+
+ suite.addTest(JAXPDeployerUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/SomeBean.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/SomeBean.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/SomeBean.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.deployer.jaxp.support;
+
+/**
+ * A bean created by the JAXPDeployer parse.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 60707 $
+ */
+public class SomeBean
+{
+ private String name;
+ private String version;
+
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/TestXmlDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/TestXmlDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/support/TestXmlDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,35 @@
+package org.jboss.test.deployers.vfs.deployer.jaxp.support;
+
+import org.jboss.deployers.vfs.spi.deployer.JAXPDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.w3c.dom.Document;
+
+public class TestXmlDeployer extends JAXPDeployer<SomeBean>
+{
+ private SomeBean lastBean;
+
+ public TestXmlDeployer()
+ {
+ super(SomeBean.class);
+ setSuffix(".jbean");
+ }
+
+ public SomeBean getLastBean()
+ {
+ return lastBean;
+ }
+
+ @Override
+ protected SomeBean parse(VFSDeploymentUnit unit, VirtualFile file, Document doc) throws Exception
+ {
+ String name = doc.getDocumentElement().getAttribute("name");
+ String version = doc.getDocumentElement().getAttribute("version");
+
+ SomeBean bean = new SomeBean();
+ bean.setName(name);
+ bean.setVersion(version);
+ lastBean = bean;
+ return bean;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/test/JAXPDeployerUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/test/JAXPDeployerUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/jaxp/test/JAXPDeployerUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,132 @@
+/*
+* 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.deployer.jaxp.test;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+import org.jboss.test.deployers.vfs.deployer.jaxp.support.SomeBean;
+import org.jboss.test.deployers.vfs.deployer.jaxp.support.TestXmlDeployer;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Tests of the JAXPDeployer.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 60707 $
+ */
+public class JAXPDeployerUnitTestCase extends BaseDeployersVFSTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(JAXPDeployerUnitTestCase.class);
+ }
+
+ private DeployerClient main;
+ private TestXmlDeployer deployer;
+
+ public JAXPDeployerUnitTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ try
+ {
+ main = createMainDeployer();
+ addStructureDeployer(main, new JARStructure());
+ addStructureDeployer(main, new FileStructure());
+
+ deployer = new TestXmlDeployer();
+ deployer.create();
+ addDeployer(main, deployer);
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+
+ public void testDocOverride() throws Exception
+ {
+ enableTrace("org.jboss.deployers");
+ enableTrace("org.jboss.dependency");
+
+ VFSDeployment context = createDeployment("/jaxp", "somebean.jbean");
+ assertDeploy(context, null, null);
+ SomeBean bean = deployer.getLastBean();
+ assertNotNull(bean);
+ assertEquals("bean.name", bean.getName(), "bean1");
+ assertEquals("bean.version", bean.getVersion(), "1.0");
+
+ // Now deploy with an overriden Document
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ DOMImplementation dom = builder.getDOMImplementation();
+ Document doc = dom.createDocument(null, "somebean", null);
+ Element root = doc.getDocumentElement();
+ root.setAttribute("name", "bean1.1");
+ root.setAttribute("version", "1.1");
+ assertDeploy(context, Document.class, doc);
+
+ bean = deployer.getLastBean();
+ assertNotNull(bean);
+ assertEquals("bean.name", bean.getName(), "bean1.1");
+ assertEquals("bean.version", bean.getVersion(), "1.1");
+
+ assertUndeploy(context);
+ }
+
+ protected <T> void assertDeploy(VFSDeployment context, Class<T> clazz, T mo) throws Exception
+ {
+ main.addDeployment(context);
+ if (mo != null)
+ {
+ MutableAttachments attachments = (MutableAttachments) context.getPredeterminedManagedObjects();
+ attachments.addAttachment(clazz, mo);
+ }
+ main.process();
+ assertEquals("Should be Deployed " + context, DeploymentState.DEPLOYED, main.getDeploymentState(context.getName()));
+ }
+
+ protected void assertUndeploy(VFSDeployment context)
+ throws Exception
+ {
+ main.removeDeployment(context);
+ main.process();
+ assertEquals("Should be Undeployed " + context, DeploymentState.UNDEPLOYED, main.getDeploymentState(context.getName()));
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/VFSDeploymentFactoryTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/VFSDeploymentFactoryTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/VFSDeploymentFactoryTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,51 @@
+/*
+* 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.deploymentfactory;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.deployers.vfs.deploymentfactory.test.VFSDeploymentFactoryUnitTestCase;
+
+/**
+ * VFSDeploymentFactoryTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSDeploymentFactoryTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Deployment Factory Tests");
+
+ suite.addTest(VFSDeploymentFactoryUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/test/VFSDeploymentFactoryUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/test/VFSDeploymentFactoryUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deploymentfactory/test/VFSDeploymentFactoryUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,104 @@
+/*
+* 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.deploymentfactory.test;
+
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.test.deployers.deploymentfactory.AbstractDeploymentFactoryTest;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSDeploymentFactoryUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSDeploymentFactoryUnitTestCase extends AbstractDeploymentFactoryTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(VFSDeploymentFactoryUnitTestCase.class);
+ }
+
+ public VFSDeploymentFactoryUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testConstruct()
+ {
+ VFSDeploymentFactory factory = createDeploymentFactory();
+ VirtualFile root = getVirtualFile("/dummy");
+ VFSDeployment deployment = factory.createVFSDeployment(root);
+ assertEquals(root, deployment.getRoot());
+ }
+
+ public void testConstructErrors()
+ {
+ VFSDeploymentFactory factory = createDeploymentFactory();
+ try
+ {
+ factory.createVFSDeployment(null);
+ fail("Should not be here!");
+ }
+ catch (Exception e)
+ {
+ checkThrowable(IllegalArgumentException.class, e);
+ }
+ }
+
+ @Override
+ protected VFSDeploymentFactory createDeploymentFactory()
+ {
+ return VFSDeploymentFactory.getInstance();
+ }
+
+ @Override
+ protected Deployment createDeployment()
+ {
+ return new AbstractVFSDeployment(getVirtualFile("/dummy"));
+ }
+
+ protected VirtualFile getVirtualFile(String resourceName)
+ {
+ URL resource = null;
+ try
+ {
+ resource = getResource("/dummy");
+ assertNotNull(resource);
+ return VFS.getRoot(resource);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Failed to get resource: " + resource, e);
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/VFSMetaDataTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/VFSMetaDataTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/VFSMetaDataTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,51 @@
+/*
+* 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.metadata;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.deployers.vfs.metadata.test.MetaDataUnitTestCase;
+
+/**
+ * MetaDataTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSMetaDataTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS MetaData Tests");
+
+ suite.addTest(MetaDataUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/test/MetaDataUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/test/MetaDataUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/metadata/test/MetaDataUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,199 @@
+/*
+* 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.metadata.test;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * MetaDataUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class MetaDataUnitTestCase extends BaseDeployersVFSTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(MetaDataUnitTestCase.class);
+ }
+
+ public MetaDataUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testExactMatchTopLevel() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/exact/jboss-service.xml");
+ String expected = getVfsURL("/metadata/toplevel/exact/jboss-service.xml");
+ assertMetaDataMatch(context, expected, "jboss-service.xml");
+ }
+
+ public void testNotExactMatchTopLevel() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/exact/jboss-service.xml");
+ assertNoMetaDataMatch(context, "not-correct.xml");
+ }
+
+ public void testPartialMatchTopLevel() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/partial/mydb-ds.xml");
+ Set<String> expected = new HashSet<String>();
+ expected.add(getVfsURL("/metadata/toplevel/partial/mydb-ds.xml"));
+ assertMetaDataMatch(context, expected, null, "-ds.xml");
+ }
+
+ public void testNotPartialMatchTopLevel() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/partial/mydb-ds.xml");
+ assertNoMetaDataMatch(context, null, "-not.xml");
+ }
+
+ public void testExactMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ String expected = getVfsURL("/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml");
+ assertMetaDataMatch(context, expected, "jboss-service.xml");
+ }
+
+ public void testNotExactMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "not-correct.xml");
+ }
+
+ public void testExactMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "jboss-service.xml");
+ }
+
+ public void testNotExactMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "not-correct.xml");
+ }
+
+ public void testPartialMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ Set<String> expected = new HashSet<String>();
+ expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/1-ds.xml"));
+ expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/2-ds.xml"));
+ assertMetaDataMatch(context, expected, null, "-ds.xml");
+ }
+
+ public void testNotPartialMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, null, "-not.xml");
+ }
+
+ public void testPartialMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, null, "-ds.xml");
+ }
+
+ public void testNotPartialMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, null, "-not.xml");
+ }
+
+ public void testExactAndPartialMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ Set<String> expected = new HashSet<String>();
+ expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/jboss-service.xml"));
+ expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/1-ds.xml"));
+ expected.add(getVfsURL("/metadata/toplevel/metadata.jar/META-INF/2-ds.xml"));
+ assertMetaDataMatch(context, expected, "jboss-service.xml", "-ds.xml");
+ }
+
+ public void testNotExactAndPartialMatchMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "not-correct.xml", "-not.xml");
+ }
+
+ public void testExactAndPartialMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "jboss-service.xml", "-ds.xml");
+ }
+
+ public void testNotExactAndPartialMatchNoMetaInf() throws Exception
+ {
+ VFSDeploymentContext context = createDeploymentContext("/metadata", "toplevel/metadata-nometainf.jar");
+ context.setMetaDataPath("META-INF");
+ assertNoMetaDataMatch(context, "jboss-service.xml", "-not.xml");
+ }
+
+ protected void assertMetaDataMatch(VFSDeploymentContext context, String expected, String name) throws Exception
+ {
+ VirtualFile file = context.getMetaDataFile(name);
+ assertNotNull(file);
+ assertEquals(expected, file.toURL().toString());
+ }
+
+ protected void assertNoMetaDataMatch(VFSDeploymentContext context, String name) throws Exception
+ {
+ VirtualFile file = context.getMetaDataFile(name);
+ assertNull(file);
+ }
+
+ protected void assertMetaDataMatch(VFSDeploymentContext context, Set<String> expected, String name, String suffix) throws Exception
+ {
+ List<VirtualFile> files = context.getMetaDataFiles(name, suffix);
+ Set<String> actual = new HashSet<String>(files.size());
+ for (VirtualFile file : files)
+ actual.add(file.toURL().toString());
+ assertEquals(expected, actual);
+ }
+
+ protected void assertNoMetaDataMatch(VFSDeploymentContext context, String name, String suffix) throws Exception
+ {
+ List<VirtualFile> files = context.getMetaDataFiles(name, suffix);
+ assertEmpty(files);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,289 @@
+/*
+* 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.structure;
+
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.BaseTestCase;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.protocol.vfsfile.Handler;
+
+/**
+ * AbstractStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractStructureTest extends BaseTestCase
+{
+ public AbstractStructureTest(String name)
+ {
+ super(name);
+ }
+
+ protected void assertNoChildContexts(VFSDeploymentContext context)
+ {
+ assertChildContexts(context, null);
+ }
+
+ protected void assertChildContexts(VFSDeploymentContext context, String... paths)
+ {
+ List<String> expected = new ArrayList<String>();
+ if (paths != null)
+ {
+ for (String path : paths)
+ expected.add(path);
+ }
+ List<DeploymentContext> children = context.getChildren();
+ assertNotNull(children);
+ assertEquals("Expected " + expected + " got " + simplePrint(children), expected.size(), children.size());
+
+ for (String path : expected)
+ {
+ boolean found = false;
+ for (DeploymentContext child : children)
+ {
+ if (path.equals(child.getRelativePath()))
+ found = true;
+ }
+ if (found == false)
+ fail("Expected " + path + " in " + children);
+ }
+ }
+
+ protected String simplePrint(List<DeploymentContext> children)
+ {
+ StringBuilder builder = new StringBuilder();
+ boolean first = false;
+ builder.append("[");
+ for (DeploymentContext child : children)
+ {
+ if (first == false)
+ first = true;
+ else
+ builder.append(", ");
+ builder.append(child.getRelativePath());
+ }
+ builder.append("]");
+ return builder.toString();
+ }
+
+ protected void assertMetaData(VFSDeploymentContext context, String metaDataPath) throws Exception
+ {
+ VirtualFile root = context.getRoot();
+ VirtualFile metaDataLocation = context.getMetaDataLocation();
+ VirtualFile expected = root.findChild(metaDataPath);
+ assertEquals(expected, metaDataLocation);
+ }
+
+ protected VFSDeploymentContext assertChildContext(VFSDeploymentContext context, String name) throws Exception
+ {
+ List<DeploymentContext> children = context.getChildren();
+ if (children == null)
+ fail("No children for " + context);
+ for (DeploymentContext child : children)
+ {
+ if (name.equals(child.getSimpleName()))
+ return (VFSDeploymentContext) child;
+ }
+ fail(name + " not found in " + children);
+ throw new RuntimeException("unreachable");
+ }
+
+ protected void assertClassPath(VFSDeploymentContext context, String... paths) throws Exception
+ {
+ assertClassPath(context, context, paths);
+ }
+
+ protected void assertClassPath(VFSDeploymentContext context, VFSDeploymentContext reference, String... paths) throws Exception
+ {
+ List<VirtualFile> classPath = context.getClassPath();
+ if (paths == null)
+ {
+ if (classPath != null)
+ assertEmpty(classPath);
+ return;
+ }
+
+ assertNotNull("Expected " + Arrays.asList(paths), classPath);
+
+ assertEquals("Expected " + Arrays.asList(paths) + " got " + classPath, paths.length, classPath.size());
+
+ for (String path : paths)
+ {
+ VirtualFile ref = reference.getRoot();
+ VirtualFile expected = ref.findChild(path);
+ assertTrue("Expected " + expected +" in " + classPath, classPath.contains(expected));
+ }
+ }
+
+ protected void assertMetaDataFile(VFSDeploymentContext context, String name)
+ {
+ assertNotNull("Should find metadata " + name, context.getMetaDataFile(name));
+ }
+
+ protected void assertNoMetaDataFile(VFSDeploymentContext context, String name)
+ {
+ assertNull("Should not find metadata " + name, context.getMetaDataFile(name));
+ }
+
+ protected void assertFile(VFSDeploymentContext context, String name)
+ {
+ assertNotNull("Should find file " + name, context.getFile(name));
+ }
+
+ protected void assertNoFile(VFSDeploymentContext context, String name)
+ {
+ assertNull("Should not find file " + name, context.getFile(name));
+ }
+
+ protected abstract VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception;
+
+ protected VFSDeploymentContext determineStructureWithStructureDeployer(VFSDeployment deployment, StructureDeployer structureDeployer) throws Exception
+ {
+ VFSStructuralDeployersImpl structuralDeployers = new VFSStructuralDeployersImpl();
+ VFSStructureBuilder builder = new VFSStructureBuilder();
+ structuralDeployers.setStructureBuilder(builder);
+
+ structuralDeployers.addDeployer(structureDeployer);
+
+ return (VFSDeploymentContext) structuralDeployers.determineStructure(deployment);
+ }
+
+ protected VFSDeploymentContext determineStructureWithAllStructureDeployers(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithStructureDeployers(deployment, new FileStructure(), new WARStructure(), new JARStructure());
+ }
+
+ protected VFSDeploymentContext determineStructureWithStructureDeployers(VFSDeployment deployment, StructureDeployer... deployers) throws Exception
+ {
+ VFSStructuralDeployersImpl structuralDeployers = new VFSStructuralDeployersImpl();
+ VFSStructureBuilder builder = new VFSStructureBuilder();
+ structuralDeployers.setStructureBuilder(builder);
+
+ for (StructureDeployer deployer : deployers)
+ structuralDeployers.addDeployer(deployer);
+
+ return (VFSDeploymentContext) structuralDeployers.determineStructure(deployment);
+ }
+
+ protected VFSDeploymentContext deploy(String context, String path) throws Throwable
+ {
+ VFSDeployment deployment = createDeployment(context, path);
+ VFSDeploymentContext result = determineStructure(deployment);
+ assertNotNull(result);
+ if (result.getProblem() != null)
+ throw result.getProblem();
+ return result;
+ }
+
+ protected VFSDeploymentContext assertDeploy(String context, String path) throws Throwable
+ {
+ VFSDeploymentContext result = deploy(context, path);
+ assertEquals(path, result.getSimpleName());
+ return result;
+ }
+
+ protected VFSDeploymentContext assertDeployNoChildren(String context, String path) throws Throwable
+ {
+ VFSDeploymentContext result = assertDeploy(context, path);
+ assertNoChildContexts(result);
+ return result;
+ }
+
+ protected void assertNotValid(String context, String path) throws Throwable
+ {
+ try
+ {
+ deploy(context, path);
+ fail("Should not be here!");
+ }
+ catch (Exception e)
+ {
+ checkThrowable(DeploymentException.class, e);
+ }
+ }
+
+ protected VFSDeployment createDeployment(String context, String path) throws Exception
+ {
+ VirtualFile root = getVirtualFile(context, path);
+ return VFSDeploymentFactory.getInstance().createVFSDeployment(root);
+ }
+
+ protected VirtualFile getVirtualFile(String root, String path) throws Exception
+ {
+ // TODO THIS IS HACK TO MAKE THE TEST WORK IN MAVEN ???
+ try
+ {
+ URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory()
+ {
+ public URLStreamHandler createURLStreamHandler(String protocol)
+ {
+ if ("vfsfile".equals(protocol))
+ return new Handler();
+ return null;
+ }
+ });
+ }
+ catch (Error ignored)
+ {
+ }
+ URL url = getResource(root);
+ Field field = URL.class.getDeclaredField("factory");
+ field.setAccessible(true);
+ return VFS.getVirtualFile(url, path);
+ }
+
+ @Override
+ public URL getResource(String path)
+ {
+ URL result = super.getResource(path);
+ if (result == null)
+ fail("Unable to find resource " + path);
+ return result;
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ //enableTrace("org.jboss.deployers");
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/VFSStructureTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/VFSStructureTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/VFSStructureTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,69 @@
+/*
+* 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.structure;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.deployers.vfs.structure.ear.test.EARStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.explicit.test.DeclaredStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.file.test.CombinedFileStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.file.test.ConfiguredSuffixFileStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.file.test.FileStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.jar.test.CombinedJARStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.jar.test.ConfiguredSuffixJARStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.jar.test.JARStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.war.test.CombinedWARStructureUnitTestCase;
+import org.jboss.test.deployers.vfs.structure.war.test.WARStructureUnitTestCase;
+
+/**
+ * VFSStructureTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructureTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Structure Tests");
+
+ suite.addTest(ConfiguredSuffixJARStructureUnitTestCase.suite());
+ suite.addTest(JARStructureUnitTestCase.suite());
+ suite.addTest(WARStructureUnitTestCase.suite());
+ suite.addTest(ConfiguredSuffixFileStructureUnitTestCase.suite());
+ suite.addTest(FileStructureUnitTestCase.suite());
+ suite.addTest(DeclaredStructureUnitTestCase.suite());
+ suite.addTest(EARStructureUnitTestCase.suite());
+ suite.addTest(CombinedJARStructureUnitTestCase.suite());
+ suite.addTest(CombinedWARStructureUnitTestCase.suite());
+ suite.addTest(CombinedFileStructureUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/EarModule.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/EarModule.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/EarModule.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.structure.ear.support;
+
+/**
+ * Represent an ear module entry
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class EarModule
+{
+ private String name;
+ private String fileName;
+
+ public EarModule(String name, String fileName)
+ {
+ this.name = name;
+ this.fileName = fileName;
+ }
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+ public String getFileName()
+ {
+ return fileName;
+ }
+ public void setFileName(String fileName)
+ {
+ this.fileName = fileName;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.structure.ear.support;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
+
+/**
+ * A mock ear structure deployer that illustrates concepts involved with an ear
+ * type of deployer.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class MockEarStructureDeployer extends AbstractStructureDeployer
+{
+ /**
+ * The default ear/lib filter
+ */
+ public static final VirtualFileFilter DEFAULT_EAR_LIB_FILTER = new SuffixMatchFilter(".jar");
+
+ /**
+ * The ear/lib filter
+ */
+ private VirtualFileFilter earLibFilter = DEFAULT_EAR_LIB_FILTER;
+
+ @Override
+ public int getRelativeOrder()
+ {
+ return 1000;
+ }
+
+ /**
+ * Get the earLibFilter.
+ *
+ * @return the earLibFilter.
+ */
+ public VirtualFileFilter getEarLibFilter()
+ {
+ return earLibFilter;
+ }
+
+ /**
+ * Set the earLibFilter.
+ *
+ * @param earLibFilter
+ * @throws IllegalArgumentException for a null filter
+ */
+ public void setEarLibFilter(VirtualFileFilter earLibFilter)
+ {
+ if (earLibFilter == null)
+ throw new IllegalArgumentException("Null filter");
+ this.earLibFilter = earLibFilter;
+ }
+
+ public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ ContextInfo context = null;
+ boolean valid = false;
+ try
+ {
+ if (file.isLeaf() == true || file.getName().endsWith(".ear") == false)
+ return false;
+
+ context = createContext(file, "META-INF", metaData);
+
+ VirtualFile applicationProps = getMetaDataFile(file, "META-INF/application.properties");
+ boolean scan = true;
+ List<EarModule> modules = new ArrayList<EarModule>();
+ if (applicationProps != null)
+ {
+ // This is a simple module-name=earPath properties file
+ InputStream in = applicationProps.openStream();
+ Properties props = new Properties();
+ props.load(in);
+ in.close();
+ scan = false;
+ for(Object key : props.keySet())
+ {
+ String name = (String) key;
+ String fileName = props.getProperty(name);
+ EarModule module = new EarModule(name, fileName);
+ modules.add(module);
+ }
+ }
+ // Add the ear lib contents to the classpath
+ String libDir = "lib";
+ try
+ {
+ VirtualFile lib = file.findChild(libDir);
+ if (lib != null)
+ {
+ List<VirtualFile> archives = lib.getChildren(earLibFilter);
+ for (VirtualFile archive : archives)
+ super.addClassPath(root, archive, true, true, context);
+ }
+ }
+ catch (IOException ignored)
+ {
+ // lib directory does not exist
+ }
+
+ // Add the ear manifest locations?
+ super.addClassPath(root, file, false, true, context);
+
+ // TODO: need to scan for annotationss
+ if (scan)
+ {
+ throw new RuntimeException("Scanning not implemented: "+file.getName());
+ }
+ else
+ {
+ // Create subdeployments for the ear modules
+ for(EarModule mod : modules)
+ {
+ String fileName = mod.getFileName();
+ if (fileName != null && (fileName = fileName.trim()).length() > 0)
+ {
+ try
+ {
+ VirtualFile module = file.findChild(fileName);
+ if (module == null)
+ {
+ throw new RuntimeException(fileName
+ + " module listed in application.xml does not exist within .ear "
+ + file.getName());
+ }
+ // Ask the deployers to analyze this
+ if (deployers.determineStructure(root, file, module, metaData) == false)
+ {
+ throw new RuntimeException(fileName
+ + " module listed in application.xml is not a recognized deployment, .ear: "
+ + file.getName());
+ }
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(fileName
+ + " module listed in application.xml does not exist within .ear "
+ + file.getName(), e);
+ }
+ }
+ }
+ }
+
+ valid = true;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error determining structure: "+ file.getName(), e);
+ }
+
+ return valid;
+ }
+
+ private VirtualFile getMetaDataFile(VirtualFile file, String path)
+ {
+ VirtualFile metaFile = null;
+ try
+ {
+ metaFile = file.findChild(path);
+ }
+ catch (IOException e)
+ {
+ }
+ return metaFile;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,123 @@
+/*
+* 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 softeare; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Softeare Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This softeare is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied earranty 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 softeare; if not, write to the Free
+* Softeare 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.structure.ear.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
+import org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer;
+
+/**
+ * Mock ear structure deployer tests
+ *
+ * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
+ * @version $Revision: 61684 $
+ */
+public class EARStructureUnitTestCase extends AbstractStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(EARStructureUnitTestCase.class);
+ }
+
+ public EARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ enableTrace("org.jboss.deployers");
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ JARStructure jarStructure = new JARStructure();
+ Set<String> suffixes = new HashSet<String>(jarStructure.getSuffixes());
+ suffixes.add(".ejb3");
+ jarStructure.setSuffixes(suffixes);
+ return determineStructureWithStructureDeployers(deployment, new FileStructure(), new WARStructure(), jarStructure, new MockEarStructureDeployer());
+ }
+
+ public void testNotAnEAR() throws Throwable
+ {
+ // TODO ??? This gets recognised by the jar deployer assertNotValid("/structure/ear", "notanear");
+ }
+
+ /**
+ * Validate a basic ear with modules having no subdeployments
+ * @throws Throwable for any problem
+ */
+ public void testSimpleWithAppXml() throws Throwable
+ {
+ VFSDeploymentContext ear = assertDeploy("/structure/ear", "simplewithappxml.ear");
+ assertClassPath(ear, "lib/lib0.jar");
+ assertChildContexts(ear, "module-service.xml", "module-bean1ejb.jar", "module-bean2.ejb3", "module-client1.jar", "module-mbean1.sar", "module-mcf1-ds.xml", "module-mcf1.rar", "module-web1.war");
+ }
+
+ /**
+ * Validate a ear type of structure specified via the ear
+ * META-INF/application.properties parsed by the MockEarStructureDeployer.
+ * The ear modules having subdeployments
+ * @throws Throwable for any problem
+ */
+ public void testComplexWithAppXml() throws Throwable
+ {
+ VFSDeploymentContext ear = assertDeploy("/structure/ear", "complexwithappxml.ear");
+ assertClassPath(ear, "lib/lib0.jar");
+ assertChildContexts(ear, "module-service.xml", "module-bean1ejb.jar", "module-bean2.ejb3", "module-client1.jar", "module-mbean1.sar", "module-mcf1-ds.xml", "module-mcf1.rar", "module-web1.war", "subdir/relative.jar");
+
+ // Validate that the expected module subdeployments are there
+ VFSDeploymentContext child = assertChildContext(ear, "module-mbean1.sar");
+ assertChildContexts(child, "extensions.aop", "submbean.sar", "submbean2-service.xml");
+ }
+
+ /**
+ * Basic getMetaDataFile/getFile tests.
+ *
+ * @throws Throwable for any problem
+ */
+ public void testComplexWithAppFinds() throws Throwable
+ {
+ VFSDeploymentContext ear = assertDeploy("/structure/ear", "complexwithappxml.ear");
+
+ // META-INF/application.properties
+ assertMetaDataFile(ear, "application.properties");
+ assertNoFile(ear, "application.properties");
+
+ // lib/lib0.jar
+ assertNoMetaDataFile(ear, "lib/lib0.jar");
+ assertFile(ear, "lib/lib0.jar");
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,81 @@
+/*
+* 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.structure.explicit.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
+
+/**
+ * DeclaredStructure deployer unit tests.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class DeclaredStructureUnitTestCase extends AbstractStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(DeclaredStructureUnitTestCase.class);
+ }
+
+ public DeclaredStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ enableTrace("org.jboss.deployers");
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithStructureDeployer(deployment, new DeclaredStructure());
+ }
+
+ public void testComplex() throws Throwable
+ {
+ VFSDeploymentContext root = assertDeploy("/structure/explicit", "complex.deployer");
+ assertChildContexts(root, "sub.jar", "x.war");
+
+ // Validate the root context info
+ assertMetaData(root, "META-INF");
+ assertClassPath(root, "cp-mf.jar", "jar1.jar", "lib-dir/jar0.jar", "lib-dir/jar2.jar");
+
+ // Validate the sub.jar
+ VFSDeploymentContext subJar = assertChildContext(root, "sub.jar");
+ assertMetaData(subJar, "META-INF");
+ assertClassPath(subJar, root, "cp-mf.jar");
+
+ // Validate the x.war context info
+ VFSDeploymentContext xwar = assertChildContext(root, "x.war");
+ assertMetaData(xwar, "WEB-INF");
+ assertClassPath(xwar, "WEB-INF/classes", "WEB-INF/lib/w0.jar");
+ }
+}
Property changes on: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/AbstractFileStructureTest.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/AbstractFileStructureTest.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/AbstractFileStructureTest.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,59 @@
+/*
+* 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.structure.file.test;
+
+import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
+
+/**
+ * AbstractFileStructureTest.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractFileStructureTest extends AbstractStructureTest
+{
+ public AbstractFileStructureTest(String name)
+ {
+ super(name);
+ }
+
+ public void testSimple() throws Throwable
+ {
+ assertDeployNoChildren("/structure/file/simple", "simple-service.xml");
+ }
+
+ public void testNotKnownButTopLevel() throws Throwable
+ {
+ assertDeployNoChildren("/structure/file/unknown", "test-unknown.xml");
+ assertDeployNoChildren("/structure/file/unknown", "unknown.xml");
+ }
+
+ public void testNotKnownInSubdirectory() throws Throwable
+ {
+ assertNotValid("/structure/file", "unknown");
+ }
+
+ public void testDirectory() throws Throwable
+ {
+ assertNotValid("/structure/file", "directory");
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/CombinedFileStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/CombinedFileStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/CombinedFileStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,64 @@
+/*
+* 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.structure.file.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * CombinedFileStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CombinedFileStructureUnitTestCase extends AbstractFileStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(CombinedFileStructureUnitTestCase.class);
+ }
+
+ public CombinedFileStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDirectory() throws Throwable
+ {
+ // The jar deployer recognises the directory in the combined test
+ assertDeployNoChildren("/structure/file", "directory");
+ }
+
+ public void testNotKnownInSubdirectory() throws Throwable
+ {
+ // The jar deployer recognises the directory in the combined test
+ assertDeployNoChildren("/structure/file", "unknown");
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithAllStructureDeployers(deployment);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/ConfiguredSuffixFileStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/ConfiguredSuffixFileStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/ConfiguredSuffixFileStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,107 @@
+/*
+* 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.structure.file.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.test.BaseTestCase;
+
+/**
+ * FileStructureUnitTestCase.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConfiguredSuffixFileStructureUnitTestCase extends BaseTestCase
+{
+ /** The file structure deployer */
+ private static final Set<String> defaultSuffixes = new HashSet<String>(new FileStructure().getSuffixes());
+
+ public static Test suite()
+ {
+ return new TestSuite(ConfiguredSuffixFileStructureUnitTestCase.class);
+ }
+
+ public ConfiguredSuffixFileStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ enableTrace("org.jboss.deployers");
+ }
+
+ public void testDefaults() throws Exception
+ {
+ assertNotNull("default suffixes should not be null", defaultSuffixes);
+ assertTrue("default suffixes size should be > 0", defaultSuffixes.size() > 0);
+ }
+
+ public void testNewUsingDefaults() throws Exception
+ {
+ FileStructure structure = new FileStructure();
+
+ Set<String> suffixes = structure.getSuffixes();
+ assertNotNull(suffixes);
+ assertEquals(defaultSuffixes.size(), suffixes.size());
+ for (String suff : defaultSuffixes)
+ {
+ suffixes.contains(suff);
+ }
+ }
+
+ public void testOverwriteDefaults() throws Exception
+ {
+ try
+ {
+ Set<String> newSuffixes = new HashSet<String>();
+
+ newSuffixes = new HashSet<String>();
+ newSuffixes.add("-ds.xml");
+ newSuffixes.add("-dd.xml");
+ newSuffixes.add("-service.xml");
+
+ FileStructure structure = new FileStructure(newSuffixes);
+
+ Set<String> suffixes = structure.getSuffixes();
+ assertNotNull(suffixes);
+ assertEquals(3, suffixes.size());
+ assertTrue(suffixes.contains("-ds.xml"));
+ assertTrue(suffixes.contains("-dd.xml"));
+ assertTrue(suffixes.contains("-service.xml"));
+ }
+ finally
+ {
+ // Reset
+ new FileStructure(defaultSuffixes);
+ }
+ }
+
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/file/test/FileStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,53 @@
+/*
+* 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.structure.file.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.file.FileStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * FileStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class FileStructureUnitTestCase extends AbstractFileStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(FileStructureUnitTestCase.class);
+ }
+
+ public FileStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithStructureDeployer(deployment, new FileStructure());
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/AbstractJARStructureTest.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/AbstractJARStructureTest.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/AbstractJARStructureTest.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,99 @@
+/*
+* 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.structure.jar.test;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
+
+/**
+ * AbstractJARStructureTest.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractJARStructureTest extends AbstractStructureTest
+{
+ public AbstractJARStructureTest(String name)
+ {
+ super(name);
+ }
+
+ public void testSimple() throws Throwable
+ {
+ assertDeployNoChildren("/structure/jar", "simple");
+ }
+
+ public void testRootNotAnArchive() throws Throwable
+ {
+ assertNotValid("/structure/jar/notanarchive", "NotAnArchive.jar");
+ assertNotValid("/structure/jar/notanarchive", "NotAnArchive.zip");
+ }
+
+ public void testSubdeploymentNotAnArchive() throws Throwable
+ {
+ assertDeployNoChildren("/structure/jar", "notanarchive");
+ }
+
+ public void testJarAsRoot() throws Throwable
+ {
+ assertDeployNoChildren("/structure/jar/indirectory", "archive.jar");
+ assertDeployNoChildren("/structure/jar/indirectory", "archive.zip");
+ }
+
+ public void testJarInDirectory() throws Throwable
+ {
+ VFSDeploymentContext context = assertDeploy("/structure/jar", "indirectory");
+ assertChildContexts(context, "archive.jar", "archive.zip");
+ }
+
+ public void testSubdirectoryNotAJar() throws Throwable
+ {
+ assertDeployNoChildren("/structure/jar", "subdirnotajar");
+ }
+
+ public void testSubdirectoryIsAJar() throws Throwable
+ {
+ VFSDeploymentContext context = assertDeploy("/structure/jar", "subdirisajar");
+ assertChildContexts(context, "sub.jar");
+ }
+
+ public void testdirectoryHasMetaInf() throws Throwable
+ {
+ assertDeployNoChildren("/structure/jar/subdirhasmetainf", "sub");
+ }
+
+ public void testSubdirectoryHasMetaInf() throws Throwable
+ {
+ VFSDeploymentContext context = assertDeploy("/structure/jar", "subdirhasmetainf");
+ assertChildContexts(context, "sub");
+ }
+
+ public void testSubdeploymentIsKnownFile() throws Throwable
+ {
+ assertDeployNoChildren("/structure/file", "simple");
+ }
+
+ public void testSubdeploymentIsUnknownFile() throws Throwable
+ {
+ assertDeployNoChildren("/structure/file", "unknown");
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/CombinedJARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/CombinedJARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/CombinedJARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,66 @@
+/*
+* 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.structure.jar.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * CombinedJARStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CombinedJARStructureUnitTestCase extends AbstractJARStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(CombinedJARStructureUnitTestCase.class);
+ }
+
+ public CombinedJARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testRootNotAnArchive() throws Throwable
+ {
+ // The file structure deployer recognises these for the combined test
+ assertDeployNoChildren("/structure/jar/notanarchive", "NotAnArchive.jar");
+ assertDeployNoChildren("/structure/jar/notanarchive", "NotAnArchive.zip");
+ }
+
+ public void testSubdeploymentIsKnownFile() throws Throwable
+ {
+ // The file structure recognises the subdeployer for the combined test
+ VFSDeploymentContext context = assertDeploy("/structure/file", "simple");
+ assertChildContexts(context, "simple-service.xml");
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithAllStructureDeployers(deployment);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/ConfiguredSuffixJARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/ConfiguredSuffixJARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/ConfiguredSuffixJARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,97 @@
+/*
+* 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.structure.jar.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.test.BaseTestCase;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * ConfiguredSuffixJARStructureUnitTestCase.
+ *
+ * @author kabir at jboss.org
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConfiguredSuffixJARStructureUnitTestCase extends BaseTestCase
+{
+ /** The file structure deployer */
+ private static final Set<String> defaultSuffixes = JarUtils.getSuffixes();
+
+ public static Test suite()
+ {
+ return new TestSuite(ConfiguredSuffixJARStructureUnitTestCase.class);
+ }
+
+ public ConfiguredSuffixJARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDefaults() throws Exception
+ {
+ assertNotNull("default suffixes should not be null", defaultSuffixes);
+ assertTrue("default suffixes size should be > 0", defaultSuffixes.size() > 0);
+ }
+
+ public void testNewUsingDefaults() throws Exception
+ {
+ JARStructure structure = new JARStructure();
+
+ Set<String> suffixes = structure.getSuffixes();
+ assertNotNull(suffixes);
+ assertEquals(defaultSuffixes.size(), suffixes.size());
+ for (String suff : defaultSuffixes)
+ {
+ suffixes.contains(suff);
+ }
+ }
+
+ public void testOverwriteDefaults() throws Exception
+ {
+ try
+ {
+ Set<String> newSuffixes = new HashSet<String>();
+ newSuffixes.add(".bar");
+ newSuffixes.add(".tar");
+ newSuffixes.add(".far");
+
+ JARStructure structure = new JARStructure(newSuffixes);
+ Set<String> suffixes = structure.getSuffixes();
+ assertNotNull(suffixes);
+ assertEquals(3, suffixes.size());
+ assertTrue(suffixes.contains(".bar"));
+ assertTrue(suffixes.contains(".tar"));
+ assertTrue(suffixes.contains(".bar"));
+ }
+ finally
+ {
+ JarUtils.setJarSuffixes(defaultSuffixes);
+ }
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/JARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/JARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/jar/test/JARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,53 @@
+/*
+* 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.structure.jar.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * JARStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JARStructureUnitTestCase extends AbstractJARStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(JARStructureUnitTestCase.class);
+ }
+
+ public JARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithStructureDeployer(deployment, new JARStructure());
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/AbstractWARStructureTest.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/AbstractWARStructureTest.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/AbstractWARStructureTest.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,77 @@
+/*
+* 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.structure.war.test;
+
+import java.util.List;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractWARStructureTest.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractWARStructureTest extends AbstractStructureTest
+{
+ public AbstractWARStructureTest(String name)
+ {
+ super(name);
+ }
+
+ public void testSimple() throws Throwable
+ {
+ assertDeployNoChildren("/structure/war/simple", "simple.war");
+ }
+
+ public void testNotAnArchive() throws Throwable
+ {
+ assertNotValid("/structure/war/notanarchive", "notanarchive.war");
+ }
+
+ public void testWarDirectory() throws Throwable
+ {
+ assertDeployNoChildren("/structure/war", "directory.war");
+ }
+
+ public void testDirectoryNotAWar() throws Throwable
+ {
+ assertNotValid("/structure/war", "directorynotawar");
+ }
+
+ public void testDirectoryWithWebInf() throws Throwable
+ {
+ VFSDeploymentContext war = assertDeployNoChildren("/structure/war", "directorywithwebinf");
+ List<VirtualFile> classpath = war.getClassPath();
+ assertNotNull("classpath", classpath);
+ assertEquals("classpath.size = 3", 3, classpath.size());
+ VirtualFile warFile = war.getRoot();
+ VirtualFile classes = warFile.findChild("WEB-INF/classes");
+ assertTrue("WEB-INF/classes in classpath", classpath.contains(classes));
+ VirtualFile j0 = warFile.findChild("WEB-INF/lib/j0.jar");
+ assertTrue("WEB-INF/lib/j0.jar in classpath", classpath.contains(j0));
+ VirtualFile j1 = warFile.findChild("WEB-INF/lib/j1.jar");
+ assertTrue("WEB-INF/lib/j1.jar in classpath", classpath.contains(j1));
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/CombinedWARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/CombinedWARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/CombinedWARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,64 @@
+/*
+* 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.structure.war.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * CombinedWARStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CombinedWARStructureUnitTestCase extends AbstractWARStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(CombinedWARStructureUnitTestCase.class);
+ }
+
+ public CombinedWARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDirectoryNotAWar() throws Throwable
+ {
+ // The jar deployer recognises in the combined test
+ assertDeployNoChildren("/structure/war", "directorynotawar");
+ }
+
+ public void testNotAnArchive() throws Throwable
+ {
+ // The file deployer recognises in the combined test
+ assertDeployNoChildren("/structure/war/notanarchive", "notanarchive.war");
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithAllStructureDeployers(deployment);
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/WARStructureUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/WARStructureUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/war/test/WARStructureUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,53 @@
+/*
+* 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.structure.war.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+
+/**
+ * WARStructureUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WARStructureUnitTestCase extends AbstractWARStructureTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(WARStructureUnitTestCase.class);
+ }
+
+ public WARStructureUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected VFSDeploymentContext determineStructure(VFSDeployment deployment) throws Exception
+ {
+ return determineStructureWithStructureDeployer(deployment, new WARStructure());
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/VFSStructureBuilderTestSuite.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/VFSStructureBuilderTestSuite.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/VFSStructureBuilderTestSuite.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,51 @@
+/*
+* 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.structurebuilder;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.deployers.vfs.structurebuilder.test.VFSStructureBuilderUnitTestCase;
+
+/**
+ * VFSStructureBuilderTestSuite.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructureBuilderTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS Structure Builder Tests");
+
+ suite.addTest(VFSStructureBuilderUnitTestCase.suite());
+
+ return suite;
+ }
+}
Added: projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java (rev 0)
+++ projects/microcontainer/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2007-06-27 16:00:12 UTC (rev 63687)
@@ -0,0 +1,135 @@
+/*
+* 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.structurebuilder.test;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.DeploymentFactory;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.StructureBuilder;
+import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.structure.structurebuilder.StructureBuilderTest;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSStructureBuilderUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructureBuilderUnitTestCase extends StructureBuilderTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(VFSStructureBuilderUnitTestCase.class);
+ }
+
+ public VFSStructureBuilderUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected StructureBuilder getStructureBuilder()
+ {
+ return new VFSStructureBuilder();
+ }
+
+ protected Deployment createDeployment()
+ {
+ URL url = getDeploymentURL();
+ try
+ {
+ VirtualFile file = VFS.getRoot(url);
+ return new AbstractVFSDeployment(file);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Failed to get virtual file " + url + " for " + getName());
+ }
+ }
+
+ protected DeploymentFactory getDeploymentFactory()
+ {
+ return VFSDeploymentFactory.getInstance();
+ }
+
+ protected String getDeploymentName()
+ {
+ return getDeploymentURL().toString();
+ }
+
+ protected URL getDeploymentURL()
+ {
+ String name = "/structurebuilder/predetermined/" + getName();
+ URL url = getResource(name);
+ if (url == null)
+ fail("Unable to find resource: " + name);
+ return url;
+ }
+
+ protected void checkContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ VFSDeploymentContext vfsContext = (VFSDeploymentContext) context;
+ checkMetaDataLocation(vfsContext, contextInfo);
+ checkClassPath(vfsContext, contextInfo);
+ }
+
+ protected void checkMetaDataLocation(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ String metaDataPath = contextInfo.getMetaDataPath();
+ VirtualFile metaDataLocation = context.getMetaDataLocation();
+
+ if (metaDataPath == null)
+ assertNull(metaDataLocation);
+ else
+ {
+ VirtualFile root = context.getRoot();
+ VirtualFile expected = root.findChild(metaDataPath);
+ assertEquals(expected, metaDataLocation);
+ }
+ }
+
+ protected void checkClassPath(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ List<ClassPathEntry> classPathEntries = contextInfo.getClassPath();
+ List<VirtualFile> classPath = context.getClassPath();
+
+ if (classPathEntries == null)
+ assertNull(classPath);
+ else
+ {
+ // TODO test it got the correct classpath
+ }
+ }
+}
More information about the jboss-cvs-commits
mailing list