[jboss-cvs] JBossAS SVN: r73612 - in projects/jboss-deployers/trunk/deployers-vfs/src: resources/tests/structure/ear/scanning.ear and 41 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 23 06:15:08 EDT 2008


Author: alesj
Date: 2008-05-23 06:15:08 -0400 (Fri, 23 May 2008)
New Revision: 73612

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/META-INF/empty.txt
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/ear/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/ear/support/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.class
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/META-INF/MANIFEST.MF
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/ear/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/ear/support/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.class
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/META-INF/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/META-INF/MANIFEST.MF
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/ear/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/ear/support/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestService.class
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/
   projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/AppClient.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Connector.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Service.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Servlet.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Stateless.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestService.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.java
Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java
Log:
[JBDEPLOY-10]; ear annotations scanning.

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/META-INF/empty.txt
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/META-INF/empty.txt	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/META-INF/empty.txt	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1 @@
+empty
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/appc.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/META-INF/MANIFEST.MF	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,7 @@
+Name: java/util/
+Specification-Title: "Java Utility Classes"
+Specification-Version: "1.2"
+Specification-Vendor: "Red Hat, Inc.".
+Implementation-Title: "java.util"
+Implementation-Version: "build57"
+Implementation-Vendor: "Red Hat, Inc."
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/ejbs.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/META-INF/MANIFEST.MF	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,7 @@
+Name: java/util/
+Specification-Title: "Java Utility Classes"
+Specification-Version: "1.2"
+Specification-Vendor: "Red Hat, Inc.".
+Implementation-Title: "java.util"
+Implementation-Version: "build57"
+Implementation-Vendor: "Red Hat, Inc."
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestService.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/services.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestService.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
===================================================================
(Binary files differ)


Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/resources/tests/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/AppClient.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/AppClient.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/AppClient.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,35 @@
+/*
+* 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.ear.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface AppClient
+{
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Connector.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Connector.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Connector.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,35 @@
+/*
+* 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.ear.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface Connector
+{
+}
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2008-05-23 06:38:52 UTC (rev 73611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -23,13 +23,20 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
+import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 
+import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloading.plugins.vfs.VFSResourceVisitor;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.deployers.plugins.annotations.GenericAnnotationResourceVisitor;
 import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
 import org.jboss.deployers.spi.structure.ContextInfo;
 import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
@@ -44,6 +51,7 @@
  * type of deployer.
  *
  * @author Scott.Stark at jboss.org
+ * @author Ales.Justin at jboss.org
  * @version $Revision:$
  */
 public class MockEarStructureDeployer extends AbstractStructureDeployer
@@ -209,32 +217,35 @@
             String filename = earRelativePath(earPath, vfArchive.getPathName());
             // Check if the module already exists, i.e. it is declared in jboss-app.xml
             EarModule moduleMetaData = getModule(modules, filename);
-            int type = typeFromSuffix(filename, vfArchive);
-            if (type >= 0 && moduleMetaData == null)
+            if (moduleMetaData == null)
             {
-               String typeString = null;
-               switch(type)
+               int type = typeFromSuffix(filename, vfArchive);
+               if (type >= 0)
                {
-                  case J2eeModuleMetaData.EJB:
-                     typeString = "Ejb";
-                     break;
-                  case J2eeModuleMetaData.CLIENT:
-                     typeString = "Java";
-                     break;
-                  case J2eeModuleMetaData.CONNECTOR:
-                     typeString = "Connector";
-                     break;
-                  case J2eeModuleMetaData.SERVICE:
-                  case J2eeModuleMetaData.HAR:
-                     typeString = "Service";
-                     break;
-                  case J2eeModuleMetaData.WEB:
-                     typeString = "Web";
-                     break;
+                  String typeString = null;
+                  switch(type)
+                  {
+                     case J2eeModuleMetaData.EJB:
+                        typeString = "Ejb";
+                        break;
+                     case J2eeModuleMetaData.CLIENT:
+                        typeString = "Java";
+                        break;
+                     case J2eeModuleMetaData.CONNECTOR:
+                        typeString = "Connector";
+                        break;
+                     case J2eeModuleMetaData.SERVICE:
+                     case J2eeModuleMetaData.HAR:
+                        typeString = "Service";
+                        break;
+                     case J2eeModuleMetaData.WEB:
+                        typeString = "Web";
+                        break;
+                  }
+                  moduleMetaData = new EarModule(typeString + "Module" + counter, filename);
+                  modules.add(moduleMetaData);
+                  counter++;
                }
-               moduleMetaData = new EarModule(typeString + "Module" + counter, filename);
-               modules.add(moduleMetaData);
-               counter++;
             }
          }
       }
@@ -282,7 +293,9 @@
             }
             else
             {
-               type = J2eeModuleMetaData.EJB;
+               Integer dt = determineType(archive);
+               if (dt != null)
+                  type = dt;
             }
          }
          else if (ejbXml != null || jbossXml != null)
@@ -291,13 +304,59 @@
          }
          else
          {
-            type = J2eeModuleMetaData.EJB;
+            Integer dt = determineType(archive);
+            if (dt != null)
+               type = dt;
          }
       }
 
       return type;
    }
 
+   private Integer determineType(VirtualFile archive)
+   {
+      ClassLoader classLoader = getClass().getClassLoader();
+      GenericAnnotationResourceVisitor visitor = new GenericAnnotationResourceVisitor(classLoader);
+      ClassFilter included = null;
+      ClassFilter excluded = null;
+      ResourceFilter filter = org.jboss.classloading.spi.visitor.ClassFilter.INSTANCE;
+      VFSResourceVisitor.visit(new VirtualFile[]{archive}, included, excluded, classLoader, visitor, filter);
+      AnnotationEnvironment env = visitor.getEnv();
+
+      Integer ejbs = getType(env, Stateless.class, J2eeModuleMetaData.EJB);
+      if (ejbs != null)
+      {
+         // check some conflicts - e.g. no @Servlet, ...?
+         return ejbs;
+      }
+
+      Integer services = getType(env, Service.class, J2eeModuleMetaData.SERVICE);
+      if (services != null)
+      {
+         // check some conflicts - e.g. no @Servlet, ...?
+         return services;
+      }
+
+      Integer appc = getType(env, AppClient.class, J2eeModuleMetaData.CLIENT);
+      if (appc != null)
+      {
+         // check some conflicts - e.g. no @Servlet, ...?
+         return appc;
+      }
+
+      Integer wars = getType(env, Servlet.class, J2eeModuleMetaData.WEB);
+      if (wars != null)
+         return wars;
+
+      return null;
+   }
+
+   private Integer getType(AnnotationEnvironment env, Class<? extends Annotation> annotation, int type)
+   {
+      Set<Class<?>> classes = env.classIsAnnotatedWith(annotation);
+      return (classes != null && classes.isEmpty() == false) ? type : null;
+   }
+
    private String earRelativePath(String earPath, String pathName)
    {
       StringBuilder tmp = new StringBuilder(pathName);

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Service.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Service.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Service.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,35 @@
+/*
+* 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.ear.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface Service
+{
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Servlet.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Servlet.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Servlet.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,35 @@
+/*
+* 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.ear.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface Servlet
+{
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Stateless.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Stateless.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/Stateless.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,35 @@
+/*
+* 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.ear.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface Stateless
+{
+}

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestAppC.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,30 @@
+/*
+* 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.ear.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at AppClient
+public class TestAppC
+{
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestEJB.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,30 @@
+/*
+* 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.ear.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Stateless
+public class TestEJB
+{
+}

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestService.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestService.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestService.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,30 @@
+/*
+* 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.ear.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Service
+public class TestService
+{
+}
\ No newline at end of file

Added: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -0,0 +1,30 @@
+/*
+* 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.ear.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Servlet
+public class TestServlet
+{
+}
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java	2008-05-23 06:38:52 UTC (rev 73611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/test/EARStructureUnitTestCase.java	2008-05-23 10:15:08 UTC (rev 73612)
@@ -63,7 +63,7 @@
    public void testScanEAR() throws Throwable
    {
       VFSDeploymentContext ear = assertDeploy("/structure/ear", "noappxml.ear");
-      assertChildContexts(ear, "client.jar", "foobar.sar", "known.jar", "mf.jar", "ts.rar", "webapp.war");
+      assertChildContexts(ear, "client.jar", "foobar.sar", "known.jar", "ts.rar", "webapp.war");
    }
 
    /**
@@ -73,7 +73,7 @@
    public void testMixedEAR() throws Throwable
    {
       VFSDeploymentContext ear = assertDeploy("/structure/ear", "someappxml.ear");
-      assertChildContexts(ear, "client.jar", "foobar.sar", "known.jar", "mf.jar", "ts.rar", "webapp.war");
+      assertChildContexts(ear, "client.jar", "foobar.sar", "known.jar", "ts.rar", "webapp.war");
    }
 
    /**
@@ -131,4 +131,15 @@
       assertNoMetaDataFile(ear, "lib/lib0.jar");
       assertFile(ear, "lib/lib0.jar");
    }
+
+   /**
+    * Validate annotation scanning.
+    *  
+    * @throws Throwable for any problem
+    */
+   public void testEARAnnotationScanning() throws Throwable
+   {
+      VFSDeploymentContext ear = assertDeploy("/structure/ear", "scanning.ear");
+      assertChildContexts(ear, "appc.jar", "ejbs.jar", "web.jar", "services.jar");
+   }
 }




More information about the jboss-cvs-commits mailing list