[jboss-cvs] JBossAS SVN: r103403 - in projects/scanning/trunk: deployers/src/main/java/org/jboss/scanning/deployers and 28 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 1 03:57:16 EDT 2010
Author: alesj
Date: 2010-04-01 03:57:11 -0400 (Thu, 01 Apr 2010)
New Revision: 103403
Added:
projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AllRecurseFilter.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/Marked.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MarkedAnnotation.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MockAnnScanningPluginFactory.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/NoExtRecurseFilter.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ScanningMDFilter.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ext/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ext/External.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClass.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuper.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuperAnnotated.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnFiled.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnMethod.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassExt.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassImpl.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/Util.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClass.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuper.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuperAnnotated.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnFiled.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnMethod.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassExt.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassImpl.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/warlib/
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/warlib/SomeUIClass.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AbstractAnnotationsScanningTest.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.java
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.java
projects/scanning/trunk/testsuite/src/test/resources/annotations/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/application.properties
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/jboss-scanning.xml
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/MANIFEST.MF
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/jboss-scanning.xml
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/jboss-scanning.xml
projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/web.xml
projects/scanning/trunk/testsuite/src/test/resources/org/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.xml
projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.xml
Modified:
projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/ScanningDeployer.java
projects/scanning/trunk/pom.xml
projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DefaultScanner.java
projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DeploymentUnitScanner.java
projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/CachingResourceOwnerFinder.java
projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/ScanningPlugin.java
projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java
projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/ScanningPluginWrapper.java
projects/scanning/trunk/testsuite/pom.xml
projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsTest.java
Log:
Add more annotations scanning tests -- currently some failures.
Modified: projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/ScanningDeployer.java
===================================================================
--- projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/ScanningDeployer.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/ScanningDeployer.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -97,7 +97,7 @@
*
* @param factory the factory
*/
- public void addPlugin(DeploymentScanningPluginFactory factory)
+ public void addFactory(DeploymentScanningPluginFactory factory)
{
if (factory == null)
throw new IllegalArgumentException("Null factory");
@@ -110,7 +110,7 @@
*
* @param factory the factory
*/
- public void removePlugin(DeploymentScanningPluginFactory factory)
+ public void removeFactory(DeploymentScanningPluginFactory factory)
{
if (factory == null)
return;
Modified: projects/scanning/trunk/pom.xml
===================================================================
--- projects/scanning/trunk/pom.xml 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/pom.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -31,6 +31,7 @@
<version.org.jboss.common.core>2.2.17.GA</version.org.jboss.common.core>
<version.org.jboss.vfs>3.0.0.CR5</version.org.jboss.vfs>
<version.org.jboss.reflect>2.2.0.Alpha4</version.org.jboss.reflect>
+ <version.org.jboss.mdr>2.2.0.Alpha2</version.org.jboss.mdr>
<version.org.jboss.man>2.1.1.SP1</version.org.jboss.man>
<version.org.jboss.classloader>2.2.0.Alpha4</version.org.jboss.classloader>
<version.org.jboss.deployers>2.2.0.Alpha4</version.org.jboss.deployers>
@@ -136,6 +137,11 @@
<version>${version.org.jboss.man}</version>
</dependency>
<dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>${version.org.jboss.mdr}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-metatype</artifactId>
<version>${version.org.jboss.man}</version>
@@ -188,12 +194,6 @@
<groupId>org.jboss.deployers</groupId>
<artifactId>jboss-deployers-vfs</artifactId>
<version>${version.org.jboss.deployers}</version>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.mcann</groupId>
- <artifactId>mcann-core</artifactId>
- </exclusion>
- </exclusions>
<type>test-jar</type>
</dependency>
<dependency>
Modified: projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DefaultScanner.java
===================================================================
--- projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DefaultScanner.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DefaultScanner.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -29,7 +29,6 @@
import org.jboss.classloading.plugins.vfs.VFSResourceVisitor;
import org.jboss.classloading.plugins.visitor.FederatedResourceVisitor;
import org.jboss.classloading.spi.visitor.ResourceFilter;
-import org.jboss.classloading.spi.visitor.ResourceVisitor;
import org.jboss.scanning.spi.ScanningHandle;
import org.jboss.scanning.spi.ScanningPlugin;
import org.jboss.scanning.spi.helpers.UrlScanner;
@@ -49,7 +48,6 @@
protected VirtualFile[] excludedRoots;
protected ClassFilter included;
protected ClassFilter excluded;
- protected ResourceFilter recurseFilter;
public DefaultScanner(ClassLoader classLoader, URL... roots)
{
@@ -57,7 +55,6 @@
this.classLoader = classLoader;
}
- @Override
protected void scan(Set<ScanningPlugin> plugins) throws Exception
{
URL[] urls = getRoots();
@@ -66,8 +63,15 @@
{
roots[i] = VFS.getChild(urls[i]);
}
- FederatedResourceVisitor visitor = new FederatedResourceVisitor(plugins.toArray(new ResourceVisitor[plugins.size()]));
+
+ ScanningPlugin[] array = plugins.toArray(new ScanningPlugin[plugins.size()]);
+ ResourceFilter[] recurseFilters = new ResourceFilter[array.length];
+ for (int i = 0; i < array.length; i++)
+ recurseFilters[i] = array[i].getRecurseFilter();
+
+ FederatedResourceVisitor visitor = new FederatedResourceVisitor(array, array, recurseFilters);
ResourceFilter filter = visitor.getFilter();
+ ResourceFilter recurseFilter = visitor.getRecurseFilter();
// something in javassist uses TCL
ClassLoader tccl = SecurityActions.setContextClassLoader(classLoader);
@@ -81,7 +85,6 @@
}
}
- @Override
protected ScanningHandle createHandle(ScanningPlugin plugin)
{
return plugin.createHandle();
@@ -101,9 +104,4 @@
{
this.excluded = excluded;
}
-
- public void setRecurseFilter(ResourceFilter recurseFilter)
- {
- this.recurseFilter = recurseFilter;
- }
}
Modified: projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DeploymentUnitScanner.java
===================================================================
--- projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DeploymentUnitScanner.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DeploymentUnitScanner.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -43,8 +43,6 @@
{
/** The deployment unit */
private final DeploymentUnit unit;
- /** The recursion filter */
- private ResourceFilter recurseFilter;
public DeploymentUnitScanner(DeploymentUnit unit, URL... roots)
{
@@ -61,8 +59,13 @@
throw new IllegalArgumentException("No module found: " + unit);
ScanningPlugin[] array = plugins.toArray(new ScanningPlugin[plugins.size()]);
- FederatedResourceVisitor visitor = new FederatedResourceVisitor(array, array, null);
+ ResourceFilter[] recurseFilters = new ResourceFilter[array.length];
+ for (int i = 0; i < array.length; i++)
+ recurseFilters[i] = array[i].getRecurseFilter();
+
+ FederatedResourceVisitor visitor = new FederatedResourceVisitor(array, array, recurseFilters);
ResourceFilter filter = visitor.getFilter();
+ ResourceFilter recurseFilter = visitor.getRecurseFilter();
// something in javassist uses TCL
ClassLoader tccl = SecurityActions.setContextClassLoader(unit.getClassLoader());
@@ -83,14 +86,4 @@
unit.addAttachment(plugin.getHandleKey(), handle, plugin.getHandleInterface());
return handle;
}
-
- /**
- * Set the recurse filter.
- *
- * @param recurseFilter the recurse filter
- */
- public void setRecurseFilter(ResourceFilter recurseFilter)
- {
- this.recurseFilter = recurseFilter;
- }
}
\ No newline at end of file
Modified: projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/CachingResourceOwnerFinder.java
===================================================================
--- projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/CachingResourceOwnerFinder.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/CachingResourceOwnerFinder.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -60,7 +60,7 @@
try
{
URL url = resource.getUrl();
- File file = new File(url.toURI());
+ File file = new File(url.getPath());
if (file.exists()) // does the file exist
return url;
url = cache.get(file); // is the file cached
Modified: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/ScanningPlugin.java
===================================================================
--- projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/ScanningPlugin.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/ScanningPlugin.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -42,4 +42,11 @@
* @return the handle's key
*/
String getHandleKey();
+
+ /***
+ * Get recurse filter.
+ *
+ * @return the recurse filter
+ */
+ ResourceFilter getRecurseFilter();
}
\ No newline at end of file
Modified: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java
===================================================================
--- projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -23,6 +23,7 @@
package org.jboss.scanning.spi.helpers;
import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
import org.jboss.scanning.spi.ScanningHandle;
import org.jboss.scanning.spi.ScanningPlugin;
@@ -57,4 +58,9 @@
{
return getFilter().accepts(resource);
}
+
+ public ResourceFilter getRecurseFilter()
+ {
+ return AllRecurseFilter.INSTANCE;
+ }
}
\ No newline at end of file
Copied: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AllRecurseFilter.java (from rev 103312, projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java)
===================================================================
--- projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AllRecurseFilter.java (rev 0)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AllRecurseFilter.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.scanning.spi.helpers;
+
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+
+/**
+ * Accept all recurse filter.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class AllRecurseFilter implements ResourceFilter
+{
+ public static final ResourceFilter INSTANCE = new AllRecurseFilter();
+
+ public boolean accepts(ResourceContext resource)
+ {
+ return true;
+ }
+}
\ No newline at end of file
Modified: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/ScanningPluginWrapper.java
===================================================================
--- projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/ScanningPluginWrapper.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/ScanningPluginWrapper.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -71,6 +71,11 @@
return delegate.getHandleKey();
}
+ public ResourceFilter getRecurseFilter()
+ {
+ return delegate.getRecurseFilter();
+ }
+
public boolean accepts(ResourceContext resource)
{
URL url = resource.getUrl();
Modified: projects/scanning/trunk/testsuite/pom.xml
===================================================================
--- projects/scanning/trunk/testsuite/pom.xml 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/testsuite/pom.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -55,6 +55,10 @@
<artifactId>jboss-managed</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-metatype</artifactId>
</dependency>
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/Marked.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/Marked.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/Marked.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,37 @@
+/*
+* 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.scanning.annotations.support;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+ at MarkedAnnotation
+public @interface Marked
+{
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MarkedAnnotation.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MarkedAnnotation.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MarkedAnnotation.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @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
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MockAnnScanningPluginFactory.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MockAnnScanningPluginFactory.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/MockAnnScanningPluginFactory.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.test.scanning.annotations.support;
+
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.scanning.annotations.plugins.AnnotationsScanningPlugin;
+import org.jboss.scanning.annotations.plugins.DefaultAnnotationRepository;
+import org.jboss.scanning.annotations.spi.AnnotationIndex;
+import org.jboss.scanning.plugins.DeploymentScanningPluginFactory;
+import org.jboss.scanning.plugins.helpers.DeploymentUtilsFactory;
+import org.jboss.scanning.plugins.helpers.ResourceOwnerFinder;
+import org.jboss.scanning.plugins.visitor.ReflectProvider;
+import org.jboss.scanning.spi.ScanningPlugin;
+
+/**
+ * Annotations scanning plugin factory.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class MockAnnScanningPluginFactory implements DeploymentScanningPluginFactory<DefaultAnnotationRepository, AnnotationIndex>
+{
+ public boolean isRelevant(DeploymentUnit unit)
+ {
+ // any better check? -- metadata complete is already done elsewhere
+ // see JBossMetaDataDeploymentUnitFilter in JBossAS
+ return true;
+ }
+
+ public ScanningPlugin<DefaultAnnotationRepository, AnnotationIndex> create(DeploymentUnit unit)
+ {
+ ReflectProvider provider = DeploymentUtilsFactory.getProvider(unit);
+ ResourceOwnerFinder finder = DeploymentUtilsFactory.getFinder(unit);
+ return new AnnotationsScanningPlugin(provider, finder, unit.getClassLoader())
+ {
+ @Override
+ public ResourceFilter getRecurseFilter()
+ {
+ return new NoExtRecurseFilter();
+ }
+ };
+ }
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/NoExtRecurseFilter.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/NoExtRecurseFilter.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/NoExtRecurseFilter.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,37 @@
+/*
+* 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.scanning.annotations.support;
+
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class NoExtRecurseFilter implements ResourceFilter
+{
+ public boolean accepts(ResourceContext resource)
+ {
+ String urlString = resource.getUrl().toExternalForm();
+ return urlString.contains("ext.jar") == false;
+ }
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ScanningMDFilter.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ScanningMDFilter.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ScanningMDFilter.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,126 @@
+/*
+* 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.scanning.annotations.support;
+
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.classloading.spi.visitor.ResourceContext;
+import org.jboss.classloading.spi.visitor.ResourceFilter;
+import org.jboss.deployers.spi.annotations.PathMetaData;
+import org.jboss.deployers.spi.annotations.ScanningMetaData;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.plugins.annotations.ScanningMetaDataResourceFilter;
+import org.jboss.deployers.vfs.spi.structure.helpers.VFS2BaseBridgeDeploymentUnitFilter;
+import org.jboss.logging.Logger;
+
+/**
+ * ScanningDeploymentUnitFilter
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ScanningMDFilter extends VFS2BaseBridgeDeploymentUnitFilter
+{
+ private Logger log = Logger.getLogger(getClass());
+
+ protected boolean doAccepts(DeploymentUnit unit)
+ {
+ ScanningMetaData smd = unit.getAttachment(ScanningMetaData.class);
+ if (smd != null)
+ {
+ // recurse
+ ResourceFilter recurse = createRecurseFilter(smd);
+ if (recurse != null)
+ {
+ ResourceFilter previousRecurse = unit.addAttachment(ResourceFilter.class.getName() + ".recurse", recurse, ResourceFilter.class);
+ if (previousRecurse != null)
+ log.debugf("Overridding previous recurse filter: %1s", previousRecurse);
+ }
+
+ // resource
+ ResourceFilter filter = createResourceFilter(smd);
+ if (filter != null)
+ {
+ ResourceFilter previousFilter = unit.addAttachment(ResourceFilter.class.getName() + ".resource", filter, ResourceFilter.class);
+ if (previousFilter != null)
+ log.debugf("Overridding previous resource filter: %1s", previousFilter);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Create recurse filter.
+ *
+ * @param smd the scanning metadata
+ * @return recurse filter
+ */
+ protected ResourceFilter createRecurseFilter(ScanningMetaData smd)
+ {
+ return new ScanningMetaDataRecurseFilter(smd);
+ }
+
+ /**
+ * Create resource filter.
+ *
+ * @param smd the scanning metadata
+ * @return resource filter
+ */
+ protected ResourceFilter createResourceFilter(ScanningMetaData smd)
+ {
+ return new ScanningMetaDataResourceFilter(smd);
+ }
+
+ /**
+ * Simple recurse filter.
+ * It searches for path substring in url string.
+ */
+ private class ScanningMetaDataRecurseFilter implements ResourceFilter
+ {
+ private ScanningMetaData smd;
+
+ private ScanningMetaDataRecurseFilter(ScanningMetaData smd)
+ {
+ this.smd = smd;
+ }
+
+ public boolean accepts(ResourceContext resource)
+ {
+ URL url = resource.getUrl();
+ String urlString = url.toExternalForm();
+ List<PathMetaData> paths = smd.getPaths();
+ if (paths != null && paths.isEmpty() == false)
+ {
+ for (PathMetaData pmd : paths)
+ {
+ String name = pmd.getPathName();
+ // url contains path
+ if (urlString.contains(name))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ext/External.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ext/External.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/ext/External.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,40 @@
+/*
+* 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.scanning.annotations.support.ext;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class External
+{
+ @SuppressWarnings("unused")
+ private @Marked Object foo;
+
+ @Marked
+ public int getInt()
+ {
+ return 0;
+ }
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClass.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClass.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClass.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.jar;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class JarMarkOnClass extends JarMarkOnClassSuper
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuper.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuper.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuper.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,29 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.scanning.annotations.support.jar;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JarMarkOnClassSuper extends JarMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuperAnnotated.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuperAnnotated.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnClassSuperAnnotated.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.jar;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class JarMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnFiled.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnFiled.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnFiled.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,33 @@
+/*
+* 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.scanning.annotations.support.jar;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JarMarkOnFiled
+{
+ @SuppressWarnings("unused")
+ private @Marked Object field;
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnMethod.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnMethod.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/JarMarkOnMethod.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.jar;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JarMarkOnMethod
+{
+ @Marked
+ public String getJndiName()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassExt.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassExt.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassExt.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,33 @@
+/*
+* 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.scanning.annotations.support.jar.impl;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+import org.jboss.test.scanning.annotations.support.jar.JarMarkOnClassSuper;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class JarMarkOnClassExt extends JarMarkOnClassSuper
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassImpl.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassImpl.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/jar/impl/JarMarkOnClassImpl.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.jar.impl;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class JarMarkOnClassImpl
+{
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/Util.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/Util.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/Util.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,39 @@
+/*
+* 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.scanning.annotations.support.util;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class Util
+{
+ @SuppressWarnings("unused")
+ private @Marked Object marked;
+
+ @Marked
+ public void setSomething(String something)
+ {
+ }
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClass.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClass.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClass.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.war;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class WebMarkOnClass extends WebMarkOnClassSuper
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuper.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuper.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuper.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,29 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.scanning.annotations.support.war;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class WebMarkOnClassSuper extends WebMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuperAnnotated.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuperAnnotated.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnClassSuperAnnotated.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.war;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class WebMarkOnClassSuperAnnotated
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnFiled.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnFiled.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnFiled.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,33 @@
+/*
+* 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.scanning.annotations.support.war;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class WebMarkOnFiled
+{
+ @SuppressWarnings("unused")
+ private @Marked Object field;
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnMethod.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnMethod.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/WebMarkOnMethod.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.war;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class WebMarkOnMethod
+{
+ @Marked
+ public String getJndiName()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassExt.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassExt.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassExt.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,33 @@
+/*
+* 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.scanning.annotations.support.war.impl;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+import org.jboss.test.scanning.annotations.support.war.WebMarkOnClassSuper;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class WebMarkOnClassExt extends WebMarkOnClassSuper
+{
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassImpl.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassImpl.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/war/impl/WebMarkOnClassImpl.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.war.impl;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class WebMarkOnClassImpl
+{
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/warlib/SomeUIClass.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/warlib/SomeUIClass.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/warlib/SomeUIClass.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -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.scanning.annotations.support.warlib;
+
+import org.jboss.test.scanning.annotations.support.Marked;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Marked
+public class SomeUIClass
+{
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AbstractAnnotationsScanningTest.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AbstractAnnotationsScanningTest.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AbstractAnnotationsScanningTest.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,124 @@
+/*
+* 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.scanning.annotations.test;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.scanning.annotations.spi.AnnotationIndex;
+import org.jboss.scanning.annotations.spi.AnnotationRepository;
+import org.jboss.scanning.annotations.spi.Element;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.test.scanning.annotations.support.NoExtRecurseFilter;
+import org.jboss.test.scanning.annotations.support.ext.External;
+import org.jboss.test.scanning.annotations.support.jar.JarMarkOnClass;
+import org.jboss.test.scanning.annotations.support.jar.impl.JarMarkOnClassImpl;
+import org.jboss.test.scanning.annotations.support.util.Util;
+import org.jboss.test.scanning.annotations.support.war.WebMarkOnClass;
+import org.jboss.test.scanning.annotations.support.war.impl.WebMarkOnClassImpl;
+import org.jboss.test.scanning.annotations.support.warlib.SomeUIClass;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractAnnotationsScanningTest extends BootstrapDeployersTest
+{
+ protected AbstractAnnotationsScanningTest(String name)
+ {
+ super(name);
+ }
+
+ public void testBasicScanning() throws Throwable
+ {
+ VirtualFile ear = createTopLevelWithUtil();
+ createAssembledDirectory(ear.getChild("simple.jar"))
+ .addPackage(JarMarkOnClassImpl.class)
+ .addPackage(JarMarkOnClass.class)
+ .addPath("/annotations/base-scan/jar");
+
+ createAssembledDirectory(ear.getChild("simple.war"))
+ .addPackage("WEB-INF/classes", WebMarkOnClassImpl.class)
+ .addPackage("WEB-INF/classes", WebMarkOnClass.class)
+ .addPackage("WEB-INF/lib/ui.jar", SomeUIClass.class)
+ .addPath("/annotations/base-scan/web");
+
+ enableTrace("org.jboss.deployers");
+
+ DeploymentUnit unit = assertDeploy(ear);
+ assertEar(unit);
+ try
+ {
+ AnnotationRepository env = unit.getAttachment(AnnotationIndex.class);
+ assertNotNull(env);
+ Set<Element<Annotation, Class<?>>> annotations = env.classIsAnnotatedWith("org.jboss.test.scanning.annotations.support.MarkedAnnotation");
+ assertNotNull(annotations);
+ assertEquals(1, annotations.size());
+
+ DeploymentUnit jarUnit = assertChild(unit, "simple.jar");
+ assertJar(jarUnit);
+ DeploymentUnit webUnit = assertChild(unit, "simple.war");
+ assertWar(webUnit);
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+
+ protected abstract void assertEar(DeploymentUnit ear);
+ protected abstract void assertJar(DeploymentUnit jar);
+ protected abstract void assertWar(DeploymentUnit war);
+
+ @SuppressWarnings("unchecked")
+ protected void assertAnnotations(DeploymentUnit unit, int onClass, int onMethod, int onFiled)
+ {
+ AnnotationRepository env = unit.getAttachment(AnnotationIndex.class);
+ assertNotNull(env);
+
+ Set classes = env.classIsAnnotatedWith("org.jboss.test.scanning.annotations.support.Marked");
+ assertNotNull(classes);
+ assertEquals(classes.toString(), onClass, classes.size());
+
+ Set methods = env.classHasMethodAnnotatedWith("org.jboss.test.scanning.annotations.support.Marked");
+ assertNotNull(methods);
+ assertEquals(methods.toString(), onMethod, methods.size());
+
+ Set fields = env.classHasFieldAnnotatedWith("org.jboss.test.scanning.annotations.support.Marked");
+ assertNotNull(fields);
+ assertEquals(fields.toString(), onFiled, fields.size());
+ }
+
+ protected VirtualFile createTopLevelWithUtil() throws Exception
+ {
+ VirtualFile topLevel = VFS.getChild(getName()).getChild("top-level.ear");
+
+ createAssembledDirectory(topLevel)
+ .addPath("/annotations/base-scan")
+ .addPackage("lib/util.jar", Util.class)
+ .addPackage("lib/ext.jar", External.class)
+ .addPackage("lib/ann.jar", NoExtRecurseFilter.class);
+ return topLevel;
+ }
+}
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,57 @@
+/*
+* 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.scanning.annotations.test;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotationsScanningTestCase extends AbstractAnnotationsScanningTest
+{
+ public AnnotationsScanningTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(AnnotationsScanningTestCase.class);
+ }
+
+ protected void assertEar(DeploymentUnit ear)
+ {
+ assertAnnotations(ear, 1, 1, 1);
+ }
+
+ protected void assertJar(DeploymentUnit jar)
+ {
+ assertAnnotations(jar, 4, 1, 1);
+ }
+
+ protected void assertWar(DeploymentUnit war)
+ {
+ assertAnnotations(war, 5, 1, 1);
+ }
+}
Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.java (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,57 @@
+/*
+* 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.scanning.annotations.test;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotationsScanningWithMetaDataTestCase extends AbstractAnnotationsScanningTest
+{
+ public AnnotationsScanningWithMetaDataTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(AnnotationsScanningWithMetaDataTestCase.class);
+ }
+
+ protected void assertEar(DeploymentUnit ear)
+ {
+ assertAnnotations(ear, 1, 1, 1);
+ }
+
+ protected void assertJar(DeploymentUnit jar)
+ {
+ assertAnnotations(jar, 2, 0, 0);
+ }
+
+ protected void assertWar(DeploymentUnit war)
+ {
+ assertAnnotations(war, 2, 0, 0);
+ }
+}
Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsTest.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsTest.java 2010-04-01 07:22:38 UTC (rev 103402)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/test/AnnotationsTest.java 2010-04-01 07:57:11 UTC (rev 103403)
@@ -198,7 +198,7 @@
protected Deployer createScanningDeployer()
{
ScanningDeployer deployer = new ScanningDeployer();
- deployer.addPlugin(new AnnotationsScanningPluginFactory());
+ deployer.addFactory(new AnnotationsScanningPluginFactory());
return deployer;
}
}
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/application.properties
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/application.properties (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/application.properties 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,2 @@
+jar-module=simple.jar
+web-module=simple.war
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/jboss-scanning.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/jboss-scanning.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/META-INF/jboss-scanning.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,8 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+ <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>
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/MANIFEST.MF
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/MANIFEST.MF (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/MANIFEST.MF 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Created-By: hand
+Class-Path: lib/util.jar, lib/ext.jar
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/jboss-scanning.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/jboss-scanning.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/jar/META-INF/jboss-scanning.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,5 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+ <path name="simple.jar">
+ <include name="org.jboss.test.deployers.vfs.annotations.support.jar.impl"/>
+ </path>
+</scanning>
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/jboss-scanning.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/jboss-scanning.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/jboss-scanning.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,6 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+ <path name="simple.war">
+ <exclude name="org.jboss.test.deployers.vfs.annotations.support.war"/>
+ <exclude name="org.jboss.test.deployers.vfs.annotations.support.warlib"/>
+ </path>
+</scanning>
Added: projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/web.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/web.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/annotations/base-scan/web/WEB-INF/web.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1 @@
+<web/>
\ No newline at end of file
Added: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningTestCase.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,13 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+ <bean name="WarStructure" class="org.jboss.deployers.vfs.plugins.structure.war.WARStructure"/>
+
+ <bean name="AnnEnvDeployer" class="org.jboss.scanning.deployers.ScanningDeployer">
+ <incallback method="addFactory" />
+ <uncallback method="removeFactory" />
+ </bean>
+
+ <bean name="AnnScanningPlugin" class="org.jboss.test.scanning.annotations.support.MockAnnScanningPluginFactory"/>
+
+</deployment>
Added: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.xml (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/annotations/test/AnnotationsScanningWithMetaDataTestCase.xml 2010-04-01 07:57:11 UTC (rev 103403)
@@ -0,0 +1,18 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+ <bean name="WarStructure" class="org.jboss.deployers.vfs.plugins.structure.war.WARStructure"/>
+
+ <bean name="ScanningMDDeployer" class="org.jboss.deployers.vfs.plugins.annotations.ScanningMetaDataDeployer"/>
+
+ <bean name="AnnEnvDeployer" class="org.jboss.scanning.deployers.ScanningDeployer">
+ <incallback method="addFactory" />
+ <uncallback method="removeFactory" />
+ <property name="filter">
+ <bean class="org.jboss.test.scanning.annotations.support.ScanningMDFilter"/>
+ </property>
+ </bean>
+
+ <bean name="AnnScanningPlugin" class="org.jboss.scanning.annotations.plugins.AnnotationsScanningPluginFactory"/>
+
+</deployment>
More information about the jboss-cvs-commits
mailing list