[jboss-cvs] JBossAS SVN: r86043 - in projects/jboss-deployers/trunk/deployers-vfs/src/test: java/org/jboss/test/deployers/vfs/annotations/test and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 18 09:16:12 EDT 2009


Author: alesj
Date: 2009-03-18 09:16:12 -0400 (Wed, 18 Mar 2009)
New Revision: 86043

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/MarkedAnnotation.java
Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/Marked.java
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AbstractAnnotationsScanningUnitTest.java
   projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/annotations/basic-scan/META-INF/jboss-scanning.xml
Log:
Test annotation on annotation.

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/Marked.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/Marked.java	2009-03-18 12:21:46 UTC (rev 86042)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/Marked.java	2009-03-18 13:16:12 UTC (rev 86043)
@@ -21,13 +21,17 @@
 */
 package org.jboss.test.deployers.vfs.annotations.support;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
 
 /**
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+ at MarkedAnnotation
 public @interface Marked
 {
 }

Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/MarkedAnnotation.java (from rev 85889, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/Marked.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/MarkedAnnotation.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/support/MarkedAnnotation.java	2009-03-18 13:16:12 UTC (rev 86043)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.annotations.support;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Target({ElementType.ANNOTATION_TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface MarkedAnnotation
+{
+}
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AbstractAnnotationsScanningUnitTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AbstractAnnotationsScanningUnitTest.java	2009-03-18 12:21:46 UTC (rev 86042)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/annotations/test/AbstractAnnotationsScanningUnitTest.java	2009-03-18 13:16:12 UTC (rev 86043)
@@ -26,6 +26,7 @@
 import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.test.deployers.vfs.annotations.support.NoExtRecurseFilter;
 import org.jboss.test.deployers.vfs.annotations.support.ext.External;
 import org.jboss.test.deployers.vfs.annotations.support.jar.JarMarkOnClass;
 import org.jboss.test.deployers.vfs.annotations.support.jar.impl.JarMarkOnClassImpl;
@@ -70,6 +71,12 @@
       assertEar(unit);
       try
       {
+         AnnotationEnvironment env = unit.getAttachment(AnnotationEnvironment.class);
+         assertNotNull(env);
+         Set annotations = env.classIsAnnotatedWith("org.jboss.test.deployers.vfs.annotations.support.MarkedAnnotation");
+         assertNotNull(annotations);
+         assertEquals(1, annotations.size());
+
          DeploymentUnit jarUnit = assertChild(unit, "simple.jar");
          assertJar(jarUnit);
          DeploymentUnit webUnit = assertChild(unit, "simple.war");
@@ -113,6 +120,8 @@
       addPackage(util, Util.class);
       AssembledDirectory ext = earLib.mkdir("ext.jar");
       addPackage(ext, External.class);
+      AssembledDirectory ann = earLib.mkdir("ann.jar");
+      addPackage(ann, NoExtRecurseFilter.class);
       return topLevel;
    }
 }
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2009-03-18 12:21:46 UTC (rev 86042)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2009-03-18 13:16:12 UTC (rev 86043)
@@ -126,7 +126,7 @@
             {
                List<VirtualFile> archives = lib.getChildren(earLibFilter);
                for (VirtualFile archive : archives)
-                  super.addClassPath(structureContext, archive, true, true, context);
+                  addClassPath(structureContext, archive, true, true, context);
             }
          }
          catch (IOException ignored)

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/annotations/basic-scan/META-INF/jboss-scanning.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/annotations/basic-scan/META-INF/jboss-scanning.xml	2009-03-18 12:21:46 UTC (rev 86042)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/annotations/basic-scan/META-INF/jboss-scanning.xml	2009-03-18 13:16:12 UTC (rev 86043)
@@ -2,4 +2,7 @@
   <path name="lib/util.jar">
     <include name="org.jboss.test.deployers.vfs.annotations.support.util"/>
   </path>
+  <path name="lib/ann.jar">
+    <include name="org.jboss.test.deployers.vfs.annotations.support"/>
+  </path>
 </scanning>




More information about the jboss-cvs-commits mailing list