[jboss-cvs] JBossAS SVN: r67062 - in projects/microcontainer/trunk/aop-mc-int/src: main/org/jboss/aop/microcontainer/beans2 and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 14 06:32:55 EST 2007


Author: kabir.khan at jboss.com
Date: 2007-11-14 06:32:54 -0500 (Wed, 14 Nov 2007)
New Revision: 67062

Added:
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AbstractAnnotation.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationIntroduction.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationOverride.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Aspect.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AspectBinding.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/BindingEntry.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/CFlowStack.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DelegatingBeanAspectFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DynamicCFlowDef.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/GenericBeanAspectFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/IntroductionBinding.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/MixinEntry.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/NamedPointcut.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/PrecedenceDef.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Prepare.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/TypeDef.java
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation1.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation2.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Dependency.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/DynamicCFlowImpl.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Interceptions.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/IntroductionInterface.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinImpl.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinInterface.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO2.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassJoinPointAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerInstanceAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerJoinPointAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerVmAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleAspectFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryInterceptor.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleInterceptorFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspect.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithDependency.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithProperty.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptor.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptorWithDependency.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansDifferentOrderTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.java
Log:
Add new underlying beans to support the full -aop.xml stuff in the microcontainer. 
This will all be moved around, I just wanted to commit before I start doing that

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AbstractAnnotation.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AbstractAnnotation.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AbstractAnnotation.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.introduction.AnnotationIntroduction;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractAnnotation
+{
+   protected AspectManager manager;
+   private String expr;
+   private String annotation;
+   private boolean invisible = false;
+   protected AnnotationIntroduction intro;
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+
+   public String getAnnotation()
+   {
+      return annotation;
+   }
+
+   public void setAnnotation(String annotation)
+   {
+      this.annotation = annotation;
+   }
+
+   public boolean isInvisible()
+   {
+      return invisible;
+   }
+
+   public void setInvisible(boolean invisible)
+   {
+      this.invisible = invisible;
+   }
+   
+   public abstract void start();
+   
+   protected AnnotationIntroduction validateAndCreate()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (expr == null)
+      {
+         throw new IllegalArgumentException("Null expr");
+      }
+      if (annotation == null)
+      {
+         throw new IllegalArgumentException("Null annotation");
+      }
+      
+      intro = AnnotationIntroduction.createComplexAnnotationIntroduction(expr, annotation, invisible);
+      return intro;
+   }
+   
+   
+   
+   public abstract void stop();
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationIntroduction.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationIntroduction.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationIntroduction.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationIntroduction extends AbstractAnnotation
+{
+   public void start()
+   {
+      validateAndCreate();
+      manager.addAnnotationIntroduction(intro);
+   }
+   
+   @Override
+   public void stop()
+   {
+      manager.removeAnnotationIntroduction(intro);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationOverride.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationOverride.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AnnotationOverride.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationOverride extends AbstractAnnotation
+{
+   @Override
+   public void start()
+   {
+      validateAndCreate();
+      manager.addAnnotationOverride(intro);
+   }
+   
+   @Override
+   public void stop()
+   {
+      manager.removeAnnotationOverride(intro);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Aspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Aspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Aspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,330 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.aop.microcontainer.beans2;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.AspectDefinition;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.advice.AspectFactoryDelegator;
+import org.jboss.aop.advice.GenericAspectFactory;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.advice.ScopeUtil;
+import org.jboss.aop.instrument.Untransformable;
+import org.jboss.aop.microcontainer.beans.ManagedAspectDefinition;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.ConfigureKernelControllerContextAware;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.logging.Logger;
+import org.jboss.util.id.GUID;
+
+/**
+ * An Aspect.
+ * This installs the AspectDefinition and AspectFactory into aop
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 61194 $
+ */
+public class Aspect implements ConfigureKernelControllerContextAware, Untransformable
+{
+   private static final Logger log = Logger.getLogger(Aspect.class);
+
+   /**
+    * The AspectManager/Domain we are creating this aspect for
+    */
+   protected AspectManager manager;
+
+   protected String adviceName = GUID.asString();
+   
+   /**
+    * True if aspect is an aspect factory, rather than the aspect itself
+    */
+   protected boolean factory; 
+
+   /**
+    * The scope of the aspect we are creating
+    */
+   protected Scope scope;
+
+   protected ManagedAspectDefinition definition;
+
+   /**
+    * The beanfactory representing the advice. This should be used if the advice has no dependencies,
+    * in which case we have a real dependency on the beanfactory. If the advice has dependencies we need
+    * to use adviceBean instead;
+    */
+   protected GenericBeanFactory advice;
+
+   /**
+    * The name of the beanfactory representing the advice. This should be used if the advice has dependencies,
+    * in which case we have no real dependency on the beanfactory. If the advice has no dependencies we need
+    * to use advice instead;
+    */
+   protected String adviceBean;
+
+   /**
+    * The KernelControllerContext for this Aspect
+    */
+   protected ControllerContext context;
+
+   /** The name of this bean */
+   protected String myname;
+
+   /** The name of the AspectDefinition. If not lazy (i.e, bean has no dependencies), use myname.
+    * If lazy (i.e. bean has dependencies), use adviceBean */
+   protected String aspectDefName;
+
+   /**
+    * All the AspectBindings referencing this Aspect
+    */
+   protected Map<String, AspectBinding> aspectBindings = new LinkedHashMap<String, AspectBinding>();
+   
+   /**
+    * Get the adviceName.
+    *
+    * @return the adviceName.
+    */
+   public String getAdviceName()
+   {
+      return adviceName;
+   }
+
+   /**
+    * Sets if we are an aspect factory or not
+    */
+   public void setFactory(boolean factory)
+   {
+      this.factory = factory;
+   }
+
+   /**
+    * Set the adviceName.
+    *
+    * @param adviceName The adviceName to set.
+    */
+   public void setAdviceName(String adviceName)
+   {
+      this.adviceName = adviceName;
+   }
+
+   /**
+    * Get the adviceBean.
+    *
+    * @return the adviceBean.
+    */
+   public String getAdviceBean()
+   {
+      return adviceBean;
+   }
+
+   /**
+    * Set the adviceBean.
+    *
+    * @param adviceBean the adviceBean.
+    */
+   public void setAdviceBean(String adviceBean)
+   {
+      this.adviceBean = adviceBean;
+   }
+
+   /**
+    * Get the definition.
+    *
+    * @return the definition.
+    */
+   public AspectDefinition getDefinition()
+   {
+      return definition;
+   }
+
+   /**
+    * Get the manager.
+    *
+    * @return the manager.
+    */
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   /**
+    * Set the manager.
+    *
+    * @param manager The manager to set.
+    */
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   /**
+    * Get the advice.
+    *
+    * @return the advice.
+    */
+   public GenericBeanFactory getAdvice()
+   {
+      return advice;
+   }
+
+   /**
+    * Set the advice.
+    *
+    * @param advice The advice to set.
+    */
+   public void setAdvice(GenericBeanFactory advice)
+   {
+      this.advice = advice;
+   }
+
+   /**
+    * Get the scope.
+    *
+    * @return the scope.
+    */
+   public String getScope()
+   {
+      return scope.toString();
+   }
+
+   /**
+    * Set the scope.
+    *
+    * @param scope The scope to set.
+    */
+   public void setScope(String scope)
+   {
+      this.scope = ScopeUtil.parse(scope);
+   }
+
+   public void setKernelControllerContext(KernelControllerContext context) throws Exception
+   {
+      myname = (String)context.getName();
+      this.context = context;
+   }
+
+   public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
+   {
+      this.context = null;
+   }
+
+   public void install(GenericBeanFactory factory) throws Exception
+   {
+      this.advice = factory;
+      start();
+   }
+
+   public void start() throws Exception
+   {
+      if (definition == null)
+      {
+         aspectDefName = (adviceBean != null) ? adviceBean : myname;
+         if (manager == null)
+            throw new IllegalArgumentException("Null manager");
+         if (advice != null)
+         {
+            definition = getAspectDefinitionNoDependencies();
+         }
+         else if (adviceBean != null && context.getController() != null)
+         {
+            definition = getAspectDefintionDependencies();
+         }
+         else
+         {
+            //Not sure when this would get called???
+            definition = getAspectDefinitionPlainAspectFactory();
+         }
+         addDefinitionToManager();
+      }
+
+      if (adviceBean != null && advice != null)
+      {
+         definition.setDeployed(true);
+         GenericBeanAspectFactory factory = (GenericBeanAspectFactory)definition.getFactory();
+         factory.setBeanFactory(advice);
+      }
+      
+      for (AspectBinding aspectBinding : aspectBindings.values())
+      {
+         aspectBinding.rebind();
+      }
+         
+      log.debug("Bound aspect " + aspectDefName + "; deployed:" + definition.isDeployed());
+   }
+
+   protected ManagedAspectDefinition getAspectDefinitionNoDependencies()
+   {
+      AspectFactory factory = this.factory ?  
+            new DelegatingBeanAspectFactory(adviceName, advice) : new GenericBeanAspectFactory(adviceName, advice);
+      return new ManagedAspectDefinition(aspectDefName, scope, factory);
+   }
+
+   protected ManagedAspectDefinition getAspectDefintionDependencies()
+   {
+      AspectFactory factory = this.factory ?  
+            new DelegatingBeanAspectFactory(aspectDefName, advice) : new GenericBeanAspectFactory(aspectDefName, advice);
+      return new ManagedAspectDefinition(aspectDefName, scope, factory, false);
+   }
+
+   protected ManagedAspectDefinition getAspectDefinitionPlainAspectFactory()
+   {
+      AspectFactory factory = this.factory ?  
+            new AspectFactoryDelegator(adviceName, null) : new GenericAspectFactory(adviceName, null);
+      return new ManagedAspectDefinition(aspectDefName, scope, factory);
+   }
+
+   protected void addDefinitionToManager()
+   {
+      manager.addAspectDefinition(definition);
+   }
+
+   public void uninstall() throws Exception
+   {
+      stop();
+   }
+
+
+   public void stop()
+   {
+      aspectDefName = (adviceBean != null) ? adviceBean : myname;
+      log.debug("Unbinding aspect " + aspectDefName);
+      manager.removeAspectDefinition(aspectDefName);
+      if (definition != null)
+      {
+         definition.undeploy();
+         definition = null;
+      }
+   }
+   
+   void addAspectBinding(AspectBinding binding)
+   {
+      aspectBindings.put(binding.getName(), binding);
+   }
+   
+   void removeAspectBinding(AspectBinding binding)
+   {
+      aspectBindings.remove(binding.getName());
+   }
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AspectBinding.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AspectBinding.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/AspectBinding.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,158 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.aop.microcontainer.beans2;
+
+import java.util.List;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.AdviceBinding;
+import org.jboss.aop.advice.InterceptorFactory;
+import org.jboss.logging.Logger;
+import org.jboss.util.id.GUID;
+
+/**
+ * An AspectBinding.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 61194 $
+ */
+public class AspectBinding
+{
+   private static final Logger log = Logger.getLogger(AspectBinding.class);
+
+   protected AspectManager manager;
+
+   protected String name = GUID.asString();
+
+   protected String pointcut;
+
+   protected List<BindingEntry> advices;
+
+   protected String cflow;
+   /**
+    * Get the manager.
+    *
+    * @return the manager.
+    */
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   /**
+    * Set the manager.
+    *
+    * @param manager The manager to set.
+    */
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   
+   public String getCflow()
+   {
+      return cflow;
+   }
+
+   public void setCflow(String cflow)
+   {
+      this.cflow = cflow;
+   }
+
+   /**
+    * Get the pointcut.
+    *
+    * @return the pointcut.
+    */
+   public String getPointcut()
+   {
+      return pointcut;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+   
+   /**
+    * Set the pointcut.
+    *
+    * @param pointcut The pointcut to set.
+    */
+   public void setPointcut(String pointcut)
+   {
+      this.pointcut = pointcut;
+   }
+
+   public List<BindingEntry> getAdvices()
+   {
+      return advices;
+   }
+
+   public void setAdvices(List<BindingEntry> advices)
+   {
+      this.advices = advices;
+   }
+
+   public void start() throws Exception
+   {
+      if (pointcut == null)
+         throw new IllegalArgumentException("Null pointcut");
+      if (manager == null)
+         throw new IllegalArgumentException("Null manager");
+      AdviceBinding binding = new AdviceBinding(name, pointcut, cflow);
+
+      for (BindingEntry entry : advices)
+      {
+         entry.start();
+         InterceptorFactory[] factories = entry.getInterceptorFactories();
+         for (InterceptorFactory ifac : factories)
+         {
+            binding.addInterceptorFactory(ifac);
+         }
+      }
+      manager.addBinding(binding);
+      log.debug("Bound binding " + name);
+   }
+
+   public void stop() throws Exception
+   {
+      manager.removeBinding(name);
+      for (BindingEntry entry : advices)
+      {
+         entry.stop();
+      }
+   }
+
+   public void uninstall() throws Exception
+   {
+      stop();
+   }
+
+   public void rebind() throws Exception
+   {
+      stop();
+      start();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/BindingEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/BindingEntry.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/BindingEntry.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.InterceptorFactory;
+import org.jboss.util.id.GUID;
+
+/**
+ * Abstract base class for things that can go inside bindings (stack refs, advice and interceptor-ref)
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class BindingEntry
+{
+   String name = new GUID().toString();
+   AspectManager manager;
+   AspectBinding aspectBinding;
+
+   public abstract InterceptorFactory[] getInterceptorFactories();
+   
+   public abstract void start();
+   
+   public abstract void stop();
+
+   public AspectBinding getAspectBinding()
+   {
+      return aspectBinding;
+   }
+
+   public void setAspectBinding(AspectBinding aspectBinding)
+   {
+      this.aspectBinding = aspectBinding;
+   }
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+   
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/CFlowStack.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/CFlowStack.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/CFlowStack.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.LinkedHashMap;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.pointcut.CFlow;
+
+/**
+ * Bean to install a CFlowStack
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CFlowStack
+{
+   public static final String CALLED = "called";
+   public static final String NOT_CALLED = "not-called";
+
+   /**
+    * The AspectManager
+    */
+   private AspectManager manager;
+   
+   /**
+    * The name of the resulting CFlowStack
+    */
+   private String name;
+   
+   /**
+    * The CFlowStack entries
+    * Key is 'not-called' or 'called', value is the pointcut expression
+    */
+   private LinkedHashMap<String, String> entries;
+   
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public LinkedHashMap<String, String> getEntries()
+   {
+      return entries;
+   }
+   
+   public void setEntries(LinkedHashMap<String, String> entries)
+   {
+      this.entries = entries;
+   }
+   
+   public void start()
+   {
+      if (name == null || name.length() == 0)
+      {
+         throw new IllegalArgumentException("Null name");
+      }
+      if (entries == null || entries.size() == 0)
+      {
+         throw new IllegalArgumentException("No entries");
+      }
+      
+      org.jboss.aop.pointcut.CFlowStack stack = new org.jboss.aop.pointcut.CFlowStack(name);
+      for (String key : entries.keySet())
+      {
+         System.out.println("----- " + key);
+         if (!key.equals(CALLED) && !key.equals(NOT_CALLED))
+         {
+            throw new IllegalArgumentException("Invalid key used for cflow " + key);
+         }
+         String expr = entries.get(key); 
+         boolean notCalled = NOT_CALLED.equals(key);
+         stack.addCFlow(new CFlow(expr, notCalled));
+      }
+      manager.addCFlowStack(stack);
+   }
+   
+   public void stop()
+   {
+      manager.removeCFlowStack(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DelegatingBeanAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DelegatingBeanAspectFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DelegatingBeanAspectFactory.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,104 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DelegatingBeanAspectFactory implements AspectFactory
+{
+   private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); 
+
+   protected BeanFactory factory;
+
+   protected String name;
+   
+   public DelegatingBeanAspectFactory(String name, BeanFactory factory)
+   {
+      this.name = name;
+      this.factory = factory;
+   }
+
+   public void setBeanFactory(GenericBeanFactory factory)
+   {
+      this.factory = factory;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+
+   public Object createPerVM()
+   {
+      AspectFactory factory = doCreate();
+      return factory.createPerVM();
+   }
+
+   public Object createPerClass(Advisor advisor)
+   {
+      AspectFactory factory = doCreate();
+      return factory.createPerClass(advisor);
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      AspectFactory factory = doCreate();
+      return factory.createPerInstance(advisor, instanceAdvisor);
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      AspectFactory factory = doCreate();
+      return factory.createPerJoinpoint(advisor, jp);
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      AspectFactory factory = doCreate();
+      return factory.createPerJoinpoint(advisor, instanceAdvisor, jp);
+   }
+
+   protected AspectFactory doCreate()
+   {
+      try
+      {
+         log.debug("Creating advice " + name);
+         return (AspectFactory)factory.createBean();
+      }
+      catch (Throwable throwable)
+      {
+         throw new RuntimeException(throwable);
+      }
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DynamicCFlowDef.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DynamicCFlowDef.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/DynamicCFlowDef.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,99 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.LinkedHashMap;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.DynamicCFlowDefinition;
+
+/**
+ * Bean to install a DynamicCFlow
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DynamicCFlowDef
+{
+   /**
+    * The AspectManager
+    */
+   private AspectManager manager;
+   
+   /**
+    * The name of the resulting DynamicCFlow
+    */
+   private String name;
+   
+   /**
+    * The name of the class implementing the dynamic cflow 
+    */
+   private String className;
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getClassName()
+   {
+      return className;
+   }
+
+   public void setClassName(String className)
+   {
+      this.className = className;
+   }
+
+   public void start()
+   {
+      if (name == null || name.length() == 0)
+         throw new IllegalArgumentException("Null name");
+      if (className == null || className.length() == 0)
+         throw new IllegalArgumentException("Null className");
+      if (manager == null)
+         throw new IllegalArgumentException("Null manager");
+      
+      DynamicCFlowDefinition dynamic = new DynamicCFlowDefinition(null, className, name);
+      manager.addDynamicCFlow(name, dynamic);
+   }
+   
+   public void stop()
+   {
+      manager.removeCFlowStack(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/GenericBeanAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/GenericBeanAspectFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/GenericBeanAspectFactory.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,99 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.aop.microcontainer.beans2;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+import org.jboss.logging.Logger;
+
+/**
+ * A GenericBeanAspectFactory.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 61978 $
+ */
+public class GenericBeanAspectFactory implements AspectFactory
+{
+   private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); 
+
+   protected BeanFactory factory;
+
+   protected String name;
+   
+   public GenericBeanAspectFactory(String name, BeanFactory factory)
+   {
+      this.name = name;
+      this.factory = factory;
+   }
+
+   public void setBeanFactory(GenericBeanFactory factory)
+   {
+      this.factory = factory;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+
+   public Object createPerVM()
+   {
+      return doCreate();
+   }
+
+   public Object createPerClass(Advisor advisor)
+   {
+      return doCreate();
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      return doCreate();
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      return doCreate();
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      return doCreate();
+   }
+
+   protected Object doCreate()
+   {
+      try
+      {
+         log.debug("Creating advice " + name);
+         return factory.createBean();
+      }
+      catch (Throwable throwable)
+      {
+         throw new RuntimeException(throwable);
+      }
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/InterceptorEntry.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,107 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.advice.AdviceFactory;
+import org.jboss.aop.advice.InterceptorFactory;
+import org.jboss.aop.advice.ScopedInterceptorFactory;
+
+/**
+ * An interceptor-ref or advice entry. Installs an InterceptorFactory into its binding and into aop
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorEntry extends BindingEntry implements Cloneable
+{
+   Aspect aspect;
+   String aspectMethod;
+   InterceptorFactory interceptorFactory;
+   
+   public Aspect getAspect(Aspect aspect)
+   {
+      return aspect;
+   }
+   
+   public void setAspect(Aspect aspect)
+   {
+      this.aspect = aspect;
+   }
+   
+   public String getAspectMethod()
+   {
+      return aspectMethod;
+   }
+   
+   public void setAspectMethod(String aspectMethod)
+   {
+      this.aspectMethod = aspectMethod;
+   }
+
+   public InterceptorFactory[] getInterceptorFactories()
+   {
+      return new InterceptorFactory[] {interceptorFactory};
+   }
+   
+   public InterceptorFactory getInterceptorFactory()
+   {
+      return interceptorFactory;
+   }
+   
+   public void start()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (aspectBinding == null)
+      {
+         throw new IllegalArgumentException("Null aspect binding");
+      }
+      if (aspect == null)
+      {
+         throw new IllegalArgumentException("Null aspect");
+      }
+      interceptorFactory = (aspectMethod == null) ? 
+            new ScopedInterceptorFactory(aspect.getDefinition()) : new AdviceFactory(aspect.getDefinition(), aspectMethod);
+            
+      manager.addInterceptorFactory(name, interceptorFactory);
+      aspect.addAspectBinding(aspectBinding);
+   }
+   
+   public void stop()
+   {
+      manager.removeInterceptorFactory(name);
+      aspect.removeAspectBinding(aspectBinding);
+      interceptorFactory = null;
+   }
+   
+   public Object clone()
+   {
+      InterceptorEntry entry = new InterceptorEntry();
+      entry.manager = manager;
+      entry.aspectBinding = aspectBinding;
+      entry.aspect = aspect;
+      entry.aspectMethod = aspectMethod;
+      return entry;
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/IntroductionBinding.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/IntroductionBinding.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/IntroductionBinding.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,187 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.aop.microcontainer.beans2;
+
+import java.io.StringReader;
+import java.util.List;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.introduction.InterfaceIntroduction;
+import org.jboss.aop.pointcut.ast.ASTStart;
+import org.jboss.aop.pointcut.ast.TypeExpressionParser;
+import org.jboss.util.id.GUID;
+
+/**
+ * An AspectBinding.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 58323 $
+ */
+public class IntroductionBinding 
+{
+   protected AspectManager manager;
+   protected String name = GUID.asString();
+   protected String classes;
+   protected String expr;
+   protected List<String> interfaces;
+   protected List<MixinEntry> mixins;
+
+   public IntroductionBinding()
+   {
+      super();
+   }
+
+   /**
+    * Get the interfaces.
+    * 
+    * @return the interfaces.
+    */
+   public List<String> getInterfaces()
+   {
+      return interfaces;
+   }
+
+   /**
+    * Set the interfaces.
+    * 
+    * @param interfaces The interfaces to set.
+    */
+   public void setInterfaces(List<String> interfaces)
+   {
+      this.interfaces = interfaces;
+   }
+
+   public List<MixinEntry> getMixins()
+   {
+      return mixins;
+   }
+
+   public void setMixins(List<MixinEntry> mixins)
+   {
+      this.mixins = mixins;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    * Get the classes.
+    * 
+    * @return the classes.
+    */
+   public String getClasses()
+   {
+      return classes;
+   }
+
+   /**
+    * Set the classes.
+    * 
+    * @param classes The classes to set.
+    */
+   public void setClasses(String classes)
+   {
+      this.classes = classes;
+   }
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+
+   /**
+    * Get the manager.
+    * 
+    * @return the manager.
+    */
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   /**
+    * Set the manager.
+    * 
+    * @param manager The manager to set.
+    */
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public void start() throws Exception
+   {
+      if (manager == null)
+         throw new IllegalArgumentException("Null manager");
+      if (classes == null && expr == null)
+         throw new IllegalArgumentException("Neither classes nor expr set");
+      if (classes != null && expr != null)
+         throw new IllegalArgumentException("Cannot set both classes and expr");
+      if (interfaces == null && mixins == null)
+         throw new IllegalArgumentException("Neither interfaces nor mixins set");
+      
+      String[] intfs = (interfaces != null) ? interfaces.toArray(new String[interfaces.size()]) : null;
+      
+      InterfaceIntroduction introduction = null;
+      if (classes != null)
+      {
+         introduction = new InterfaceIntroduction(name, classes, intfs);
+      }
+      else
+      {
+         ASTStart start = new TypeExpressionParser(new StringReader(expr)).Start();
+         introduction = new InterfaceIntroduction(name, start, intfs);
+      }
+      
+      if (mixins != null)
+      {
+         for (MixinEntry entry : mixins)
+         {
+            if (entry.getInterfaces() == null)
+               throw new IllegalArgumentException("MixinEntry with null interfaces");
+            if (entry.getMixin() == null)
+               throw new IllegalArgumentException("MixinEntry with null mixin");
+            String[] intfaces = entry.getInterfaces().toArray(new String[entry.getInterfaces().size()]);
+            
+            introduction.addMixin(new InterfaceIntroduction.Mixin(entry.getMixin(), intfaces, entry.getConstruction(), entry.isTransient()));
+         }
+      }      
+      manager.addInterfaceIntroduction(introduction);
+   }
+   
+   public void stop() throws Exception
+   {
+      manager.removeInterfaceIntroduction(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/MixinEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/MixinEntry.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/MixinEntry.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.List;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinEntry
+{
+   /** The interfaces implemented by the mixin */
+   protected List<String> interfaces;
+   
+   /** The mixin class name */
+   protected String mixin;
+   
+   /** How to construct the mixin class */
+   protected String construction;
+   
+   /** Should the mixin be transient or not */
+   protected boolean trans;
+   
+   
+   public String getMixin()
+   {
+      return mixin;
+   }
+
+   public void setMixin(String mixinClass)
+   {
+      this.mixin = mixinClass;
+   }
+
+   public String getConstruction()
+   {
+      return construction;
+   }
+   
+   public void setConstruction(String construction)
+   {
+      this.construction = construction;
+   }
+   
+   public boolean isTransient()
+   {
+      return trans;
+   }
+   
+   public void setTransient(boolean trans)
+   {
+      this.trans = trans;
+   }
+
+   public List<String> getInterfaces()
+   {
+      return interfaces;
+   }
+
+   public void setInterfaces(List<String> interfaces)
+   {
+      this.interfaces = interfaces;
+   }
+
+   public void start()
+   {
+      
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/NamedPointcut.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/NamedPointcut.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/NamedPointcut.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,105 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.pointcut.Pointcut;
+import org.jboss.aop.pointcut.PointcutExpression;
+import org.jboss.aop.pointcut.ast.ParseException;
+
+/**
+ * Defines a named pointcut in the underlying aspectmanager
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class NamedPointcut
+{
+   AspectManager manager;
+   
+   String name;
+   
+   String expr;
+   
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+   
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getExpr()
+   {
+      return expr;
+   }
+   
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+   
+   public void start()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (name == null || name.length() == 0)
+      {
+         throw new IllegalArgumentException("No name");
+      }
+      if (expr == null || expr.length() == 0)
+      {
+         throw new IllegalArgumentException("No expr");
+      }
+      
+      Pointcut p = null;
+      try
+      {
+         p = new PointcutExpression(name, expr);
+         manager.addPointcut(p);
+      }
+      catch (ParseException ex)
+      {
+         throw new RuntimeException("<pointcut name='" + name + "' expr='" + expr + "'/> failed", ex);
+      }
+   }
+   
+   public void stop()
+   {
+      manager.removePointcut(name);
+   }
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/PrecedenceDef.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/PrecedenceDef.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/PrecedenceDef.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,95 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.PrecedenceDefEntry;
+import org.jboss.util.id.GUID;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrecedenceDef
+{
+   private AspectManager manager;
+   private LinkedHashMap<String, String> entries;
+   private String name = GUID.asString();
+   
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+   
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+   
+   public LinkedHashMap<String, String> getentries()
+   {
+      return entries;
+   }
+   
+   public void setEntries(LinkedHashMap<String, String> precedenceEntries)
+   {
+      this.entries = precedenceEntries;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public void start()
+   {
+      if (manager == null)
+         throw new IllegalArgumentException("Null manager");
+      if (entries == null)
+         throw new IllegalArgumentException("Null entries");
+      if (entries.size() == 0)
+         throw new IllegalArgumentException("No entries");
+      
+      PrecedenceDefEntry[] pentries = new PrecedenceDefEntry[entries.size()];
+      int i = 0;
+      for (String aspect : entries.keySet())
+      {
+         pentries[i++] = new PrecedenceDefEntry(aspect, entries.get(aspect));
+      }
+      
+      manager.addPrecedence(new org.jboss.aop.advice.PrecedenceDef(name, pentries));
+   }
+   
+   public void stop()
+   {
+      manager.removePrecedence(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Prepare.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Prepare.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Prepare.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,99 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.pointcut.Pointcut;
+import org.jboss.aop.pointcut.PointcutExpression;
+import org.jboss.aop.pointcut.ast.ParseException;
+import org.jboss.util.id.GUID;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Prepare
+{
+   protected AspectManager manager;
+
+   protected String name = GUID.asString();
+
+   protected String expr;
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   public void setExpr(String pointcut)
+   {
+      this.expr = pointcut;
+   }
+
+   public void start()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (expr == null || expr.length() == 0)
+      {
+         throw new IllegalArgumentException("No pointcut");
+      }
+      Pointcut p = null;
+      try
+      {
+         p = new PointcutExpression(name, expr);
+      }
+      catch (ParseException ex)
+      {
+         throw new RuntimeException("<pointcut name='" + name + "' expr='" + expr + "'/> failed", ex);
+      }
+      manager.addPointcut(p);
+   }
+   
+   public void stop()
+   {
+      manager.removePointcut(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/Stack.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.aop.AspectManager;
+
+/**
+ * Defines an interceptor stack
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Stack
+{
+   private AspectManager manager;
+   
+   private String name;
+   
+   private List<InterceptorEntry> advices;
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public List<InterceptorEntry> getAdvices()
+   {
+      return advices;
+   }
+
+   public void setAdvices(List<InterceptorEntry> advices)
+   {
+      this.advices = advices;
+   }
+   
+   public List<InterceptorEntry> getClonedAdvices()
+   {
+      List<InterceptorEntry> entries = new ArrayList<InterceptorEntry>();
+ 
+      for (InterceptorEntry entry : advices)
+      {
+         entries.add((InterceptorEntry)entry.clone());
+      }
+      
+      return entries;
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/StackEntry.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,91 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import java.util.List;
+
+import org.jboss.aop.advice.InterceptorFactory;
+
+/**
+ * A stack-ref entry.
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackEntry extends BindingEntry
+{
+   Stack stack;
+   List<InterceptorEntry> advices; 
+   InterceptorFactory[] factories;
+   
+   public Stack getStack()
+   {
+      return stack;
+   }
+
+   public void setStack(Stack stack)
+   {
+      this.stack = stack;
+   }
+
+   public InterceptorFactory[] getInterceptorFactories()
+   {
+      return factories;
+   }
+
+   public void start()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("Null manager");
+      }
+      if (aspectBinding == null)
+      {
+         throw new IllegalArgumentException("Null aspect binding");
+      }
+      if (stack == null)
+      {
+         throw new IllegalArgumentException("Null stack");
+      }
+      advices = stack.getClonedAdvices();
+      if (advices == null)
+      {
+         throw new IllegalArgumentException("Null advices");
+      }
+         
+      
+      factories = new InterceptorFactory[advices.size()];
+      int i = 0;
+      for (InterceptorEntry entry : advices)
+      {
+         entry.start();
+         factories[i++] = entry.getInterceptorFactory(); 
+      }
+   }
+
+   public void stop()
+   {
+      advices = null;
+      factories = null;
+   }
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/TypeDef.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/TypeDef.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans2/TypeDef.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,107 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.microcontainer.beans2;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.pointcut.Typedef;
+import org.jboss.aop.pointcut.TypedefExpression;
+import org.jboss.aop.pointcut.ast.ParseException;
+
+/**
+ * Installs a typedef into the underlying aspect manager
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TypeDef
+{
+   private AspectManager manager;
+   
+   private String name;
+   
+   private String expr;
+
+   public AspectManager getManager()
+   {
+      return manager;
+   }
+
+   public void setManager(AspectManager manager)
+   {
+      this.manager = manager;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+   
+   public void start()
+   {
+      if (manager == null)
+      {
+         throw new IllegalArgumentException("No manager");
+      }
+      if (name == null || name.length() == 0)
+      {
+         throw new IllegalArgumentException("No name");
+      }
+      if (expr == null || expr.length() == 0)
+      {
+         throw new IllegalArgumentException("No expr");
+      }
+      
+      try
+      {
+         Typedef typedef = new TypedefExpression(name, expr);
+         manager.addTypedef(typedef);
+      }
+      catch(ParseException e)
+      {
+         throw new IllegalArgumentException("");
+      }
+      catch(Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   public void stop()
+   {
+      manager.removeTypedef(name);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="ClassAnnotationOverride" class="org.jboss.aop.microcontainer.beans2.AnnotationOverride">
+      <property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="expr">class(org.jboss.test.microcontainer.beans2.POJO)</property>
+   	<property name="annotation">@org.jboss.test.microcontainer.beans2.Annotation1</property>
+   	<property name="invisible">false</property>
+   </bean>
+
+   <bean name="MethodAnnotationOverride" class="org.jboss.aop.microcontainer.beans2.AnnotationOverride">
+      <property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="expr">method(void org.jboss.test.microcontainer.beans2.POJO->method())</property>
+   	<property name="annotation">@org.jboss.test.microcontainer.beans2.Annotation2</property>
+   	<property name="invisible">false</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+   
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans2.Annotation1->@org.jboss.test.microcontainer.beans2.Annotation2(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.test.microcontainer.beans2.TestAspectWithDependency">
+   	<property name="dependency"><inject bean="Dependency"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Intercepted" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+	<bean name="CFlow" class="org.jboss.aop.microcontainer.beans2.CFlowStack">
+      <property name="manager"><inject bean="AspectManager"/></property>
+		<property name="name">CFlow</property>
+		<property name="entries">
+         <map class="java.util.LinkedHashMap" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>called</key>
+               <value>void org.jboss.test.microcontainer.beans2.test.CFlowBeansTestCase->callPOJO(..)</value>
+            </entry>
+            <entry>
+               <key>not-called</key>
+               <value>void org.jboss.test.microcontainer.beans2.test.CFlowBeansTestCase->notCallPOJO(..)</value>
+            </entry>
+         </map>
+      </property>
+	</bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="cflow">CFlow</property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding1$" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+	<bean name="DynamicCFlow" class="org.jboss.aop.microcontainer.beans2.DynamicCFlowDef">
+      <property name="manager"><inject bean="AspectManager"/></property>
+		<property name="name">DynamicCFlow</property>
+		<property name="className">org.jboss.test.microcontainer.beans2.DynamicCFlowImpl</property>
+	</bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="cflow">DynamicCFlow</property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding1$" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory" class="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency">
+   	<property name="dependency"><inject bean="Dependency"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestInterceptorBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <!-- We need cflow as well -->
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestInterceptorBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency"/></property>
+               <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Intercepted" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="IntroductionBinding" class="org.jboss.aop.microcontainer.beans2.IntroductionBinding">
+      <property name="classes">org.jboss.test.microcontainer.beans2.POJO</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="interfaces">
+         <list elementClass="java.lang.String">
+            <value>org.jboss.test.microcontainer.beans2.IntroductionInterface</value>
+         </list>
+   	</property>
+   </bean>
+	
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* $instanceof{org.jboss.test.microcontainer.beans2.IntroductionInterface}->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="IntroductionBinding" class="org.jboss.aop.microcontainer.beans2.IntroductionBinding">
+      <property name="expr">has(* *->method())</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="interfaces">
+         <list elementClass="java.lang.String">
+            <value>org.jboss.test.microcontainer.beans2.IntroductionInterface</value>
+         </list>
+   	</property>
+   </bean>
+	
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* $instanceof{org.jboss.test.microcontainer.beans2.IntroductionInterface}->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="MixinBinding" class="org.jboss.aop.microcontainer.beans2.IntroductionBinding">
+      <property name="classes">org.jboss.test.microcontainer.beans2.POJO</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="mixins">
+         <list>
+            <bean name="MixinBinding$1" class="org.jboss.aop.microcontainer.beans2.MixinEntry">
+            	<property name="interfaces">
+                  <list elementClass="java.lang.String">
+                     <value>org.jboss.test.microcontainer.beans2.MixinInterface</value>
+                  </list>
+					</property>
+               <property name="mixin">org.jboss.test.microcontainer.beans2.MixinImpl</property>
+				</bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* $instanceof{org.jboss.test.microcontainer.beans2.MixinInterface}->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <bean name="MixinBinding" class="org.jboss.aop.microcontainer.beans2.IntroductionBinding">
+      <property name="expr">has(* *->method())</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="mixins">
+         <list>
+            <bean name="MixinBinding$1" class="org.jboss.aop.microcontainer.beans2.MixinEntry">
+              <property name="construction">new org.jboss.test.microcontainer.beans2.MixinImpl(this, "CUSTOM CONSTRUCTION")</property>
+            	<property name="interfaces">
+                  <list elementClass="java.lang.String">
+                     <value>org.jboss.test.microcontainer.beans2.MixinInterface</value>
+                  </list>
+					</property>
+               <property name="mixin">org.jboss.test.microcontainer.beans2.MixinImpl</property>
+				</bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* $instanceof{org.jboss.test.microcontainer.beans2.MixinInterface}->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency1" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency2" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.test.microcontainer.beans2.TestAspectWithDependency">
+   	<property name="dependency"><inject bean="Dependency1"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency">
+   	<property name="dependency"><inject bean="Dependency2"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans2.Annotation1->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <bean name="TestInterceptorBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans2.Annotation2->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestInterceptorBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency"/></property>
+               <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Intercepted1" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation1</annotation>
+   </bean>
+   
+   <bean name="Intercepted2" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation2</annotation>
+   </bean>
+   
+   <bean name="Intercepted3" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation1</annotation>
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation2</annotation>
+   </bean>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.test.microcontainer.beans2.TestAspectWithDependency">
+   	<property name="dependency"><inject bean="Dependency"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Intercepted" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory" class="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestStackA" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">TestStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="TestStackA$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestStackA$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="TestStackB" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">TestStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="TestStackB$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleInterceptorFactory"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestStackB$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="TestStackA"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$2" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="TestStackB"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+	<bean name="NamedPointcut" class="org.jboss.aop.microcontainer.beans2.NamedPointcut">
+      <property name="manager"><inject bean="AspectManager"/></property>
+		<property name="name">NamedPointcut</property>
+		<property name="expr">execution(* org.jboss.test.microcontainer.beans2.POJO->*())</property>
+	</bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">NamedPointcut</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+	
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$AspectA" class="org.jboss.test.microcontainer.beans2.TestAspectWithProperty">
+   	<property name="someProperty">PropertyA</property>
+   </beanfactory>
+   
+   <bean name="AspectA" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$AspectA"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$AspectB" class="org.jboss.test.microcontainer.beans2.TestAspectWithProperty">
+   	<property name="someProperty">PropertyB</property>
+   </beanfactory>
+   
+   <bean name="AspectB" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$AspectB"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="BindingA" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->method())</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="AspectA"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="BindingA" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="BindingB" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->method(int))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBindingB$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="AspectB"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="BindingB" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+	<bean name="Intercepted" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>
+
+
+
+   

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+	<bean name="PrecedenceBinding" class="org.jboss.aop.microcontainer.beans2.PrecedenceDef">
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="entries">
+         <map class="java.util.LinkedHashMap" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>org.jboss.test.microcontainer.beans2.TestInterceptor</key>
+               <value><null/></value>
+            </entry>
+            <entry>
+               <key>org.jboss.test.microcontainer.beans2.TestAspect</key>
+               <value>advice</value>
+            </entry>
+         </map>
+   	</property>
+	</bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+   
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.PerVmAspect" class="org.jboss.test.microcontainer.beans2.PerVmAspect"/>
+   <bean name="org.jboss.test.microcontainer.beans2.PerVmAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.PerVmAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="scope">PER_VM</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.PerClassAspect" class="org.jboss.test.microcontainer.beans2.PerClassAspect"/>
+   <bean name="org.jboss.test.microcontainer.beans2.PerClassAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.PerClassAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="scope">PER_CLASS</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.PerInstanceAspect" class="org.jboss.test.microcontainer.beans2.PerInstanceAspect"/>
+   <bean name="org.jboss.test.microcontainer.beans2.PerInstanceAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.PerInstanceAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="scope">PER_INSTANCE</property>
+   </bean>
+   
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.PerJoinPointAspect" class="org.jboss.test.microcontainer.beans2.PerJoinPointAspect"/>
+   <bean name="org.jboss.test.microcontainer.beans2.PerJoinPointAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.PerJoinPointAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="scope">PER_JOINPOINT</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect" class="org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect"/>
+   <bean name="org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="scope">PER_CLASS_JOINPOINT</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO*->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.PerVmAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.PerClassAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$3" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.PerInstanceAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$4" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.PerJoinPointAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestAspectBinding$5" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="POJO1A" class="org.jboss.test.microcontainer.beans2.POJO"/>
+
+   <bean name="POJO1B" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+   <bean name="POJO2" class="org.jboss.test.microcontainer.beans2.POJO2"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.SimpleAspectFactory" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+      <property name="factory">true</property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="TestStack" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">TestStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="TestStack$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.SimpleAspectFactory"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="TestStack"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency1" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency2" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.test.microcontainer.beans2.TestAspectWithDependency">
+   	<property name="dependency"><inject bean="Dependency1"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency">
+   	<property name="dependency"><inject bean="Dependency2"/></property>
+	   <!-- Need to be able to configure with attributes and stuff -->
+	   <install bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="AspectStack" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">AspectStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="AspectStack$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="AspectStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="InterceptorStack" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">InterceptorStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="InterceptorStack$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency"/></property>
+               <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="InterceptorStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans2.Annotation1->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="AspectStack"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+   <bean name="TestInterceptorBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans2.Annotation2->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestInterceptorBinding$1" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="InterceptorStack"/></property>
+               <property name="aspectBinding"><inject bean="TestInterceptorBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+   
+   <bean name="Intercepted1" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation1</annotation>
+   </bean>
+   
+   <bean name="Intercepted2" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation2</annotation>
+   </bean>
+   
+   <bean name="Intercepted3" class="org.jboss.test.microcontainer.beans2.POJO">
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation1</annotation>
+   	<annotation>@org.jboss.test.microcontainer.beans2.Annotation2</annotation>
+   </bean>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Dependency" class="org.jboss.test.microcontainer.beans2.Dependency"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.test.microcontainer.beans2.TestAspectWithDependency">
+   	<property name="dependency"><inject bean="Dependency"/></property>
+	   <install bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="install">
+	   	<parameter><this/></parameter>
+	   </install>
+	   <uninstall bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" method="uninstall"/>
+   </beanfactory>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspectWithDependency" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans2.TestAspectWithDependency</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.test.microcontainer.beans2.TestInterceptor"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestInterceptor" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+
+   <bean name="TestStack" class="org.jboss.aop.microcontainer.beans2.Stack">
+   	<property name="manager"><inject bean="AspectManager"/></property>
+   	<property name="name">TestStack</property>
+   	<property name="advices">
+         <list>
+            <bean name="TestStack$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspectWithDependency"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+            <bean name="TestStack$2" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestInterceptor"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* org.jboss.test.microcontainer.beans2.POJO->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.StackEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="stack"><inject bean="TestStack"/></property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Intercepted" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.xml	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <beanfactory name="Factory$org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.test.microcontainer.beans2.TestAspect"/>
+   
+   <bean name="org.jboss.test.microcontainer.beans2.TestAspect" class="org.jboss.aop.microcontainer.beans2.Aspect">
+      <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+	<bean name="TypeDef" class="org.jboss.aop.microcontainer.beans2.TypeDef">
+      <property name="manager"><inject bean="AspectManager"/></property>
+		<property name="name">TypeDef</property>
+		<property name="expr">class(org.jboss.test.microcontainer.beans2.POJO)</property>
+	</bean>
+
+   <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans2.AspectBinding">
+      <property name="pointcut">execution(* $typedef{TypeDef}->*(..))</property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+     	<property name="advices">
+         <list>
+            <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans2.InterceptorEntry">
+			      <property name="manager"><inject bean="AspectManager"/></property>
+               <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans2.TestAspect"/></property>
+               <property name="aspectMethod">advice</property>
+               <property name="aspectBinding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+            </bean>
+         </list>
+   	</property>
+   </bean>
+	
+
+   
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans2.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation1.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation1.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation1.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,31 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public @interface Annotation1 {
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation2.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation2.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Annotation2.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,31 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public @interface Annotation2 {
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Dependency.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Dependency.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Dependency.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Dependency
+{
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/DynamicCFlowImpl.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/DynamicCFlowImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/DynamicCFlowImpl.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.pointcut.DynamicCFlow;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DynamicCFlowImpl implements DynamicCFlow
+{
+   public static boolean execute = false;
+   
+   public boolean shouldExecute(Invocation invocation)
+   {
+      return execute;
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Interceptions.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Interceptions.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/Interceptions.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Interceptions
+{
+   private static List interceptions = new ArrayList();
+   
+   public static void add(Object o)
+   {
+      interceptions.add(o);
+   }
+   
+   public static List interceptions()
+   {
+      return interceptions;
+   }
+   
+   public static void reset()
+   {
+      interceptions.clear();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/IntroductionInterface.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/IntroductionInterface.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/IntroductionInterface.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IntroductionInterface
+{
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinImpl.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinImpl.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinImpl implements MixinInterface
+{
+   private String mixinValue = "DEFAULT";
+   
+   public MixinImpl(POJO pojo, String value)
+   {
+      this.mixinValue = value;
+   }
+   
+   public MixinImpl()
+   {
+   }
+   
+   public String getMixinValue()
+   {
+      return mixinValue;
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinInterface.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinInterface.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/MixinInterface.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MixinInterface
+{
+   String getMixinValue();
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+{
+   public int method(int i)
+   {
+      return i * 2;
+   }
+   
+   public void method()
+   {
+      
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO2.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO2.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/POJO2.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO2
+{
+   public int method(int i)
+   {
+      return i * 2;
+   }
+   
+   public void method()
+   {
+      
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerClassAspect
+{
+   public static PerClassAspect last;
+   
+   public Object advice(MethodInvocation mi) throws Throwable
+   {
+      last = this;
+      return mi.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassJoinPointAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassJoinPointAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerClassJoinPointAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerClassJoinPointAspect 
+{
+   public static PerClassJoinPointAspect last;
+   
+   public Object advice(MethodInvocation mi) throws Throwable
+   {
+      last = this;
+      return mi.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerInstanceAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerInstanceAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerInstanceAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerInstanceAspect 
+{
+   public static PerInstanceAspect last;
+   
+   public Object advice(MethodInvocation mi) throws Throwable
+   {
+      last = this;
+      return mi.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerJoinPointAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerJoinPointAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerJoinPointAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerJoinPointAspect 
+{
+   public static PerJoinPointAspect last;
+   
+   public Object advice(MethodInvocation mi) throws Throwable
+   {
+      last = this;
+      return mi.invokeNext();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerVmAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerVmAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/PerVmAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PerVmAspect 
+{
+   public static PerVmAspect last;
+   
+   public Object advice(MethodInvocation mi) throws Throwable
+   {
+      last = this;
+      return mi.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleAspectFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleAspectFactory.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleAspectFactory implements AspectFactory
+{
+   public Object createPerClass(Advisor advisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerVM()
+   {
+      return new SimpleFactoryAspect(100);
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleFactoryAspect
+{
+   public static int invoked;
+   private int i;
+   
+   public SimpleFactoryAspect(int i)
+   {
+      this.i = i;
+   }
+   
+   public Object advice(MethodInvocation inv) throws Throwable
+   {
+      invoked = this.i;
+      return inv.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryInterceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryInterceptor.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleFactoryInterceptor.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleFactoryInterceptor implements Interceptor
+{
+   public static int invoked;
+   private int i;
+   
+   public SimpleFactoryInterceptor(int i)
+   {
+      this.i = i;
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      invoked = this.i;
+      return invocation.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleInterceptorFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleInterceptorFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/SimpleInterceptorFactory.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,66 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleInterceptorFactory implements AspectFactory
+{
+   public Object createPerClass(Advisor advisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+   {
+      throw new RuntimeException("PER_VM only");
+   }
+
+   public Object createPerVM()
+   {
+      return new SimpleFactoryInterceptor(100);
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspect.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspect.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestAspect
+{
+   public static boolean invoked;
+   
+   public Object advice(MethodInvocation inv) throws Throwable
+   {
+      Interceptions.add(this);
+      invoked = true;
+      return inv.invokeNext();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithDependency.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithDependency.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithDependency.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestAspectWithDependency
+{
+   public static int called;
+   public static Object invoked;
+   public static TestAspectWithDependency last;
+ 
+   public Dependency dependency;
+   
+   public Dependency getDependency()
+   {
+      return dependency;
+   }
+
+   public void setDependency(Dependency dependency)
+   {
+      this.dependency = dependency;
+   }
+
+   public Object advice(MethodInvocation inv) throws Throwable
+   {
+      called++;
+      invoked = dependency;
+      last = this;
+      return inv.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithProperty.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithProperty.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestAspectWithProperty.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestAspectWithProperty
+{
+   public static TestAspectWithProperty last;
+ 
+   private String someProperty;
+   
+   public String getSomeProperty()
+   {
+      return someProperty;
+   }
+
+   public void setSomeProperty(String someProperty)
+   {
+      this.someProperty = someProperty;
+   }
+
+   public Object advice(MethodInvocation inv) throws Throwable
+   {
+      last = this;
+      return inv.invokeNext();
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptor.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptor.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptor implements Interceptor
+{
+   public static boolean invoked;
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      Interceptions.add(this);
+      invoked = true;
+      return invocation.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptorWithDependency.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptorWithDependency.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/TestInterceptorWithDependency.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestInterceptorWithDependency implements Interceptor
+{
+   public static int called;
+   public static Object invoked;
+ 
+   public Dependency dependency;
+   
+   public Dependency getDependency()
+   {
+      return dependency;
+   }
+
+   public void setDependency(Dependency dependency)
+   {
+      this.dependency = dependency;
+   }
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      called++;
+      invoked = dependency;
+      return invocation.invokeNext();
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AnnotationOverrideBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationOverrideBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(AnnotationOverrideBeansTestCase.class);
+   }
+   
+   public AnnotationOverrideBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      pojo.method(2);
+      assertFalse(TestAspect.invoked);
+      
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectFactorySimpleBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.SimpleFactoryAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactorySimpleBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      SimpleFactoryAspect.invoked = 0;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(SimpleFactoryAspect.invoked == 100);
+   }
+   
+   public static Test suite()
+   {
+      return suite(AspectFactorySimpleBeansTestCase.class);
+   }
+   
+   public AspectFactorySimpleBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectSimpleBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectSimpleBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(TestAspect.invoked);
+   }
+   
+   public static Test suite()
+   {
+      return suite(AspectSimpleBeansTestCase.class);
+   }
+   
+   public AspectSimpleBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectWithDependencyBeansDifferentOrderTestCase extends AspectWithDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new AspectWithDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new AspectWithDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+
+   public AspectWithDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/AspectWithDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,231 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithDependency;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectWithDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(AspectWithDependencyBeansTestCase.class);
+   }
+   
+   public AspectWithDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertNotNull(TestAspectWithDependency.invoked);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("'Interceped' should not be installed yet");
+         }
+         catch (IllegalStateException expected)
+         {
+         }
+         
+         pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED);
+         assertNull("This should not be deployed until the interceptor is", pojo);
+         
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed until the dependency is");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed after the dependency is undeployed");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            int called = TestAspectWithDependency.called;
+            pojo.method(2);
+            assertTrue("Interceptor was not rebound", called + 1 == TestAspectWithDependency.called);
+            assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("AspectWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("AspectWithDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/CFlowBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,68 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CFlowBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(CFlowBeansTestCase.class);
+   }
+   
+   public CFlowBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      POJO pojo = (POJO)getBean("Bean");
+      TestAspect.invoked = false;
+      callPOJO(pojo);
+      assertTrue(TestAspect.invoked);
+      
+      TestAspect.invoked = false;
+      notCallPOJO(pojo);
+      assertFalse(TestAspect.invoked);
+   }
+   
+   private void callPOJO(POJO pojo)
+   {
+      pojo.method();
+   }
+
+   private void notCallPOJO(POJO pojo)
+   {
+      callPOJO(pojo);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/DynamicCFlowBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.DynamicCFlowImpl;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DynamicCFlowBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(DynamicCFlowBeansTestCase.class);
+   }
+   
+   public DynamicCFlowBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      POJO pojo = (POJO)getBean("Bean");
+      TestAspect.invoked = false;
+      pojo.method();
+      assertFalse(TestAspect.invoked);
+
+      DynamicCFlowImpl.execute = true;
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorFactorySimpleBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,56 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.SimpleFactoryInterceptor;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorFactorySimpleBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(SimpleFactoryInterceptor.invoked == 100);
+   }
+   
+   public static Test suite()
+   {
+      return suite(InterceptorFactorySimpleBeansTestCase.class);
+   }
+   
+   public InterceptorFactorySimpleBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorSimpleBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorSimpleBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestInterceptor.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(TestInterceptor.invoked);
+   }
+   
+   public static Test suite()
+   {
+      return suite(InterceptorSimpleBeansTestCase.class);
+   }
+   
+   public InterceptorSimpleBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorWithDependencyBeansDifferentOrderTestCase extends InterceptorWithDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new InterceptorWithDependencyBeansTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new InterceptorWithDependencyBeansTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+
+   public InterceptorWithDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/InterceptorWithDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,231 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorWithDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(InterceptorWithDependencyBeansTestCase.class);
+   }
+   
+   public InterceptorWithDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertNotNull(TestInterceptorWithDependency.invoked);
+            assertTrue(dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("'Interceped' should not be installed yet");
+         }
+         catch (IllegalStateException expected)
+         {
+         }
+         
+         pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED);
+         assertNull("This should not be deployed until the interceptor is", pojo);
+         
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed until the dependency is");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed after the dependency is undeployed");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            int called = TestInterceptorWithDependency.called;
+            pojo.method(2);
+            assertTrue("Interceptor was not rebound", called + 1 == TestInterceptorWithDependency.called);
+            assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            pojo.method(2);
+            assertTrue(dependency == TestInterceptorWithDependency.invoked);
+         }
+         finally
+         {
+            undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionClassesBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,56 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.IntroductionInterface;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntroductionClassesBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(IntroductionClassesBeansTestCase.class);
+   }
+   
+   public IntroductionClassesBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntroduced() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      assertTrue(pojo instanceof IntroductionInterface);
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/IntroductionExprBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,56 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.IntroductionInterface;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntroductionExprBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(IntroductionExprBeansTestCase.class);
+   }
+   
+   public IntroductionExprBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntroduced() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      assertTrue(pojo instanceof IntroductionInterface);
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinClassesBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.MixinInterface;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinClassesBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(MixinClassesBeansTestCase.class);
+   }
+   
+   public MixinClassesBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntroduced() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      assertTrue(pojo instanceof MixinInterface);
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+      assertEquals("DEFAULT", ((MixinInterface)pojo).getMixinValue());
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MixinExprBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.MixinInterface;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinExprBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(MixinExprBeansTestCase.class);
+   }
+   
+   public MixinExprBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntroduced() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      assertTrue(pojo instanceof MixinInterface);
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+      assertEquals("CUSTOM CONSTRUCTION", ((MixinInterface)pojo).getMixinValue());
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdviceBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,58 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleAdviceBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      TestInterceptor.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(TestAspect.invoked);
+      assertTrue(TestInterceptor.invoked);
+   }
+   
+   public static Test suite()
+   {
+      return suite(MultipleAdviceBeansTestCase.class);
+   }
+   
+   public MultipleAdviceBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase
+      extends
+         MultipleAdvicesWithMultipleDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+
+   public MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithMultipleDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,339 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithDependency;
+import org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleAdvicesWithMultipleDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(MultipleAdvicesWithMultipleDependencyBeansTestCase.class);
+   }
+   
+   public MultipleAdvicesWithMultipleDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency1 = (Dependency) getBean("Dependency1");
+         assertNotNull(dependency1);
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         Dependency dependency2 = (Dependency) getBean("Dependency2");
+         assertNotNull(dependency2);
+         try
+         {
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      try
+      {
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+         
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            Dependency dependency1 = (Dependency) getBean("Dependency1");
+            assertNotNull(dependency1);
+            checkIntercepted1(dependency1);
+            checkNoIntercepted2();
+            checkNoIntercepted3();
+            
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            try
+            {
+               validate();
+               Dependency dependency2 = (Dependency) getBean("Dependency2");
+               assertNotNull(dependency2);
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      try
+      {
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            Dependency dependency1 = (Dependency) getBean("Dependency1");
+            assertNotNull(dependency1);
+            
+            checkIntercepted1(dependency1);
+            checkNoIntercepted2();
+            checkNoIntercepted3();
+            
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            try
+            {
+               validate();
+               Dependency dependency2 = (Dependency) getBean("Dependency2");
+               assertNotNull(dependency2);
+               
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            
+            checkNoIntercepted1();
+            checkIntercepted2(dependency2);
+            checkNoIntercepted3();
+            
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+            try
+            {
+               validate();
+               Dependency dependency1 = (Dependency) getBean("Dependency1");
+               assertNotNull(dependency1);
+               
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency1 = (Dependency) getBean("Dependency1");
+         assertNotNull(dependency1);
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         assertNotNull(dependency1);
+         deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            deploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   private void checkIntercepted1(Dependency dependency1)
+   {
+      POJO pojo1 = (POJO) getBean("Intercepted1");
+      assertNotNull(pojo1);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo1.method(2);
+      assertNotNull(TestAspectWithDependency.invoked);
+      assertTrue(dependency1 == TestAspectWithDependency.invoked);
+      assertNull(TestInterceptorWithDependency.invoked);
+   }
+
+   private void checkIntercepted2(Dependency dependency2)
+   {
+      POJO pojo2 = (POJO) getBean("Intercepted2");
+      assertNotNull(pojo2);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo2.method(2);
+      assertNull(TestAspectWithDependency.invoked);
+      assertNotNull(TestInterceptorWithDependency.invoked);
+      System.out.println(TestInterceptorWithDependency.invoked);
+      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
+   }
+   
+   private void checkIntercepted3(Dependency dependency1, Dependency dependency2)
+   {
+      POJO pojo3 = (POJO) getBean("Intercepted3");
+      assertNotNull(pojo3);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo3.method(2);
+      assertNotNull(TestAspectWithDependency.invoked);
+      assertTrue(dependency1 == TestAspectWithDependency.invoked);
+      assertNotNull(TestInterceptorWithDependency.invoked);
+      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
+   }
+   
+   private void checkNoIntercepted1()
+   {
+      checkNoIntercepted("Intercepted1");
+   }
+   
+   private void checkNoIntercepted2()
+   {
+      checkNoIntercepted("Intercepted2");
+   }
+   
+   private void checkNoIntercepted3()
+   {
+      checkNoIntercepted("Intercepted3");
+   }
+   
+   private void checkNoIntercepted(String name)
+   {
+      POJO pojo;
+      try
+      {
+         pojo = (POJO) getBean(name);
+         fail("'" + name + "' should not be installed yet");
+      }
+      catch (IllegalStateException expected)
+      {
+      }
+      
+      pojo = (POJO) getBean(name, ControllerState.DESCRIBED);
+      assertNull(name + " should not be deployed until the interceptor is", pojo);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase
+      extends
+         MultipleAdvicesWithSingleDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+
+   public MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleAdvicesWithSingleDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,249 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithDependency;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleAdvicesWithSingleDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(MultipleAdvicesWithSingleDependencyBeansTestCase.class);
+   }
+   
+   public MultipleAdvicesWithSingleDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertNotNull(TestAspectWithDependency.invoked);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("'Interceped' should not be installed yet");
+         }
+         catch (IllegalStateException expected)
+         {
+         }
+         
+         pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED);
+         assertNull("This should not be deployed until the interceptor is", pojo);
+         
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed until the dependency is");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed after the dependency is undeployed");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            int called = TestAspectWithDependency.called;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue("Interceptor was not rebound", called + 1 == TestAspectWithDependency.called);
+            assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;           
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/MultipleStackBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.SimpleFactoryAspect;
+import org.jboss.test.microcontainer.beans2.SimpleFactoryInterceptor;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MultipleStackBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      SimpleFactoryAspect.invoked = 0;
+      TestInterceptor.invoked = false;
+      SimpleFactoryInterceptor.invoked = 0;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(SimpleFactoryAspect.invoked == 100);
+      assertTrue(TestAspect.invoked);
+      assertTrue(SimpleFactoryInterceptor.invoked == 100);
+      assertTrue(TestInterceptor.invoked);
+   }
+   
+   public static Test suite()
+   {
+      return suite(MultipleStackBeansTestCase.class);
+   }
+   
+   public MultipleStackBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NamedPointcutBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class NamedPointcutBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(NamedPointcutBeansTestCase.class);
+   }
+   
+   public NamedPointcutBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      pojo.method(2);
+      assertFalse(TestAspect.invoked);
+      
+      pojo.method();
+      assertTrue(TestAspect.invoked);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/NonStandardNameAspectBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,65 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithProperty;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class NonStandardNameAspectBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(NonStandardNameAspectBeansTestCase.class);
+   }
+   
+   public NonStandardNameAspectBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testDifferentInstances() throws Exception
+   {
+      POJO pojo = (POJO)getBean("Intercepted");
+      
+      TestAspectWithProperty.last = null;
+      pojo.method();
+      TestAspectWithProperty a1 = TestAspectWithProperty.last;
+      assertNotNull(a1);
+      assertEquals("PropertyA", a1.getSomeProperty());
+      
+      TestAspectWithProperty.last = null;
+      pojo.method(2);
+      TestAspectWithProperty a2 = TestAspectWithProperty.last;
+      assertNotNull(a2);
+      assertEquals("PropertyB", a2.getSomeProperty());
+      
+      assertNotSame(a1, a2);
+   }  
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/PrecedenceBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,63 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.Interceptions;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrecedenceBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      Interceptions.reset();
+      POJO pojo = (POJO)getBean("Bean");
+      pojo.method(2);
+      
+      List interceptions = Interceptions.interceptions();
+      assertEquals(2, interceptions.size());
+      
+      assertEquals(TestAspect.class, interceptions.get(0).getClass());
+      assertEquals(TestInterceptor.class, interceptions.get(1).getClass());
+   }
+   
+   public static Test suite()
+   {
+      return suite(PrecedenceBeansTestCase.class);
+   }
+   
+   public PrecedenceBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/ScopedAspectBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,223 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.POJO2;
+import org.jboss.test.microcontainer.beans2.PerClassAspect;
+import org.jboss.test.microcontainer.beans2.PerClassJoinPointAspect;
+import org.jboss.test.microcontainer.beans2.PerInstanceAspect;
+import org.jboss.test.microcontainer.beans2.PerJoinPointAspect;
+import org.jboss.test.microcontainer.beans2.PerVmAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ScopedAspectBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testPerVm() throws Exception
+   {
+      POJO pojo = (POJO)getBean("POJO1A");
+      POJO2 pojo2 = (POJO2)getBean("POJO2");
+
+      PerVmAspect.last = null;
+      pojo.method();
+      PerVmAspect a1 = PerVmAspect.last;
+      assertNotNull(a1);
+      
+      PerVmAspect.last = null;
+      pojo2.method();
+      PerVmAspect a2 = PerVmAspect.last;
+      assertNotNull(a2);
+      assertSame(a1, a2);
+      
+      PerVmAspect.last = null;
+      pojo.method(3);
+      PerVmAspect a3 = PerVmAspect.last;
+      assertNotNull(a3);
+      assertSame(a1, a3);
+   }
+   
+   public void testPerClass() throws Exception
+   {
+      POJO pojo = (POJO)getBean("POJO1A");
+      POJO2 pojo2 = (POJO2)getBean("POJO2");
+      
+      PerClassAspect.last = null;
+      pojo.method();
+      PerClassAspect a1 = PerClassAspect.last;
+      assertNotNull(a1);
+      
+      PerClassAspect.last = null;
+      pojo2.method();
+      PerClassAspect a2 = PerClassAspect.last;
+      assertNotNull(a2);
+      assertNotSame(a1, a2);
+      
+      PerClassAspect.last = null;
+      pojo.method(3);
+      PerClassAspect a3 = PerClassAspect.last;
+      assertNotNull(a3);
+      assertSame(a1, a3);
+   }
+   
+   public void testPerInstance() throws Exception
+   {
+      POJO pojoA = (POJO)getBean("POJO1A");
+      POJO pojoB = (POJO)getBean("POJO1B");
+      POJO2 pojo2 = (POJO2)getBean("POJO2");
+      
+      PerInstanceAspect.last = null;
+      pojoA.method();
+      PerInstanceAspect a1 = PerInstanceAspect.last;
+      assertNotNull(a1);
+      
+      PerInstanceAspect.last = null;
+      pojoA.method(2);
+      PerInstanceAspect a2 = PerInstanceAspect.last;
+      assertNotNull(a2);
+      assertSame(a1, a2);
+      
+      PerInstanceAspect.last = null;
+      pojoB.method();
+      PerInstanceAspect a3 = PerInstanceAspect.last;
+      assertNotNull(a3);
+      assertNotSame(a3, a2);
+      
+      PerInstanceAspect.last = null;
+      pojoB.method(4);
+      PerInstanceAspect a4 = PerInstanceAspect.last;
+      assertNotNull(a4);
+      assertSame(a3, a4);
+      
+      PerInstanceAspect.last = null;
+      pojo2.method();
+      PerInstanceAspect a5 = PerInstanceAspect.last;
+      assertNotNull(a5);
+      assertNotSame(a5, a4);
+      assertNotSame(a5, a2);
+      
+      PerInstanceAspect.last = null;
+      pojo2.method(4);
+      PerInstanceAspect a6 = PerInstanceAspect.last;
+      assertNotNull(a6);
+      assertSame(a5, a6);
+   }
+   
+   public void testPerJoinPoint() throws Exception
+   {
+      POJO pojoA = (POJO)getBean("POJO1A");
+      POJO pojoB = (POJO)getBean("POJO1B");
+      POJO2 pojo2 = (POJO2)getBean("POJO2");
+
+      PerJoinPointAspect.last = null;
+      pojoA.method();
+      PerJoinPointAspect a1 = PerJoinPointAspect.last;
+      assertNotNull(a1);
+      
+      PerJoinPointAspect.last = null;
+      pojoA.method(1);
+      PerJoinPointAspect a2 = PerJoinPointAspect.last;
+      assertNotNull(a2);
+      
+      PerJoinPointAspect.last = null;
+      pojoB.method();
+      PerJoinPointAspect a3 = PerJoinPointAspect.last;
+      assertNotNull(a3);
+      
+      PerJoinPointAspect.last = null;
+      pojoB.method(1);
+      PerJoinPointAspect a4 = PerJoinPointAspect.last;
+      assertNotNull(a4);
+      
+      PerJoinPointAspect.last = null;
+      pojo2.method();
+      PerJoinPointAspect a5 = PerJoinPointAspect.last;
+      assertNotNull(a5);
+      
+      PerJoinPointAspect.last = null;
+      pojo2.method(1);
+      PerJoinPointAspect a6 = PerJoinPointAspect.last;
+      assertNotNull(a6);
+      
+      assertNotSame(a1, a2);
+      assertNotSame(a1, a3);
+      assertNotSame(a1, a4);
+      assertNotSame(a1, a5);
+      assertNotSame(a1, a6);
+      assertNotSame(a2, a3);
+      assertNotSame(a2, a4);
+      assertNotSame(a2, a5);
+      assertNotSame(a2, a6);
+      assertNotSame(a3, a4);
+      assertNotSame(a3, a5);
+      assertNotSame(a3, a6);
+      assertNotSame(a4, a5);
+      assertNotSame(a4, a6);
+      assertNotSame(a5, a6);
+      
+      PerJoinPointAspect.last = null;
+      pojoA.method();
+      PerJoinPointAspect a7 = PerJoinPointAspect.last;
+      assertNotNull(a7);
+      assertSame(a1, a7);
+   }
+   
+//   public void testPerClassJoinPoint() throws Exception
+//   {
+//      POJO pojoA = (POJO)getBean("POJO1A");
+//      POJO pojoB = (POJO)getBean("POJO1B");
+//      POJO2 pojo2 = (POJO2)getBean("POJO2");
+//      
+//      PerClassJoinPointAspect.last = null;
+//      pojoA.method();
+//      PerClassJoinPointAspect a1 = PerClassJoinPointAspect.last;
+//      assertNotNull(a1);
+//      
+//      PerClassJoinPointAspect.last = null;
+//      pojoB.method();
+//      PerClassJoinPointAspect a2 = PerClassJoinPointAspect.last;
+//      assertNotNull(a2);
+//      assertSame(a1, a2);
+//      
+//      PerClassJoinPointAspect.last = null;
+//      pojo2.method();
+//      PerClassJoinPointAspect a3 = PerClassJoinPointAspect.last;
+//      assertNotNull(a3);
+//      assertNotSame(a2, a3);
+//   }
+   
+   public static Test suite()
+   {
+      return suite(ScopedAspectBeansTestCase.class);
+   }
+   
+   public ScopedAspectBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.SimpleFactoryAspect;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackBeansTestCase extends AOPMicrocontainerTest
+{
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      SimpleFactoryAspect.invoked = 0;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(SimpleFactoryAspect.invoked == 100);
+      assertTrue(TestAspect.invoked);
+      
+   }
+   
+   public static Test suite()
+   {
+      return suite(StackBeansTestCase.class);
+   }
+   
+   public StackBeansTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,46 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackWithMultipleDependencyBeansDifferentOrderTestCase extends StackWithMultipleDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new StackWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new StackWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+   
+   public StackWithMultipleDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithMultipleDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,339 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithDependency;
+import org.jboss.test.microcontainer.beans2.TestInterceptorWithDependency;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackWithMultipleDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(StackWithMultipleDependencyBeansTestCase.class);
+   }
+   
+   public StackWithMultipleDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency1 = (Dependency) getBean("Dependency1");
+         assertNotNull(dependency1);
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         Dependency dependency2 = (Dependency) getBean("Dependency2");
+         assertNotNull(dependency2);
+         try
+         {
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      try
+      {
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+         
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            Dependency dependency1 = (Dependency) getBean("Dependency1");
+            assertNotNull(dependency1);
+            checkIntercepted1(dependency1);
+            checkNoIntercepted2();
+            checkNoIntercepted3();
+            
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            try
+            {
+               validate();
+               Dependency dependency2 = (Dependency) getBean("Dependency2");
+               assertNotNull(dependency2);
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      try
+      {
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            Dependency dependency1 = (Dependency) getBean("Dependency1");
+            assertNotNull(dependency1);
+            
+            checkIntercepted1(dependency1);
+            checkNoIntercepted2();
+            checkNoIntercepted3();
+            
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            try
+            {
+               validate();
+               Dependency dependency2 = (Dependency) getBean("Dependency2");
+               assertNotNull(dependency2);
+               
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         checkNoIntercepted1();
+         checkNoIntercepted2();
+         checkNoIntercepted3();
+
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            
+            checkNoIntercepted1();
+            checkIntercepted2(dependency2);
+            checkNoIntercepted3();
+            
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+            try
+            {
+               validate();
+               Dependency dependency1 = (Dependency) getBean("Dependency1");
+               assertNotNull(dependency1);
+               
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency1 = (Dependency) getBean("Dependency1");
+         assertNotNull(dependency1);
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         assertNotNull(dependency1);
+         deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            Dependency dependency2 = (Dependency) getBean("Dependency2");
+            assertNotNull(dependency2);
+            deploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            try
+            {
+               validate();
+               checkIntercepted1(dependency1);
+               checkIntercepted2(dependency2);
+               checkIntercepted3(dependency1, dependency2);
+            }
+            finally
+            {
+               undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml");
+            }
+         }
+         finally
+         {
+            undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   private void checkIntercepted1(Dependency dependency1)
+   {
+      POJO pojo1 = (POJO) getBean("Intercepted1");
+      assertNotNull(pojo1);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo1.method(2);
+      assertNotNull(TestAspectWithDependency.invoked);
+      assertTrue(dependency1 == TestAspectWithDependency.invoked);
+      assertNull(TestInterceptorWithDependency.invoked);
+   }
+
+   private void checkIntercepted2(Dependency dependency2)
+   {
+      POJO pojo2 = (POJO) getBean("Intercepted2");
+      assertNotNull(pojo2);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo2.method(2);
+      assertNull(TestAspectWithDependency.invoked);
+      assertNotNull(TestInterceptorWithDependency.invoked);
+      System.out.println(TestInterceptorWithDependency.invoked);
+      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
+   }
+   
+   private void checkIntercepted3(Dependency dependency1, Dependency dependency2)
+   {
+      POJO pojo3 = (POJO) getBean("Intercepted3");
+      assertNotNull(pojo3);
+      TestAspectWithDependency.invoked = null;
+      TestInterceptorWithDependency.invoked = null;
+      pojo3.method(2);
+      assertNotNull(TestAspectWithDependency.invoked);
+      assertTrue(dependency1 == TestAspectWithDependency.invoked);
+      assertNotNull(TestInterceptorWithDependency.invoked);
+      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
+   }
+   
+   private void checkNoIntercepted1()
+   {
+      checkNoIntercepted("Intercepted1");
+   }
+   
+   private void checkNoIntercepted2()
+   {
+      checkNoIntercepted("Intercepted2");
+   }
+   
+   private void checkNoIntercepted3()
+   {
+      checkNoIntercepted("Intercepted3");
+   }
+   
+   private void checkNoIntercepted(String name)
+   {
+      POJO pojo;
+      try
+      {
+         pojo = (POJO) getBean(name);
+         fail("'" + name + "' should not be installed yet");
+      }
+      catch (IllegalStateException expected)
+      {
+      }
+      
+      pojo = (POJO) getBean(name, ControllerState.DESCRIBED);
+      assertNull(name + " should not be deployed until the interceptor is", pojo);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansDifferentOrderTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansDifferentOrderTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansDifferentOrderTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,46 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackWithSingleDependencyBeansDifferentOrderTestCase extends StackWithSingleDependencyBeansTestCase
+{
+   public static Test suite()
+   {
+      TestSuite suite =  new TestSuite();
+      suite.addTest(new StackWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder"));
+      suite.addTest(new StackWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder"));
+      return suite;
+   }
+
+   public StackWithSingleDependencyBeansDifferentOrderTestCase(String test)
+   {
+      super(test);
+   }   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/StackWithSingleDependencyBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,249 @@
+/*
+* 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.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.microcontainer.beans2.Dependency;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspectWithDependency;
+import org.jboss.test.microcontainer.beans2.TestInterceptor;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class StackWithSingleDependencyBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(StackWithSingleDependencyBeansTestCase.class);
+   }
+   
+   public StackWithSingleDependencyBeansTestCase(String test)
+   {
+      super(test);
+   }
+   
+   public void testInterceptorWithDependencyCorrectOrder() throws Exception
+   {
+      deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertNotNull(TestAspectWithDependency.invoked);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyWrongOrder() throws Exception
+   {
+      deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("'Interceped' should not be installed yet");
+         }
+         catch (IllegalStateException expected)
+         {
+         }
+         
+         pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED);
+         assertNull("This should not be deployed until the interceptor is", pojo);
+         
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+   public void testInterceptorWithDependencyRedeploy() throws Exception
+   {
+      deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      try
+      {
+         POJO pojo;
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed until the dependency is");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+         
+         try
+         {
+            pojo = (POJO) getBean("Intercepted");
+            fail("Bean should not be installed after the dependency is undeployed");
+         }
+         catch (IllegalStateException expected)
+         {
+            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
+            assertNotNull(context);
+         }
+
+         
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         try
+         {
+            validate();
+            Dependency dependency = (Dependency) getBean("Dependency");
+            assertNotNull(dependency);
+            pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            int called = TestAspectWithDependency.called;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue("Interceptor was not rebound", called + 1 == TestAspectWithDependency.called);
+            assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+      }
+   }
+   
+      
+   public void testInterceptorWithDependencyRedeploy2() throws Exception
+   {
+      deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      try
+      {
+         Dependency dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            validate();
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;           
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+
+         dependency = (Dependency) getBean("Dependency");
+         assertNotNull(dependency);
+         deploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         try
+         {
+            POJO pojo = (POJO) getBean("Intercepted");
+            assertNotNull(pojo);
+            TestAspectWithDependency.invoked = null;
+            TestInterceptor.invoked = false;
+            pojo.method(2);
+            assertTrue(dependency == TestAspectWithDependency.invoked);
+            assertTrue(TestInterceptor.invoked);
+         }
+         finally
+         {
+            undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml");
+         }
+      }
+      finally
+      {
+         undeploy("StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml");
+      }
+   }
+
+   
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans2/test/TypeDefBeansTestCase.java	2007-11-14 11:32:54 UTC (rev 67062)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans2.test;
+
+import junit.framework.Test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans2.POJO;
+import org.jboss.test.microcontainer.beans2.TestAspect;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TypeDefBeansTestCase extends AOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(TypeDefBeansTestCase.class);
+   }
+   
+   public TypeDefBeansTestCase(String test)
+   {
+      super(test);
+   }
+
+   public void testIntercepted() throws Exception
+   {
+      TestAspect.invoked = false;
+      POJO pojo = (POJO)getBean("Bean");
+      int ret = pojo.method(2);
+      assertEquals(4, ret);
+      assertTrue(TestAspect.invoked);
+   }
+}




More information about the jboss-cvs-commits mailing list