[jboss-cvs] JBossAS SVN: r104085 - in projects/scanning/trunk: deployers/src/main/java/org/jboss/scanning/deployers and 34 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 20 11:51:07 EDT 2010


Author: alesj
Date: 2010-04-20 11:50:56 -0400 (Tue, 20 Apr 2010)
New Revision: 104085

Added:
   projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractClassLoadingScanningPlugin.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/UtilSuper.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/support/
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/support/PoolFactoryInitializer.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerTest.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/SmokeTestSuite.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/test/
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.java
   projects/scanning/trunk/testsuite/src/test/resources/bootstrap/
   projects/scanning/trunk/testsuite/src/test/resources/bootstrap/classpool.xml
   projects/scanning/trunk/testsuite/src/test/resources/indexer/
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.xml
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.xml
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/test/
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.xml
   projects/scanning/trunk/testsuite/src/test/resources/smoke/
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/MANIFEST.MF
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/snd-jboss-beans.xml
   projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/fst-jboss-beans.xml
Removed:
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.java
   projects/scanning/trunk/testsuite/src/test/resources/hibernate/pre-defaultpar.jar
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.xml
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/VFSDeploymentUnitScanner.java
   projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/ScanUtils.java
   projects/scanning/trunk/plugins/pom.xml
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/AnnotationsScanningPlugin.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/DefaultAnnotationRepository.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexImpl.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPlugin.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPluginFactory.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyTypeVisitor.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/spi/HierarchyIndex.java
   projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/web/plugins/DefaultResourcesIndex.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/WeakClassLoaderHolder.java
   projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/visitor/ReflectResourceVisitor.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/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/UrlScanner.java
   projects/scanning/trunk/testsuite/pom.xml
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTest.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTestDelegate.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningTestSuite.java
   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/hibernate/test/HibernateUnitTestCase.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/IndexerTestSuite.java
   projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerSmokeTestCase.java
   projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.xml
Log:
Fix testing so it actually does properly mock Javassist usage.
Fix serialization of handles and de-serialization.
Add some smoke tests.

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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/ScanningDeployer.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -80,14 +80,17 @@
          try
          {
             UrlScanner scanner = (vdu != null) ? new VFSDeploymentUnitScanner(vdu) : new DeploymentUnitScanner(unit);
-            scanner.setPlugins(plugins);
-            // check ignore flags
-            scanner.setIgnoreIndexedHandles(unit.isAttachmentPresent(UrlScanner.IGNORE_PRE_INDEXED));
-            scanner.setIgnoreRuntimeScanning(unit.isAttachmentPresent(UrlScanner.IGNORE_RUNTIME_SCAN));
-            // the scan
-            scanner.scan();
-            // add used plugins as attachment
-            unit.addAttachment(PLUGINS_KEY, plugins); // add used plugins as attachment
+            if (scanner.doScan())
+            {
+               scanner.setPlugins(plugins);
+               // check ignore flags
+               scanner.setIgnoreIndexedHandles(unit.isAttachmentPresent(UrlScanner.IGNORE_PRE_INDEXED));
+               scanner.setIgnoreRuntimeScanning(unit.isAttachmentPresent(UrlScanner.IGNORE_RUNTIME_SCAN));
+               // the scan
+               scanner.scan();
+               // add used plugins as attachment
+               unit.addAttachment(PLUGINS_KEY, plugins); // add used plugins as attachment
+            }
          }
          catch (Exception e)
          {

Modified: projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/VFSDeploymentUnitScanner.java
===================================================================
--- projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/VFSDeploymentUnitScanner.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/deployers/src/main/java/org/jboss/scanning/deployers/VFSDeploymentUnitScanner.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -37,4 +37,16 @@
    {
       super(unit, ClasspathUtils.getUrls(unit));
    }
+
+   /**
+    * Mostly there is no sense in scanning
+    * if there is no explicit roots; e.g. file based sub-deployment.
+    *
+    * @return true if there are some roots to scan, false otherwise
+    */
+   @Override
+   public boolean doScan()
+   {
+      return (getRoots().length > 0);
+   }
 }
\ No newline at end of file

Modified: projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/ScanUtils.java
===================================================================
--- projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/ScanUtils.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/ScanUtils.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -25,14 +25,12 @@
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
 import java.lang.reflect.Constructor;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.zip.GZIPOutputStream;
 
 import org.jboss.scanning.plugins.DefaultScanner;
 import org.jboss.scanning.spi.Scanner;
@@ -162,26 +160,19 @@
       if (handles == null)
          throw new IllegalArgumentException("Null handles");
 
-      if (directory == null || directory.exists() == false)
-         throw new IllegalArgumentException("Directory is null or doesn't exist");
+      if (directory == null)
+         throw new IllegalArgumentException("Directory is null");
+      if (directory.exists() == false && directory.mkdir() == false)
+         throw new IllegalArgumentException("Cannot create directory: " + directory); 
 
       for (Map.Entry<ScanningPlugin, ScanningHandle> entry : handles.entrySet())
       {
-         File file = new File(directory, entry.getKey().getFileName());
+         ScanningPlugin plugin = entry.getKey();
+         File file = new File(directory, plugin.getFileName());
          FileOutputStream fos = new FileOutputStream(file);
          BufferedOutputStream bos = new BufferedOutputStream(fos);
-         GZIPOutputStream gos = new GZIPOutputStream(bos);
-         ObjectOutputStream oos = new ObjectOutputStream(gos);
-         try
-         {
-            ScanningHandle handle = entry.getValue();
-            oos.writeObject(handle);
-            oos.flush();
-         }
-         finally
-         {
-            oos.close();
-         }
+         //noinspection unchecked
+         plugin.writeHandle(bos, entry.getValue());
       }
    }
 }

Modified: projects/scanning/trunk/plugins/pom.xml
===================================================================
--- projects/scanning/trunk/plugins/pom.xml	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/pom.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -74,6 +74,10 @@
               </exclusion>
               <exclusion>
                   <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-vfs-spi</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
                   <artifactId>jboss-deployers-structure-spi</artifactId>
               </exclusion>
               <exclusion>

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/AnnotationsScanningPlugin.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/AnnotationsScanningPlugin.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/AnnotationsScanningPlugin.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -30,14 +30,14 @@
 import org.jboss.scanning.plugins.helpers.ResourceOwnerFinder;
 import org.jboss.scanning.plugins.visitor.IntrospectionReflectProvider;
 import org.jboss.scanning.plugins.visitor.ReflectProvider;
-import org.jboss.scanning.spi.helpers.AbstractScanningPlugin;
+import org.jboss.scanning.spi.helpers.AbstractClassLoadingScanningPlugin;
 
 /**
  * Annotations scanning plugin.
  *
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class AnnotationsScanningPlugin extends AbstractScanningPlugin<DefaultAnnotationRepository, AnnotationIndex>
+public class AnnotationsScanningPlugin extends AbstractClassLoadingScanningPlugin<DefaultAnnotationRepository, AnnotationIndex>
 {
    /** The repository */
    private final DefaultAnnotationRepository repository;
@@ -60,6 +60,11 @@
       return repository;
    }
 
+   protected ClassLoader getClassLoader()
+   {
+      return repository.getClassLoader();
+   }
+
    @Override
    public void cleanupHandle(AnnotationIndex handle)
    {

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/DefaultAnnotationRepository.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/DefaultAnnotationRepository.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/annotations/plugins/DefaultAnnotationRepository.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -70,6 +70,12 @@
       env = new HashMap<String, Map<Class<? extends Annotation>, Map<ElementType, Set<ClassSignaturePair>>>>();
    }
 
+   @Override
+   protected ClassLoader getClassLoader()
+   {
+      return super.getClassLoader();
+   }
+
    public void writeExternal(ObjectOutput out) throws IOException
    {
       out.writeObject(env);

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexImpl.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexImpl.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexImpl.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -22,27 +22,52 @@
 
 package org.jboss.scanning.hierarchy.plugins;
 
-import java.io.Serializable;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.net.URL;
 import java.util.*;
 
+import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory;
 import org.jboss.reflect.spi.TypeInfo;
 import org.jboss.reflect.spi.TypeInfoFactory;
 import org.jboss.scanning.hierarchy.spi.HierarchyIndex;
 import org.jboss.scanning.plugins.helpers.MergeUtils;
+import org.jboss.scanning.plugins.helpers.WeakClassLoaderHolder;
 import org.jboss.scanning.spi.ScanningHandle;
 
 /**
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class HierarchyIndexImpl implements HierarchyIndex, ScanningHandle<HierarchyIndexImpl>, Serializable
+public class HierarchyIndexImpl extends WeakClassLoaderHolder implements HierarchyIndex, ScanningHandle<HierarchyIndexImpl>, Externalizable
 {
    private static final long serialVersionUID = 1l;
    
    /** The inherited types */
    private Map<String, Map<TypeInfo, Set<TypeInfo>>> cache = new HashMap<String, Map<TypeInfo, Set<TypeInfo>>>();
    /** The type info factory */
-   private TypeInfoFactory tif;
+   private transient TypeInfoFactory tif;
 
+   /**
+    * De-serialization only.
+    */
+   public HierarchyIndexImpl()
+   {
+      super();
+   }
+
+   public HierarchyIndexImpl(ClassLoader classLoader)
+   {
+      super(classLoader);
+   }
+
+   @Override
+   protected ClassLoader getClassLoader()
+   {
+      return super.getClassLoader();
+   }
+
    void cleanup()
    {
       cache.clear();
@@ -54,7 +79,10 @@
    }
 
    public void merge(HierarchyIndexImpl subHandle)
-   {
+   {      
+      if (tif == null)
+         tif = subHandle.tif;
+
       MergeUtils.doubleMerge(cache, subHandle.getCache());
    }
 
@@ -81,21 +109,44 @@
       }
    }
 
-   public Set<TypeInfo> getInheritedClasses(String path, TypeInfo superTypeToLookFor)
+   public Set<TypeInfo> getInheritedClasses(URL url, TypeInfo superTypeToLookFor)
    {
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      String path = url.getPath();
       Set<TypeInfo> result = null;
-      Map<TypeInfo, Set<TypeInfo>> map = cache.get(path);
+      Map<TypeInfo, Set<TypeInfo>> map = cache.get(fixPath(path));
       if (map != null)
          result = map.get(superTypeToLookFor);
 
       return result == null || result.isEmpty() ? Collections.<TypeInfo>emptySet() : Collections.unmodifiableSet(result);
    }
 
-   public Set<TypeInfo> getInheritedClasses(String path, Class<?> superTypeToLookFor)
+   public Set<TypeInfo> getInheritedClasses(URL url, Class<?> superTypeToLookFor)
    {
       if (tif == null) // we haven't cached anything yet
          return Collections.emptySet();
 
-      return getInheritedClasses(path, tif.getTypeInfo(superTypeToLookFor));
+      return getInheritedClasses(url, tif.getTypeInfo(superTypeToLookFor));
    }
+
+   static String fixPath(String path)
+   {
+      if (path.endsWith("/") == false)
+         path += "/";
+      return path;
+   }
+
+   public void writeExternal(ObjectOutput out) throws IOException
+   {
+      out.writeObject(cache);
+   }
+
+   @SuppressWarnings("unchecked")
+   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+   {
+      cache = (Map) in.readObject();
+      tif = new IntrospectionTypeInfoFactory(); // after de-serialization we use Introspection
+   }
 }

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPlugin.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPlugin.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPlugin.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -31,28 +31,28 @@
 import org.jboss.scanning.plugins.helpers.ResourceOwnerFinder;
 import org.jboss.scanning.plugins.visitor.IntrospectionReflectProvider;
 import org.jboss.scanning.plugins.visitor.ReflectProvider;
-import org.jboss.scanning.spi.helpers.AbstractScanningPlugin;
+import org.jboss.scanning.spi.helpers.AbstractClassLoadingScanningPlugin;
 
 /**
  * Default resource index.
  *
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
-public class HierarchyIndexScanningPlugin extends AbstractScanningPlugin<HierarchyIndexImpl, HierarchyIndex>
+public class HierarchyIndexScanningPlugin extends AbstractClassLoadingScanningPlugin<HierarchyIndexImpl, HierarchyIndex>
 {
    /** The reosurces */
    private final HierarchyIndexImpl hierarchy;
    /** The visitor */
    private final ResourceVisitor visitor;
 
-   public HierarchyIndexScanningPlugin()
+   public HierarchyIndexScanningPlugin(ClassLoader cl)
    {
-      this(IntrospectionReflectProvider.INSTANCE, ClassResourceOwnerFinder.INSTANCE);
+      this(IntrospectionReflectProvider.INSTANCE, ClassResourceOwnerFinder.INSTANCE, cl);
    }
 
-   public HierarchyIndexScanningPlugin(ReflectProvider provider, ResourceOwnerFinder finder)
+   public HierarchyIndexScanningPlugin(ReflectProvider provider, ResourceOwnerFinder finder, ClassLoader cl)
    {
-      hierarchy = new HierarchyIndexImpl();
+      hierarchy = new HierarchyIndexImpl(cl);
       visitor = new HierarchyTypeVisitor(provider, finder, hierarchy);
    }
 
@@ -62,6 +62,12 @@
    }
 
    @Override
+   protected ClassLoader getClassLoader()
+   {
+      return hierarchy.getClassLoader();
+   }
+
+   @Override
    public void cleanupHandle(HierarchyIndex handle)
    {
       if (handle instanceof HierarchyIndexImpl)

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPluginFactory.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPluginFactory.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyIndexScanningPluginFactory.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -58,7 +58,7 @@
    {
       ReflectProvider provider = DeploymentUtilsFactory.getProvider(unit);
       ResourceOwnerFinder finder = DeploymentUtilsFactory.getFinder(unit);
-      return new HierarchyIndexScanningPlugin(provider, finder);
+      return new HierarchyIndexScanningPlugin(provider, finder, unit.getClassLoader());
    }
 
    @Override

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyTypeVisitor.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyTypeVisitor.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/plugins/HierarchyTypeVisitor.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -65,7 +65,7 @@
    protected void handleClass(ResourceContext resource, ClassInfo classInfo) throws Exception
    {
       URL ownerURL = finder.findOwnerURL(resource);
-      String path = ownerURL.getPath();
+      String path = HierarchyIndexImpl.fixPath(ownerURL.getPath());
       handleInterfaces(path, classInfo, classInfo); // handle target's interfaces
       recurse(path, classInfo, classInfo.getSuperclass()); // recurse on super class
    }

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/spi/HierarchyIndex.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/spi/HierarchyIndex.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hierarchy/spi/HierarchyIndex.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -1,5 +1,6 @@
 package org.jboss.scanning.hierarchy.spi;
 
+import java.net.URL;
 import java.util.Set;
 
 import org.jboss.reflect.spi.TypeInfo;
@@ -15,18 +16,18 @@
    /**
     * Get inherited classes.
     *
-    * @param path the classpath entry path
+    * @param url the classpath entry path
     * @param superTypeToLookFor the super type to inherit
     * @return set of matching inherited classes
     */
-   Set<TypeInfo> getInheritedClasses(String path, TypeInfo superTypeToLookFor);   
+   Set<TypeInfo> getInheritedClasses(URL url, TypeInfo superTypeToLookFor);
 
    /**
     * Get inherited classes.
     *
-    * @param path the classpath entry path
+    * @param url the classpath entry path
     * @param superTypeToLookFor the super type to inherit
     * @return set of matching inherited classes
     */
-   Set<TypeInfo> getInheritedClasses(String path, Class<?> superTypeToLookFor);
+   Set<TypeInfo> getInheritedClasses(URL url, Class<?> superTypeToLookFor);
 }

Modified: projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/web/plugins/DefaultResourcesIndex.java
===================================================================
--- projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/web/plugins/DefaultResourcesIndex.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/web/plugins/DefaultResourcesIndex.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -81,7 +81,7 @@
          throw new IllegalArgumentException("Null super type");
 
       Set<Class<?>> result = new HashSet<Class<?>>();
-      for (TypeInfo ti : hierarchy.getInheritedClasses(cpEntry.getPathName(), superTypeToLookFor))
+      for (TypeInfo ti : hierarchy.getInheritedClasses(toURL(cpEntry), superTypeToLookFor))
          result.add(ti.getType());
       return result;
    }

Modified: projects/scanning/trunk/pom.xml
===================================================================
--- projects/scanning/trunk/pom.xml	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/pom.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -30,6 +30,7 @@
   <properties>
     <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.classpool>1.0.0.Alpha5</version.org.jboss.classpool>
     <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>
@@ -130,6 +131,21 @@
         <version>${version.org.jboss.vfs}</version>
       </dependency>
       <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool</artifactId>
+        <version>${version.org.jboss.classpool}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool-jbosscl</artifactId>
+        <version>${version.org.jboss.classpool}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool-scoped</artifactId>
+        <version>${version.org.jboss.classpool}</version>
+      </dependency>
+      <dependency>
         <groupId>org.jboss</groupId>
         <artifactId>jboss-reflect</artifactId>
         <version>${version.org.jboss.reflect}</version>

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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DefaultScanner.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -69,6 +69,16 @@
       return handles;
    }
 
+   /**
+    * No root == no sense in scanning.
+    *
+    * @return true if there are some roots to scan
+    */
+   public boolean doScan()
+   {
+      return (getRoots().length > 0);
+   }
+
    protected void scan(Set<ScanningPlugin> plugins) throws Exception
    {
       URL[] urls;

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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/DeploymentUnitScanner.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -53,6 +53,14 @@
       this.unit = unit;
    }
 
+   public boolean doScan()
+   {
+      // we actually don't care here
+      // since it's the job of Module to determine what to scan
+      // e.g. not all Module impls are VFS based
+      return true;
+   }
+
    /**
     * Wrap federated filters with existing.
     * e.g. scanning metadata restrictions

Modified: projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/WeakClassLoaderHolder.java
===================================================================
--- projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/WeakClassLoaderHolder.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/helpers/WeakClassLoaderHolder.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -81,7 +81,7 @@
    {
       try
       {
-         return Class.forName(className, false, getClassLoader());
+         return getClassLoader().loadClass(className);
       }
       catch (ClassNotFoundException e)
       {

Modified: projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/visitor/ReflectResourceVisitor.java
===================================================================
--- projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/visitor/ReflectResourceVisitor.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-impl/src/main/java/org/jboss/scanning/plugins/visitor/ReflectResourceVisitor.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -143,6 +143,7 @@
     */
    protected void logThrowable(ResourceContext resource, Throwable t)
    {
+      t.printStackTrace();
       if (log.isTraceEnabled())
          log.trace("Exception reading resource: " + resource.getResourceName(), t);
    }

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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/ScanningPlugin.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -1,5 +1,9 @@
 package org.jboss.scanning.spi;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
 import org.jboss.classloading.spi.visitor.ResourceFilter;
 import org.jboss.classloading.spi.visitor.ResourceVisitor;
 
@@ -22,6 +26,24 @@
    T createHandle();
 
    /**
+    * Read serialized handle.
+    *
+    * @param is the serialized handle's input stream.
+    * @return de-serialized handle
+    * @throws Exception for any error
+    */
+   ScanningHandle readHandle(InputStream is) throws Exception;
+
+   /**
+    * Write / serialize handle.
+    *
+    * @param os the output stream to serialize handle.
+    * @param handle the handle
+    * @throws IOException for any IO error
+    */
+   void writeHandle(OutputStream os, T handle) throws IOException;
+
+   /**
     * Cleanup handle.
     *
     * @param handle the handle to cleanup

Copied: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractClassLoadingScanningPlugin.java (from rev 103982, 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/AbstractClassLoadingScanningPlugin.java	                        (rev 0)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractClassLoadingScanningPlugin.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,59 @@
+/*
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamClass;
+
+import org.jboss.scanning.spi.ScanningHandle;
+
+/**
+ * Abstract classloading scanning plugin wrapper
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractClassLoadingScanningPlugin<T extends ScanningHandle, U> extends AbstractScanningPlugin<T, U>
+{
+   @Override
+   protected ObjectInputStream createObjectInputStream(InputStream is) throws IOException
+   {
+      return new ObjectInputStream(is)
+      {
+         @Override
+         protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException
+         {
+            String className = desc.getName();
+            return getClassLoader().loadClass(className);
+         }
+      };
+   }
+
+   /**
+    * Current plugin's classloader.
+    *
+    * @return the classloader
+    */
+   protected abstract ClassLoader getClassLoader();
+}
\ 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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/AbstractScanningPlugin.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -22,6 +22,10 @@
 
 package org.jboss.scanning.spi.helpers;
 
+import java.io.*;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
 import org.jboss.classloading.spi.visitor.ResourceContext;
 import org.jboss.classloading.spi.visitor.ResourceFilter;
 import org.jboss.scanning.spi.Scanner;
@@ -45,6 +49,40 @@
 
    protected abstract T doCreateHandle();
 
+   protected ObjectInputStream createObjectInputStream(InputStream is) throws IOException
+   {
+      return new ObjectInputStream(is);
+   }
+
+   public ScanningHandle readHandle(InputStream is) throws Exception
+   {
+      try
+      {
+         GZIPInputStream gis = new GZIPInputStream(is);
+         ObjectInputStream ois = createObjectInputStream(gis);
+         return (ScanningHandle) ois.readObject();
+      }
+      finally
+      {
+         is.close();
+      }
+   }
+
+   public void writeHandle(OutputStream os, T handle) throws IOException
+   {
+      GZIPOutputStream gos = new GZIPOutputStream(os);
+      ObjectOutputStream oos = new ObjectOutputStream(gos);
+      try
+      {
+         oos.writeObject(handle);
+         oos.flush();
+      }
+      finally
+      {
+         oos.close();
+      }
+   }
+
    public void cleanupHandle(U handle)
    {
       // by default, do nothing

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-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/ScanningPluginWrapper.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -22,6 +22,9 @@
 
 package org.jboss.scanning.spi.helpers;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.URL;
 import java.util.List;
 
@@ -56,6 +59,16 @@
       return delegate.createHandle();
    }
 
+   public ScanningHandle readHandle(InputStream is) throws Exception
+   {
+      return delegate.readHandle(is);
+   }
+
+   public void writeHandle(OutputStream os, T handle) throws IOException
+   {
+      delegate.writeHandle(os, handle);
+   }
+
    public void cleanupHandle(U handle)
    {
       delegate.cleanupHandle(handle);

Modified: projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/UrlScanner.java
===================================================================
--- projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/UrlScanner.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/scanning-spi/src/main/java/org/jboss/scanning/spi/helpers/UrlScanner.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -24,11 +24,9 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.ObjectInputStream;
 import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.zip.GZIPInputStream;
 
 import org.jboss.classloading.spi.visitor.ResourceFilter;
 import org.jboss.logging.Logger;
@@ -60,33 +58,43 @@
       return roots;
    }
 
+   /**
+    * Should we actually perform the scan.
+    *
+    * @return true if we should scan, false otherwise
+    */
+   public abstract boolean doScan();
+
    @SuppressWarnings("unchecked")
    public void scan() throws Exception
    {
-      Set<ScanningPlugin> federatedPlugins = new HashSet<ScanningPlugin>();
-      for (ScanningPlugin plugin : getPlugins())
+      if (doScan())
       {
-         ScanningHandle handle = createHandle(plugin);
-         ScanningPluginWrapper wrapper = new ScanningPluginWrapper(plugin);
-         federatedPlugins.add(wrapper);
-         if (ignoreIndexedHandles == false)
+         Set<ScanningPlugin> federatedPlugins = new HashSet<ScanningPlugin>();
+         for (ScanningPlugin plugin : getPlugins())
          {
-            String fileName = plugin.getFileName();
-            for (URL root : roots)
+            ScanningHandle handle = createHandle(plugin);
+            ScanningPluginWrapper wrapper = new ScanningPluginWrapper(plugin);
+            federatedPlugins.add(wrapper);
+            if (ignoreIndexedHandles == false)
             {
-               InputStream is = getInputStream(root, Scanner.META_INF + fileName);
-               if (is != null)
+               String fileName = plugin.getFileName();
+               for (URL root : roots)
                {
-                  ScanningHandle pre = readHandle(is);
-                  handle.merge(pre);
-                  wrapper.addURL(root); // exclude this url -- we already have pre-existing handle
+                  InputStream is = getInputStream(root, Scanner.META_INF + fileName);
+                  if (is != null)
+                  {
+                     ScanningHandle pre = plugin.readHandle(is);
+                     handle.merge(pre);
+                     wrapper.addURL(root); // exclude this url -- we already have pre-existing handle
+                  }
                }
             }
          }
+         // do we scan, or should everything be in pre-indexed handles
+         if (ignoreRuntimeScanning == false && federatedPlugins.isEmpty() == false)
+            scan(federatedPlugins);
       }
-      // do we scan, or should everything be in pre-indexed handles
-      if (ignoreRuntimeScanning == false)
-         scan(federatedPlugins);
    }
 
    protected ResourceFilter[] getRecurseFilters(ScanningPlugin[] plugins)
@@ -118,26 +126,11 @@
       catch (IOException e)
       {
          if (log.isTraceEnabled())
-            log.trace("Cannot access mcann.ser file: " + e);
+            log.trace("Cannot access scanning .mcs file: " + e);
          return null;
       }
    }
 
-   protected ScanningHandle readHandle(InputStream is) throws Exception
-   {
-      ObjectInputStream ois;
-      try
-      {
-         GZIPInputStream gis = new GZIPInputStream(is);
-         ois = new ObjectInputStream(gis);
-         return (ScanningHandle) ois.readObject();
-      }
-      finally
-      {
-         is.close();
-      }
-   }
-
    protected abstract ScanningHandle createHandle(ScanningPlugin plugin);
 
    /**

Modified: projects/scanning/trunk/testsuite/pom.xml
===================================================================
--- projects/scanning/trunk/testsuite/pom.xml	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/pom.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -46,9 +46,81 @@
       <groupId>org.jboss</groupId>
       <artifactId>jboss-vfs</artifactId>
     </dependency>
+      <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool</artifactId>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool-jbosscl</artifactId>
+          <exclusions>
+              <exclusion>
+                  <groupId>sun-jaxb</groupId>
+                  <artifactId>jaxb-api</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-impl</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-vfs</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-vfs-spi</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-structure-spi</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-core-spi</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.deployers</groupId>
+                  <artifactId>jboss-deployers-spi</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.cl</groupId>
+                  <artifactId>jboss-classloading-vfs</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.kernel</groupId>
+                  <artifactId>jboss-kernel</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss.microcontainer</groupId>
+                  <artifactId>jboss-kernel</artifactId>
+              </exclusion>
+              <exclusion>
+                  <groupId>org.jboss</groupId>
+                  <artifactId>jboss-vfs</artifactId>
+              </exclusion>
+          </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.classpool</groupId>
+        <artifactId>jboss-classpool-scoped</artifactId>
+      </dependency>
     <dependency>
       <groupId>org.jboss</groupId>
       <artifactId>jboss-reflect</artifactId>
+      <exclusions>          
+          <exclusion>
+            <groupId>org.jboss.classpool</groupId>
+            <artifactId>jboss-classpool</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.jboss.classpool</groupId>
+            <artifactId>jboss-classpool-jbosscl</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.jboss.classpool</groupId>
+            <artifactId>jboss-classpool-scoped</artifactId>
+          </exclusion>          
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.jboss.man</groupId>

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTest.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTest.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTest.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -302,11 +302,16 @@
 
    protected DeploymentUnit assertChild(DeploymentUnit parent, String name)
    {
+      return assertChild(parent, name, true);  
+   }
+
+   protected DeploymentUnit assertChild(DeploymentUnit parent, String name, boolean addSuffix)
+   {
       String parentName = parent.getName();
       if (parentName.endsWith("/") == false)
          parentName += "/";
       name = parentName + name;
-      if (name.endsWith("/") == false)
+      if (addSuffix && name.endsWith("/") == false)
          name += "/";
 
       List<DeploymentUnit> children = parent.getChildren();

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTestDelegate.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTestDelegate.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningDeployersTestDelegate.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -36,13 +36,21 @@
 import org.jboss.classloader.spi.filter.ClassFilterUtils;
 import org.jboss.classloading.spi.metadata.ClassLoadingMetaData10;
 import org.jboss.classloading.spi.vfs.metadata.VFSClassLoaderFactory10;
+import org.jboss.classpool.base.IsLocalResourcePluginFactoryRegistry;
+import org.jboss.classpool.spi.AbstractClassPoolFactory;
+import org.jboss.classpool.spi.SystemClassPool;
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployers.plugins.main.MainDeployerImpl;
 import org.jboss.deployers.spi.deployer.Deployers;
+import org.jboss.test.deployers.vfs.reflect.support.FilteredClassPool;
+import org.jboss.test.deployers.vfs.reflect.support.FilteredIsLocalResourcePluginFactory;
 import org.jboss.test.kernel.junit.MicrocontainerTestDelegate;
+import org.jboss.util.loading.Translatable;
 import org.jboss.xb.binding.resolver.MutableSchemaResolver;
 import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
 
+import javassist.ClassPool;
+
 /**
  * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
  */
@@ -50,6 +58,8 @@
 {
    private static ParentPolicy parentPolicy;
 
+   private static ClassPool defaultClassPool;
+
    private MainDeployerImpl mainDeployer;
 
    private MBeanServer server = null;
@@ -62,6 +72,9 @@
 
       ClassFilter classFilter = createNegatingClassFilter();
       parentPolicy = new ParentPolicy(classFilter, ClassFilterUtils.NOTHING, "BEFORE");
+
+      defaultClassPool = new FilteredClassPool(AbstractClassPoolFactory.getSystemClassPool(), classFilter);
+      IsLocalResourcePluginFactoryRegistry.addPluginFactory(Translatable.class, new FilteredIsLocalResourcePluginFactory(classFilter));
    }
 
    protected static ClassFilter createNegatingClassFilter()
@@ -96,18 +109,26 @@
       this.server = server;
    }
 
-   protected void deploy() throws Exception
+   protected void deployBootstrap(String name) throws Exception
    {
-      String common = "/bootstrap/bootstrap.xml";
+      String common = "/bootstrap/" + name + ".xml";
       URL url = getClass().getResource(common);
       if (url == null)
          throw new IllegalStateException(common + " not found");
       deploy(url);
+   }
 
+   protected void deploy() throws Exception
+   {
+      deployBootstrap("bootstrap");
+      deployBootstrap("classpool");
+            
       ClassLoaderSystem system = getBean("ClassLoaderSystem", ControllerState.INSTALLED, ClassLoaderSystem.class);
       ClassLoaderDomain domain = system.getDefaultDomain();
       domain.setParentPolicy(parentPolicy);
 
+      AbstractClassPoolFactory.setSystemClassPool(defaultClassPool);
+
       if (server != null)
       {
          Deployers deployers = getBean("Deployers", ControllerState.INSTALLED, Deployers.class);
@@ -117,6 +138,14 @@
       super.deploy();
    }
 
+   @Override
+   protected void undeploy()
+   {
+      super.undeploy();
+
+      AbstractClassPoolFactory.setSystemClassPool(SystemClassPool.getInstance());      
+   }
+
    protected MainDeployerImpl getMainDeployer()
    {
       if (mainDeployer == null)

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningTestSuite.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningTestSuite.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningTestSuite.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -26,6 +26,7 @@
 import org.jboss.test.scanning.hibernate.HibernateTestSuite;
 import org.jboss.test.scanning.hierarchy.HierarchyTestSuite;
 import org.jboss.test.scanning.metadata.MetaDataTestSuite;
+import org.jboss.test.scanning.smoke.SmokeTestSuite;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -49,6 +50,7 @@
       suite.addTest(HibernateTestSuite.suite());
       suite.addTest(MetaDataTestSuite.suite());
       suite.addTest(HierarchyTestSuite.suite());
+      suite.addTest(SmokeTestSuite.suite());
 
       return suite;
    }

Modified: 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	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/Util.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -27,7 +27,7 @@
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 @Marked
-public class Util
+public class Util extends UtilSuper
 {
    @SuppressWarnings("unused")
    private @Marked Object marked;

Copied: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/UtilSuper.java (from rev 103689, 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/UtilSuper.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/annotations/support/util/UtilSuper.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -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.util;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class UtilSuper
+{
+}
\ No newline at end of file

Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/support/PoolFactoryInitializer.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/support/PoolFactoryInitializer.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/classpool/support/PoolFactoryInitializer.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,57 @@
+/*
+ * 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.classpool.support;
+
+import org.jboss.classpool.scoped.ScopedClassPoolRepository;
+import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl;
+import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
+import org.jboss.reflect.plugins.javassist.classpool.DefaultClassPoolFactory;
+import org.jboss.reflect.plugins.javassist.classpool.RepositoryClassPoolFactory;
+
+
+/**
+ * Initializes the pool factory.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class PoolFactoryInitializer
+{
+   private ScopedClassPoolRepository poolRepository;
+
+   public PoolFactoryInitializer(ScopedClassPoolRepository repository)
+   {
+      this.poolRepository = repository;
+   }
+
+   public void start()
+   {
+      ClassPoolFactory classPoolFactory = new RepositoryClassPoolFactory(poolRepository);
+      JavassistTypeInfoFactoryImpl.setPoolFactory(classPoolFactory);
+   }
+
+   public void stop()
+   {
+      JavassistTypeInfoFactoryImpl.setPoolFactory(DefaultClassPoolFactory.getInstance());
+   }
+}

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hibernate/test/HibernateUnitTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hibernate/test/HibernateUnitTestCase.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hibernate/test/HibernateUnitTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -33,13 +33,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.jboss.classloader.plugins.filter.CombiningClassFilter;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
-import org.jboss.classloader.spi.filter.ClassFilterUtils;
-import org.jboss.classloader.spi.filter.PackageClassFilter;
-import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.scanning.ScanningDeployersTest;
 import org.jboss.vfs.VFS;
@@ -72,13 +65,6 @@
 
    public void testBasicUsage() throws Exception
    {
-      ClassLoaderSystem system = (ClassLoaderSystem) getBean("ClassLoaderSystem", ControllerState.INSTALLED);
-      // we need to see hibernate/jpa
-      ClassFilter hibernateFilter = new PackageClassFilter(new String[]{Scanner.class.getPackage().getName(), Entity.class.getPackage().getName()});
-      ClassFilter before = new CombiningClassFilter(false, new ClassFilter[]{ClassFilterUtils.JAVA_ONLY, hibernateFilter});
-      ParentPolicy parentPolicy = new ParentPolicy(before, ClassFilterUtils.NOTHING);
-      system.getDefaultDomain().setParentPolicy(parentPolicy);
-
       URL url = getResource("/hibernate/defaultpar.jar");
       VirtualFile file = VFS.getChild(url);
       DeploymentUnit unit = assertDeploy(file);

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -24,10 +24,8 @@
 
 import java.util.Set;
 
-import org.jboss.classloading.spi.visitor.ResourceFilter;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.reflect.spi.ClassInfo;
 import org.jboss.reflect.spi.TypeInfo;
 import org.jboss.scanning.hierarchy.spi.HierarchyIndex;
 import org.jboss.test.scanning.ScanningDeployersTest;
@@ -37,6 +35,7 @@
 import org.jboss.test.scanning.annotations.support.jar.JarMarkOnClassSuperAnnotated;
 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.util.UtilSuper;
 import org.jboss.test.scanning.annotations.support.war.WebMarkOnClass;
 import org.jboss.test.scanning.annotations.support.war.WebMarkOnClassSuperAnnotated;
 import org.jboss.test.scanning.annotations.support.war.impl.WebMarkOnClassImpl;
@@ -98,19 +97,10 @@
 
    protected void assertEar(DeploymentUnit ear) throws Exception
    {
-      VirtualFile annJar = getRoot(ear).getChild("/lib/ann.jar");
-      Set<TypeInfo> inherited = getInheritedClasses(ear, annJar, ResourceFilter.class);
+      VirtualFile utilJar = getRoot(ear).getChild("/lib/util.jar");
+      Set<TypeInfo> inherited = getInheritedClasses(ear, utilJar, UtilSuper.class);
       assertNotNull(inherited);
-      assertEquals(2, inherited.size()); // also anonymous class
-      for (TypeInfo ti : inherited)
-      {
-         if (ti instanceof ClassInfo)
-         {
-            ClassInfo ci = (ClassInfo) ti;
-            if (ci.isPublic())
-               assertEquals(ci.getName(), NoExtRecurseFilter.class.getName());
-         }
-      }
+      assertEquals(1, inherited.size());
    }
 
    protected void assertJar(DeploymentUnit jar) throws Exception
@@ -149,9 +139,8 @@
    protected Set<TypeInfo> getInheritedClasses(DeploymentUnit unit, VirtualFile cpEntry, Class<?> ref) throws Exception
    {
       HierarchyIndex index = getIndex(unit);
-      String path = cpEntry.getPathName();
       Class<?> superType = unit.getClassLoader().loadClass(ref.getName());
-      return index.getInheritedClasses(path, superType);
+      return index.getInheritedClasses(cpEntry.toURL(), superType);
    }
 
    protected VirtualFile createTopLevelWithUtil() throws Exception

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/IndexerTestSuite.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/IndexerTestSuite.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/IndexerTestSuite.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -22,6 +22,8 @@
 
 package org.jboss.test.scanning.indexer;
 
+import org.jboss.test.scanning.indexer.test.IndexerRuntimeAnnotationsTestCase;
+import org.jboss.test.scanning.indexer.test.IndexerRuntimeHierarchyTestCase;
 import org.jboss.test.scanning.indexer.test.IndexerSmokeTestCase;
 
 import junit.framework.Test;
@@ -43,6 +45,8 @@
       TestSuite suite = new TestSuite("Indexer Tests");
 
       suite.addTest(IndexerSmokeTestCase.suite());
+      suite.addTest(IndexerRuntimeAnnotationsTestCase.suite());
+      suite.addTest(IndexerRuntimeHierarchyTestCase.suite());
 
       return suite;
    }

Copied: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.java (from rev 104041, projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.java)
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,170 @@
+/*
+ * 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.indexer.test;
+
+import javax.persistence.Entity;
+import javax.persistence.PrePersist;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Set;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.scanning.annotations.spi.AnnotationIndex;
+import org.jboss.scanning.annotations.spi.AnnotationRepository;
+import org.jboss.scanning.annotations.spi.Element;
+import org.jboss.scanning.spi.helpers.AbstractScanner;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class IndexerRuntimeAnnotationsTestCase extends IndexerTest
+{
+   public IndexerRuntimeAnnotationsTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(IndexerRuntimeAnnotationsTestCase.class);
+   }
+
+   public void testBasicSystemUsage() throws Exception
+   {
+      testSystemUsage("defaultpar", false, false);
+   }
+
+   public void testMergeSystemUsage() throws Exception
+   {
+      testSystemUsage("defaultpar", true, false);
+   }
+
+   public void testPreIndexedSystemUsage() throws Exception
+   {
+      testSystemUsage("defaultpar", true, true);
+   }
+
+   public void testBasicLocalUsage() throws Exception
+   {
+      testLocalUsage("foobar", false, false);
+   }
+
+   public void testMergeLocalUsage() throws Exception
+   {
+      testLocalUsage("foobar", true, false);
+   }
+
+   public void testPreIndexedLocalUsage() throws Exception
+   {
+      testLocalUsage("foobar", true, true);
+   }
+
+   protected void testSystemUsage(String name, boolean preIndexed, boolean ignoreRuntimeScan) throws Exception
+   {
+      URL url = getResource("/hibernate/" + name + ".jar");
+
+      VirtualFile file;
+      if (preIndexed)
+         file = getIndexedFile(url, "@");
+      else
+         file = VFS.getChild(url);
+
+      Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      if (ignoreRuntimeScan)
+         ((MutableAttachments)(deployment.getPredeterminedManagedObjects())).addAttachment(AbstractScanner.IGNORE_RUNTIME_SCAN, true);
+      getDeployerClient().deploy(deployment);
+
+      DeploymentUnit unit = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
+      try
+      {
+         AnnotationRepository repository = unit.getAttachment(AnnotationIndex.class);
+         assertNotNull(repository);
+         // annotations
+         Set<Element<Entity,Class<?>>> classes = repository.classIsAnnotatedWith(Entity.class);
+         assertFalse(classes.isEmpty());
+         for (Element<Entity, Class<?>> elt : classes)
+         {
+            Class<?> clazz = elt.getOwner();
+            assertNotNull(clazz);
+            assertSame(clazz, elt.getAnnotatedElement());
+            assertNotNull(elt.getAnnotation());
+         }
+         Set<Element<PrePersist, Method>> methods = repository.classHasMethodAnnotatedWith(PrePersist.class);
+         assertFalse(methods.isEmpty());
+         for (Element<PrePersist, Method> elt : methods)
+         {
+            assertNotNull(elt.getOwner());
+            Method m = elt.getAnnotatedElement();
+            assertNotNull(m);
+            assertNotNull(elt.getAnnotation());
+         }
+      }
+      finally
+      {
+         undeploy(unit);
+      }
+   }
+
+   protected void testLocalUsage(String name, boolean preIndexed, boolean ignoreRuntimeScan) throws Exception
+   {
+      URL url = getResource("/indexer/" + name + ".jar");
+
+      VirtualFile file;
+      if (preIndexed)
+         file = getIndexedFile(url, "@");
+      else
+         file = VFS.getChild(url);
+
+      Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      if (ignoreRuntimeScan)
+         ((MutableAttachments)(deployment.getPredeterminedManagedObjects())).addAttachment(AbstractScanner.IGNORE_RUNTIME_SCAN, true);
+      getDeployerClient().deploy(deployment);
+
+      DeploymentUnit unit = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
+      try
+      {
+         AnnotationRepository repository = unit.getAttachment(AnnotationIndex.class);
+         assertNotNull(repository);
+         // annotations
+         Set<Element<Annotation, Class<?>>> classes = repository.classIsAnnotatedWith("com.alesj.foobar.ACME");
+         assertNotNull(classes);
+         assertEquals(1, classes.size());
+         Set<Element<Annotation, Method>> methods = repository.classHasMethodAnnotatedWith("com.alesj.foobar.ACME");
+         assertNotNull(methods);
+         assertEquals(1, methods.size());
+      }
+      finally
+      {
+         undeploy(unit);
+      }
+   }
+}
\ No newline at end of file

Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,99 @@
+/*
+ * 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.indexer.test;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.scanning.hierarchy.spi.HierarchyIndex;
+import org.jboss.scanning.spi.helpers.AbstractScanner;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class IndexerRuntimeHierarchyTestCase extends IndexerTest
+{
+   public IndexerRuntimeHierarchyTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(IndexerRuntimeHierarchyTestCase.class);
+   }
+
+   public void testBasicUsage() throws Exception
+   {
+      testUsage("foobar", false, false);
+   }
+
+   public void testMergeUsage() throws Exception
+   {
+      testUsage("foobar", true, false);
+   }
+
+   public void testPreIndexedUsage() throws Exception
+   {
+      testUsage("foobar", true, true);
+   }
+
+   protected void testUsage(String name, boolean preIndexed, boolean ignoreRuntimeScan) throws Exception
+   {
+      URL url = getResource("/indexer/" + name + ".jar");
+
+      VirtualFile file;
+      if (preIndexed)
+         file = getIndexedFile(url, "h");
+      else
+         file = VFS.getChild(url);
+      
+      Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      if (ignoreRuntimeScan)
+         ((MutableAttachments)(deployment.getPredeterminedManagedObjects())).addAttachment(AbstractScanner.IGNORE_RUNTIME_SCAN, true);
+      getDeployerClient().deploy(deployment);
+
+      DeploymentUnit unit = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
+      try
+      {
+         HierarchyIndex index = unit.getAttachment(HierarchyIndex.class);
+         Class<?> clazz = unit.getClassLoader().loadClass("com.alesj.foobar.FooBar");
+         Set<TypeInfo> classes = index.getInheritedClasses(url, clazz);
+         assertNotNull(classes);
+         assertEquals(2, classes.size());
+      }
+      finally
+      {
+         undeploy(unit);
+      }
+   }
+}
\ No newline at end of file

Deleted: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -1,130 +0,0 @@
-/*
- * 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.indexer.test;
-
-import javax.persistence.Entity;
-import javax.persistence.PrePersist;
-
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.Set;
-
-import org.jboss.classloader.plugins.filter.CombiningClassFilter;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
-import org.jboss.classloader.spi.filter.ClassFilterUtils;
-import org.jboss.classloader.spi.filter.PackageClassFilter;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.spi.attachments.MutableAttachments;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.scanning.annotations.spi.AnnotationIndex;
-import org.jboss.scanning.annotations.spi.AnnotationRepository;
-import org.jboss.scanning.annotations.spi.Element;
-import org.jboss.scanning.spi.helpers.AbstractScanner;
-import org.jboss.test.scanning.ScanningDeployersTest;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-
-import junit.framework.Test;
-import org.hibernate.ejb.packaging.Scanner;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class IndexerRuntimeTestCase extends ScanningDeployersTest
-{
-   public IndexerRuntimeTestCase(String name)
-   {
-      super(name);
-   }
-
-   public static Test suite()
-   {
-      return suite(IndexerRuntimeTestCase.class);
-   }
-
-   public void testBasicUsage() throws Exception
-   {
-      testUsage("defaultpar", false);
-   }
-
-   public void testMergeUsage() throws Exception
-   {
-      testUsage("pre-defaultpar", false);
-   }
-
-   public void testPreIndexedUsage() throws Exception
-   {
-      testUsage("pre-defaultpar", true);
-   }
-
-   protected void testUsage(String name, boolean preIndexed) throws Exception
-   {
-      ClassLoaderSystem system = (ClassLoaderSystem) getBean("ClassLoaderSystem", ControllerState.INSTALLED);
-      // we need to see hibernate/jpa
-      ClassFilter hibernateFilter = new PackageClassFilter(new String[]{Scanner.class.getPackage().getName(), Entity.class.getPackage().getName()});
-      ClassFilter before = new CombiningClassFilter(false, new ClassFilter[]{ClassFilterUtils.JAVA_ONLY, hibernateFilter});
-      ParentPolicy parentPolicy = new ParentPolicy(before, ClassFilterUtils.NOTHING);
-      system.getDefaultDomain().setParentPolicy(parentPolicy);
-
-      URL url = getResource("/hibernate/" + name + ".jar");
-      VirtualFile file = VFS.getChild(url);
-      Deployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
-      if (preIndexed)
-         ((MutableAttachments)(deployment.getPredeterminedManagedObjects())).addAttachment(AbstractScanner.IGNORE_RUNTIME_SCAN, true);
-      getDeployerClient().deploy(deployment);
-
-      DeploymentUnit unit = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
-      try
-      {
-         AnnotationRepository repository = unit.getAttachment(AnnotationIndex.class);
-         assertNotNull(repository);
-         // annotations
-         Set<Element<Entity,Class<?>>> classes = repository.classIsAnnotatedWith(Entity.class);
-         assertFalse(classes.isEmpty());
-         for (Element<Entity, Class<?>> elt : classes)
-         {
-            Class<?> clazz = elt.getOwner();
-            assertNotNull(clazz);
-            assertSame(clazz, elt.getAnnotatedElement());
-            assertNotNull(elt.getAnnotation());
-         }
-         Set<Element<PrePersist, Method>> methods = repository.classHasMethodAnnotatedWith(PrePersist.class);
-         assertFalse(methods.isEmpty());
-         for (Element<PrePersist, Method> elt : methods)
-         {
-            assertNotNull(elt.getOwner());
-            Method m = elt.getAnnotatedElement();
-            assertNotNull(m);
-            assertNotNull(elt.getAnnotation());
-         }
-      }
-      finally
-      {
-         undeploy(unit);
-      }
-   }
-}
\ No newline at end of file

Modified: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerSmokeTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerSmokeTestCase.java	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerSmokeTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -52,7 +52,13 @@
 
    public void testSmoke() throws Exception
    {
-      URL url = getResource("/hibernate/defaultpar.jar");
+      //testSmoke("/hibernate/defaultpar.jar");
+      testSmoke("/indexer/foobar.jar");
+   }
+
+   protected void testSmoke(String resource) throws Exception
+   {
+      URL url = getResource(resource);
       File input = new File(url.toURI());
       Set<String> providers = Constants.applyAliases("@", "h");
       File output = ScanUtils.scan(input, providers);
@@ -75,7 +81,7 @@
       }
       finally
       {
-         assertTrue(output.delete());
+         //assertTrue(output.delete());
       }
    }
 }

Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerTest.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerTest.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/indexer/test/IndexerTest.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,55 @@
+/*
+ * 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.indexer.test;
+
+import java.io.File;
+import java.net.URL;
+
+import org.jboss.scanning.indexer.Constants;
+import org.jboss.scanning.indexer.core.ScanUtils;
+import org.jboss.test.scanning.ScanningDeployersTest;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * Abstract indexer test.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class IndexerTest extends ScanningDeployersTest
+{
+   protected IndexerTest(String name)
+   {
+      super(name);
+   }
+
+   protected VirtualFile getIndexedFile(URL original, String... providers) throws Exception
+   {
+      File input = new File(original.toURI());
+      File output = ScanUtils.scan(input, Constants.applyAliases(providers));
+      File dest = new File(input.getParent(), "pre-" + input.getName());
+      assertTrue(output.renameTo(dest));
+      dest.deleteOnExit(); // delete when done
+      return VFS.getChild(dest.toURI());
+   }
+}
\ No newline at end of file

Copied: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/SmokeTestSuite.java (from rev 103839, projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/ScanningTestSuite.java)
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/SmokeTestSuite.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/SmokeTestSuite.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,49 @@
+/*
+ * 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.smoke;
+
+import org.jboss.test.scanning.smoke.test.DeploymentSmokeTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class SmokeTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("Smoke Tests");
+
+      suite.addTest(DeploymentSmokeTestCase.suite());
+
+      return suite;
+   }
+}
\ No newline at end of file

Added: projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.java
===================================================================
--- projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.java	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/java/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.java	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,85 @@
+/*
+ * 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.smoke.test;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.scanning.annotations.spi.AnnotationIndex;
+import org.jboss.test.scanning.ScanningDeployersTest;
+import org.jboss.test.scanning.annotations.support.Marked;
+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.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DeploymentSmokeTestCase extends ScanningDeployersTest
+{
+   public DeploymentSmokeTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(DeploymentSmokeTestCase.class);
+   }
+
+   public void testSubSub() throws Exception
+   {
+      VirtualFile ear = createTopLevelWithUtil();
+      createAssembledDirectory(ear.getChild("my.jar"))
+        .addPackage(JarMarkOnClassImpl.class)
+        .addPackage(JarMarkOnClass.class)
+        .addPath("/smoke/my.ear/my.jar");
+
+      DeploymentUnit earDU = assertDeploy(ear);
+      try
+      {
+         DeploymentUnit sub = assertChild(earDU, "my.jar");
+         DeploymentUnit subsub = assertChild(sub, "fst-jboss-beans.xml", false);
+         AnnotationIndex index = subsub.getAttachment(AnnotationIndex.class);
+         assertNull(index); // we don't expect any indexed info from file sub-deployment
+      }
+      finally
+      {
+         undeploy(earDU);
+      }
+   }
+
+   protected VirtualFile createTopLevelWithUtil() throws Exception
+   {
+      VirtualFile topLevel = VFS.getChild(getName()).getChild("top-level.ear");
+
+      createAssembledDirectory(topLevel)
+         .addPackage("lib/util.jar", Util.class)
+         .addPackage("lib/ext.jar", External.class)
+         .addPackage("lib/ann.jar", Marked.class);
+      return topLevel;
+   }
+}

Added: projects/scanning/trunk/testsuite/src/test/resources/bootstrap/classpool.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/bootstrap/classpool.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/bootstrap/classpool.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,39 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+    <!-- Javassist + Classpool -->
+
+    <bean name="ClassLoaderScopingPolicy" class="org.jboss.classpool.plugins.jbosscl.VFSClassLoaderDomainRegistry">
+       <constructor factoryMethod="getInstance"/>
+    </bean>
+
+    <bean name="RegisterModuleCallback" class="org.jboss.classpool.plugins.jbosscl.RegisterModuleCallback">
+       <constructor>
+         <parameter><inject bean="ClassLoaderScopingPolicy"/></parameter>
+       </constructor>
+       <install method="addModuleRegistry" bean="ClassLoading" whenRequired="Start">
+         <parameter><this/></parameter>
+       </install>
+       <uninstall method="removeModuleRegistry" bean="ClassLoading" whenRequired="Start">
+         <parameter><this/></parameter>
+       </uninstall>
+    </bean>
+
+    <bean name="ClassPoolFactory" class="org.jboss.classpool.plugins.jbosscl.JBossClDelegatingClassPoolFactory">
+       <constructor>
+          <parameter><inject bean="ClassLoaderScopingPolicy"/></parameter>
+          <parameter><inject bean="RegisterModuleCallback"/></parameter>
+       </constructor>
+    </bean>
+
+    <bean name="ClassPoolRepository" class="org.jboss.classpool.plugins.jbosscl.JBossClDelegatingClassPoolRepository">
+       <constructor factoryMethod="getInstance"/>
+       <property name="classPoolFactory"><inject bean="ClassPoolFactory"/></property>
+    </bean>
+
+    <bean name="PoolFactoryInitializer" class="org.jboss.test.scanning.classpool.support.PoolFactoryInitializer">
+       <constructor>
+          <parameter><inject bean="ClassPoolRepository"/></parameter>
+       </constructor>
+    </bean>
+
+</deployment>

Deleted: projects/scanning/trunk/testsuite/src/test/resources/hibernate/pre-defaultpar.jar
===================================================================
(Binary files differ)

Modified: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.xml	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/hierarchy/test/HierarchyUnitTestCase.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -11,5 +11,5 @@
   </bean>
 
   <bean name="AnnScanningPlugin" class="org.jboss.scanning.hierarchy.plugins.HierarchyIndexScanningPluginFactory" />
-    
+
 </deployment>

Copied: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.xml (from rev 104005, projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.xml)
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeAnnotationsTestCase.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,12 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="jpa-deployer" class="org.jboss.test.scanning.hibernate.support.MockJPADeployer"/>  
+
+  <bean name="AnnEnvDeployer" class="org.jboss.scanning.deployers.ScanningDeployer">
+    <incallback method="addFactory" />
+    <uncallback method="removeFactory" />
+  </bean>
+
+  <bean name="AnnScanningPlugin" class="org.jboss.scanning.annotations.plugins.AnnotationsScanningPluginFactory" />
+
+</deployment>

Added: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeHierarchyTestCase.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,10 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="AnnEnvDeployer" class="org.jboss.scanning.deployers.ScanningDeployer">
+    <incallback method="addFactory" />
+    <uncallback method="removeFactory" />
+  </bean>
+
+  <bean name="HScanningPlugin" class="org.jboss.scanning.hierarchy.plugins.HierarchyIndexScanningPluginFactory" />
+
+</deployment>

Deleted: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.xml	2010-04-20 15:45:21 UTC (rev 104084)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/indexer/test/IndexerRuntimeTestCase.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -1,12 +0,0 @@
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
-  <bean name="jpa-deployer" class="org.jboss.test.scanning.hibernate.support.MockJPADeployer"/>  
-
-  <bean name="AnnEnvDeployer" class="org.jboss.scanning.deployers.ScanningDeployer">
-    <incallback method="addFactory" />
-    <uncallback method="removeFactory" />
-  </bean>
-
-  <bean name="AnnScanningPlugin" class="org.jboss.scanning.annotations.plugins.AnnotationsScanningPluginFactory" />
-
-</deployment>

Added: projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/org/jboss/test/scanning/smoke/test/DeploymentSmokeTestCase.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -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.scanning.annotations.plugins.AnnotationsScanningPluginFactory"/>      
+
+</deployment>

Added: projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/MANIFEST.MF
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/MANIFEST.MF	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/MANIFEST.MF	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Created-By: hand

Added: projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/snd-jboss-beans.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/snd-jboss-beans.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/META-INF/snd-jboss-beans.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+    <bean name="barfoo" class="org.jboss.test.scanning.annotations.support.jar.impl.JarMarkOnClassExt"/>
+
+</deployment>

Added: projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/fst-jboss-beans.xml
===================================================================
--- projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/fst-jboss-beans.xml	                        (rev 0)
+++ projects/scanning/trunk/testsuite/src/test/resources/smoke/my.ear/my.jar/fst-jboss-beans.xml	2010-04-20 15:50:56 UTC (rev 104085)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+    <bean name="foobar" class="org.jboss.test.scanning.annotations.support.jar.impl.JarMarkOnClassImpl"/>
+
+</deployment>




More information about the jboss-cvs-commits mailing list