[jboss-cvs] JBossAS SVN: r76111 - in projects/microcontainer/trunk/aop-mc-int/src: resources/tests/org/jboss/test/microcontainer and 10 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 22 13:04:29 EDT 2008
Author: kabir.khan at jboss.com
Date: 2008-07-22 13:04:29 -0400 (Tue, 22 Jul 2008)
New Revision: 76111
Added:
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/MicrocontainerAnnotationLoaderStrategy.java
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DefaultBean.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase-classes.txt
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTest.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTestDelegate.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ComparableMixin.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DeclareAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowImpl.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface1.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface2.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface3.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ExternalizableMixin.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Interceptions.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/IntroductionAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinA.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinB.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface1.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface2.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface3.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/NamedPointcutAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence1Aspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence2Interceptor.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence3Aspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence4Interceptor.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/SimplePOJO.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowInterceptor.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestInterceptor.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TypedefAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/AnnotationIntroductionAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/PrepareAspect.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/TestAnnotation.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.java
Log:
[JBMICROCONT-310] Create aop bean metadata from the jboss aop annotations
Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/MicrocontainerAnnotationLoaderStrategy.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/MicrocontainerAnnotationLoaderStrategy.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/metadata/MicrocontainerAnnotationLoaderStrategy.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,348 @@
+/*
+* 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.beans.metadata;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.AspectAnnotationLoaderStrategy;
+import org.jboss.aop.AspectAnnotationLoaderStrategySupport;
+import org.jboss.aop.advice.AdviceType;
+import org.jboss.aop.advice.PrecedenceDefEntry;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.pointcut.ast.ASTCFlowExpression;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MicrocontainerAnnotationLoaderStrategy extends AspectAnnotationLoaderStrategySupport
+{
+ List<AspectManagerAwareBeanMetaDataFactory> factories = new ArrayList<AspectManagerAwareBeanMetaDataFactory>();
+
+ public List<AspectManagerAwareBeanMetaDataFactory> getFactories()
+ {
+ return factories;
+ }
+
+ @Override
+ public void deployAspect(AspectAnnotationLoader loader, boolean isFactory, String name, Scope scope)
+ {
+ AspectBeanMetaDataFactory aspect = new AspectBeanMetaDataFactory();
+ deployAspectOrInterceptor(aspect, isFactory, name, scope);
+ }
+
+ @Override
+ public void undeployAspect(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployInterceptor(AspectAnnotationLoader loader, boolean isFactory, String name, Scope scope)
+ {
+ InterceptorBeanMetaDataFactory aspect = new InterceptorBeanMetaDataFactory();
+ deployAspectOrInterceptor(aspect, isFactory, name, scope);
+ }
+
+ @Override
+ public void undeployInterceptor(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployAspectMethodBinding(AspectAnnotationLoader loader, AdviceType internalAdviceType,
+ String aspectDefName, String methodName, String bindingName, String pointcutString, String cflow,
+ ASTCFlowExpression cflowExpression) throws Exception
+ {
+ AdviceData entry = null;
+ if (internalAdviceType == AdviceType.AROUND)
+ {
+ entry = new AdviceData();
+ }
+ else if (internalAdviceType == AdviceType.BEFORE)
+ {
+ entry = new BeforeAdviceData();
+ }
+ else if (internalAdviceType == AdviceType.AFTER)
+ {
+ entry = new AfterAdviceData();
+ }
+ else if (internalAdviceType == AdviceType.THROWING)
+ {
+ entry = new ThrowingAdviceData();
+ }
+ else if (internalAdviceType == AdviceType.FINALLY)
+ {
+ entry = new FinallyAdviceData();
+ }
+ entry.setAdviceMethod(methodName);
+ entry.setRefName(aspectDefName);
+
+ deployBinding(bindingName, pointcutString, cflow, entry);
+ }
+
+ @Override
+ public void undeployAspectMethodBinding(AspectAnnotationLoader loader, String bindingName, String className,
+ String methodName)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployInterceptorBinding(AspectAnnotationLoader loader, String name, String pointcutString,
+ String cflow, ASTCFlowExpression cflowExpression) throws Exception
+ {
+ InterceptorRefData entry = new InterceptorRefData();
+ entry.setRefName(name);
+
+ deployBinding(name, pointcutString, cflow, entry);
+ }
+
+ @Override
+ public void undeployInterceptorBinding(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ private void deployAspectOrInterceptor(AspectBeanMetaDataFactory aspect, boolean isFactory, String name, Scope scope)
+ {
+ aspect.setScope(scope.name());
+ aspect.setName(name);
+ if (isFactory)
+ {
+ aspect.setFactory(name);
+ }
+ else
+ {
+ aspect.setBean(name);
+ }
+
+ factories.add(aspect);
+ }
+
+ private void deployBinding(String name, String pointcutString, String cflow, BaseInterceptorData entry)
+ {
+ BindBeanMetaDataFactory bind = new BindBeanMetaDataFactory();
+ bind.setName("Binding$" + name);
+ bind.setPointcut(pointcutString);
+ bind.setCflow(cflow);
+
+ bind.setInterceptors(Collections.singletonList(entry));
+
+ factories.add(bind);
+ }
+
+ @Override
+ public void deployCFlow(AspectAnnotationLoader loader, CFlowStackInfo stack)
+ {
+ CFlowStackBeanMetaDataFactory cflow = new CFlowStackBeanMetaDataFactory();
+ cflow.setName(stack.getName());
+
+ CFlowInfo[] cflows = stack.getCFlows();
+ if (cflows != null)
+ {
+ List<CFlowEntry> entries = new ArrayList<CFlowEntry>();
+ for (CFlowInfo current : cflows)
+ {
+ CFlowEntry entry = new CFlowEntry();
+ entry.setExpr(current.getExpr());
+ entry.setCalled(!current.isNot());
+ entries.add(entry);
+ }
+ cflow.setCalledEntries(entries);
+ }
+ factories.add(cflow);
+ }
+
+ @Override
+ public void undeployCFlow(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployAnnotationIntroduction(AspectAnnotationLoader loader, String expr, String annotation,
+ boolean invisible)
+ {
+ AnnotationIntroductionBeanMetaDataFactory intro = new AnnotationIntroductionBeanMetaDataFactory();
+ intro.setExpr(expr);
+ intro.setAnnotation(annotation);
+ intro.setInvisible(invisible);
+ factories.add(intro);
+ }
+
+ @Override
+ public void undeployAnnotationIntroduction(AspectAnnotationLoader loader, String expr, String annotation,
+ boolean invisible)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployTypedef(AspectAnnotationLoader loader, String name, String expr) throws Exception
+ {
+ TypeDefBeanMetaDataFactory typedef = new TypeDefBeanMetaDataFactory();
+ typedef.setName(name);
+ typedef.setExpr(expr);
+ factories.add(typedef);
+ }
+
+ @Override
+ public void undeployTypedef(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployDynamicCFlow(AspectAnnotationLoader loader, String name, String clazz)
+ {
+ DynamicCflowBeanMetaDataFactory dcflow = new DynamicCflowBeanMetaDataFactory();
+ dcflow.setName(name);
+ dcflow.setClazz(clazz);
+ factories.add(dcflow);
+ }
+
+ @Override
+ public void undeployDynamicCFlow(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployInterfaceIntroduction(AspectAnnotationLoader loader, AspectAnnotationLoaderStrategy.InterfaceIntroductionInfo introduction)
+ {
+ IntroductionBeanMetaDataFactory intro = new IntroductionBeanMetaDataFactory();
+ intro.setName(introduction.getName());
+ intro.setExpr(introduction.getExpr());
+ intro.setClazz(introduction.getTarget());
+ if (introduction.getInterfaces() != null)
+ {
+ intro.setInterfaces(createCommaSeparatedInterfaceString(introduction.getInterfaces()));
+ }
+
+ if (introduction.getMixins() != null)
+ {
+ List<MixinData> mixinDatas = new ArrayList<MixinData>();
+ for (InterfaceIntroductionMixinInfo mixin : introduction.getMixins())
+ {
+ MixinData mixinData = new MixinData();
+ mixinData.setMixin(mixin.getClassname());
+ mixinData.setInterfaces(createCommaSeparatedInterfaceString(mixin.getInterfaces()));
+ mixinData.setConstruction(mixin.getConstruction());
+
+ mixinDatas.add(mixinData);
+ }
+ intro.setMixins(mixinDatas);
+ }
+
+ factories.add(intro);
+ }
+
+ @Override
+ public void undeployInterfaceIntroduction(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployPointcut(AspectAnnotationLoader loader, String name, String expr) throws Exception
+ {
+ NamedPointcutBeanMetaDataFactory pointcut = new NamedPointcutBeanMetaDataFactory();
+ pointcut.setName(name);
+ pointcut.setExpr(expr);
+ factories.add(pointcut);
+ }
+
+ @Override
+ public void undeployPointcut(AspectAnnotationLoader loader, String name)
+ {
+ //Noop
+ }
+
+ @Override
+ public void deployPrecedence(AspectAnnotationLoader loader, String name, PrecedenceDefEntry[] pentries)
+ {
+ PrecedenceBeanMetaDataFactory precedence = new PrecedenceBeanMetaDataFactory();
+
+ List<BaseInterceptorData> entries = new ArrayList<BaseInterceptorData>();
+ for (PrecedenceDefEntry pentry : pentries)
+ {
+ String clazz = pentry.getInterceptorClass();
+ String advice = pentry.getAdviceMethod();
+
+ BaseInterceptorData entry = null;
+ if (advice == null)
+ {
+ entry = new InterceptorRefData();
+ entry.setRefName(clazz);
+ }
+ else
+ {
+ entry = new AdviceData();
+ entry.setRefName(clazz);
+ ((AdviceData)entry).setAdviceMethod(advice);
+ }
+ entries.add(entry);
+ precedence.setEntries(entries);
+ }
+
+ factories.add(precedence);
+ }
+
+ @Override
+ public void undeployPrecedence(AspectAnnotationLoader loader, String name)
+ {
+ super.undeployPrecedence(loader, name);
+ }
+
+ @Override
+ public void deployDeclare(AspectAnnotationLoader loader, String name, String expr, boolean warning, String msg)
+ throws Exception
+ {
+ AbstractDeclareBeanMetaDataFactory declare =
+ warning ? new DeclareWarningBeanMetaDataFactory() : new DeclareErrorBeanMetaDataFactory();
+
+ declare.setName(name);
+ declare.setExpr(expr);
+ declare.setMessage(msg);
+ factories.add(declare);
+ }
+
+ private String createCommaSeparatedInterfaceString(String[] interfaces)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0 ; i < interfaces.length ; i++)
+ {
+ if (i > 0)
+ {
+ sb.append(", ");
+ }
+ sb.append(interfaces[i]);
+ }
+ return sb.toString();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+TestAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="BeanA" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+ <bean name="BeanB" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+ <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>
+</aop>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,2 @@
+TestCFlowAspect
+TestCFlowInterceptor
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+DeclareAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DefaultBean.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DefaultBean.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DefaultBean.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,2 @@
+DynamicCFlowAspect
+DynamicCFlowImpl
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+TestInterceptor
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="BeanA" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+ <bean name="BeanB" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+IntroductionAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+NamedPointcutAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,5 @@
+Precedence1Aspect
+Precedence2Interceptor
+Precedence3Aspect
+Precedence4Interceptor
+Precedence
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+TypedefAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+AnnotationIntroductionAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase-classes.txt
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase-classes.txt (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase-classes.txt 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1 @@
+PrepareAspect
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.xml 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.annotatedaop.SimplePOJO"/>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTest.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTest.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,60 @@
+/*
+* 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.aop.junit;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotatedAOPMicrocontainerTest extends MicrocontainerTest
+{
+ /**
+ * Get the test delegate
+ *
+ * @param clazz the test class
+ * @return the delegate
+ * @throws Exception for any error
+ */
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+ {
+ String property = System.getProperty("jboss.mc.secure", "false");
+ boolean enableSecurity = Boolean.valueOf(property).booleanValue();
+ AnnotatedAOPMicrocontainerTestDelegate delegate = new AnnotatedAOPMicrocontainerTestDelegate(clazz);
+ delegate.enableSecurity = enableSecurity;
+ return delegate;
+ }
+
+
+ /**
+ * Create a new AnnotatedAOPMicrocontainer test
+ *
+ * @param name the test name
+ */
+ public AnnotatedAOPMicrocontainerTest(String name)
+ {
+ super(name);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTestDelegate.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTestDelegate.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,202 @@
+/*
+* 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.test.aop.junit;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
+import org.jboss.aop.microcontainer.beans.metadata.MicrocontainerAnnotationLoaderStrategy;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.kernel.junit.MicrocontainerTestDelegate;
+import org.jboss.util.file.ArchiveBrowser;
+import org.jboss.util.file.ClassFileFilter;
+import org.jboss.util.file.Files;
+
+/**
+ *
+ * An AOPMicrocontainerTestDelegate.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 75380 $
+ */
+public class AnnotatedAOPMicrocontainerTestDelegate extends MicrocontainerTestDelegate
+{
+ private static final String BOOTSTRAP_FILE = "org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml";
+
+ private File tempDir;
+
+ private List<KernelControllerContext> deployedBeans;
+
+
+
+ /**
+ * Create a new AOPMicrocontainerTestDelegate.
+ *
+ * @param clazz the class
+ * @throws Exception for any error
+ */
+ public AnnotatedAOPMicrocontainerTestDelegate(Class<?> clazz) throws Exception
+ {
+ super(clazz);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUpLogging();
+
+ //Create a temporary directory with the classes listed in the file before we turn on security
+ String testName = clazz.getName();
+ testName = testName.replace('.', '/') + "-classes.txt";
+
+ int slash = testName.lastIndexOf('/');
+ slash = testName.lastIndexOf('/', slash - 1);
+ String annotatedClassesFolder = testName.substring(0, slash + 1);
+
+ URL url = clazz.getClassLoader().getResource(testName);
+ if (url == null)
+ {
+ log.debug("No test specific file containing classes with annoations " + testName);
+ }
+ else
+ {
+ tempDir = getTemporaryDirectory();
+
+ File file = new File(url.toURI());
+
+ copyAnnotatedClassesToTempDir(annotatedClassesFolder, file);
+ }
+
+ super.setUp();
+ log.debug("Security enabled: " + enableSecurity);
+ }
+
+ private File getTemporaryDirectory() throws IOException
+ {
+ File dir = File.createTempFile("annotated", "aop");
+ if (dir.exists() && !dir.delete())
+ throw new IOException("Could not delete temp file " + dir);
+ if (!dir.mkdir())
+ throw new IOException("Could not create temporary directory " + dir);
+ dir.deleteOnExit();
+ return dir;
+ }
+
+ private void copyAnnotatedClassesToTempDir(String annotatedClassesFolder, File inputFile) throws IOException, URISyntaxException
+ {
+ log.debug("Copying annotated classes from " + annotatedClassesFolder + " to " + tempDir);
+ BufferedReader reader = new BufferedReader(new FileReader(inputFile));
+ String clazz = reader.readLine();
+ while (clazz != null)
+ {
+ clazz = clazz.trim();
+ if (clazz.length() == 0)
+ {
+ continue;
+ }
+ log.debug("Copying " + clazz);
+ String path = annotatedClassesFolder + clazz + ".class";
+ URL url = getClass().getClassLoader().getResource(path);
+ File src = new File(url.toURI());
+ File dest = new File(tempDir + "/" + clazz + ".class");
+ Files.copy(src, dest);
+ clazz = reader.readLine();
+ }
+ }
+
+ protected void deploy() throws Exception
+ {
+ URL url = getTestResource(BOOTSTRAP_FILE);
+ deploy(url);
+
+ if (tempDir != null)
+ deployAOP();
+ else
+ log.debug("No test specific deployment tempDir");
+
+ super.deploy();
+ }
+
+ protected void undeploy()
+ {
+ super.undeploy();
+ if (tempDir != null)
+ undeployAOP();
+ }
+
+
+ /**
+ * Deploy the aop config
+ *
+ * @param url the url
+ * @throws Exception for any error
+ */
+ protected void deployAOP() throws Exception
+ {
+ log.debug("Deploying annotations from " + tempDir);
+ MicrocontainerAnnotationLoaderStrategy strategy = new MicrocontainerAnnotationLoaderStrategy();
+ AspectAnnotationLoader loader = new AspectAnnotationLoader(AspectManager.instance(), strategy);
+ URL url = tempDir.toURL();
+ Iterator<InputStream> it = ArchiveBrowser.getBrowser(url, new ClassFileFilter());
+ loader.deployInputStreamIterator(it);
+ List<AspectManagerAwareBeanMetaDataFactory> factories = strategy.getFactories();
+
+ if (factories != null && factories.size() > 0)
+ {
+ deployedBeans = new ArrayList<KernelControllerContext>();
+ for (AspectManagerAwareBeanMetaDataFactory factory : factories)
+ {
+ for (BeanMetaData bean : factory.getBeans())
+ {
+ deployedBeans.add(deploy(bean));
+ }
+ }
+ }
+ }
+
+ /**
+ * Undeploy the aop config
+ *
+ * @param url the url
+ */
+ protected void undeployAOP()
+ {
+ if (deployedBeans != null && deployedBeans.size() > 0)
+ {
+ for (KernelControllerContext bean : deployedBeans)
+ {
+ undeploy(bean);
+ }
+ }
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ComparableMixin.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ComparableMixin.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ComparableMixin.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,38 @@
+/*
+ * 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.test.microcontainer.annotatedaop;
+
+/**
+ * Mixin that implements the <code>Comparable</code> interface.
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ComparableMixin implements Comparable<Object>
+{
+ public static boolean compared = false;
+
+ public int compareTo(Object o)
+ {
+ compared = true;
+ return 0;
+ }
+}
\ No newline at end of file
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DeclareAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DeclareAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DeclareAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.test.microcontainer.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.DeclareError;
+import org.jboss.aop.DeclareWarning;
+import org.jboss.aop.Prepare;
+import org.jboss.aop.advice.Scope;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class DeclareAspect
+{
+ @DeclareError(expr="call(void org.acme.Error->error())", msg="error")
+ public Object error;
+
+ @DeclareWarning(expr="call(void org.acme.Warning->warning())", msg="warning")
+ public Object warning;
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,51 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class DynamicCFlowAspect
+{
+ public static boolean invoked;
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.DynamicCFlowImpl")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ invoked = true;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowImpl.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowImpl.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowImpl.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+import org.jboss.aop.DynamicCFlowDef;
+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 $
+ */
+ at DynamicCFlowDef
+public class DynamicCFlowImpl implements DynamicCFlow
+{
+ static boolean flag;
+
+ public static void setFlag(boolean flag)
+ {
+ DynamicCFlowImpl.flag = flag;
+ }
+
+ public boolean shouldExecute(Invocation invocation)
+ {
+ return flag;
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface1.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface1.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface1.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface EmptyInterface1
+{
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface2.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface2.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface2.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface EmptyInterface2
+{
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface3.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface3.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/EmptyInterface3.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface EmptyInterface3
+{
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ExternalizableMixin.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ExternalizableMixin.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/ExternalizableMixin.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,62 @@
+/*
+ * 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.test.microcontainer.annotatedaop;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ *
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 46162 $
+ */
+public class ExternalizableMixin implements Externalizable
+{
+ public static boolean read = false;
+ public static boolean write = false;
+
+ SimplePOJO pojo;
+
+ public ExternalizableMixin(SimplePOJO pojo)
+ {
+ System.out.println("ExternalizableMixin constructor");
+ this.pojo = pojo;
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ System.out.println("ExternalizableMixin readExternal");
+ read = true;
+ pojo.stuff = in.readUTF();
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ System.out.println("ExternalizableMixin writeExternal");
+ write = true;
+ out.writeUTF(pojo.stuff);
+ }
+
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Interceptions.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Interceptions.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Interceptions.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,51 @@
+/*
+* 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.annotatedaop;
+
+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
+{
+ static List<Integer> interceptions = new ArrayList<Integer>();
+
+ public static void clear()
+ {
+ interceptions.clear();
+ }
+
+ public static void add(Integer i)
+ {
+ System.out.println("---> Adding " + i);
+ interceptions.add(i);
+ }
+
+ public static List<Integer> getInterceptions()
+ {
+ return interceptions;
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/IntroductionAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/IntroductionAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/IntroductionAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,54 @@
+/*
+* 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.annotatedaop;
+
+import java.io.Externalizable;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Introduction;
+import org.jboss.aop.Mixin;
+import org.jboss.aop.advice.Scope;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class IntroductionAspect
+{
+ @Introduction (target=SimplePOJO.class, interfaces={EmptyInterface1.class})
+ public static Object noInterfacesPOJOIntro;
+
+ @Introduction (typeExpression="has(* *->method(..))", interfaces={EmptyInterface2.class, EmptyInterface3.class})
+ public static Object noInterfacesPOJO2Intro;
+
+ @Mixin (target=SimplePOJO.class, interfaces={MixinInterface1.class, MixinInterface2.class})
+ public static MixinA createExternalizableMixin(SimplePOJO pojo) {
+ return new MixinA(pojo);
+ }
+
+ @Mixin (typeExpression="has(* *->method(..))", interfaces={MixinInterface3.class})
+ public static MixinB createComparableMixin() {
+ return new MixinB();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinA.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinA.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinA.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinA implements MixinInterface1, MixinInterface2
+{
+ public static SimplePOJO pojo;
+
+ public MixinA(SimplePOJO pojo)
+ {
+ MixinA.pojo = pojo;
+ }
+
+ public int mixin1()
+ {
+ return 1;
+ }
+
+ public int mixin2()
+ {
+ return 2;
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinB.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinB.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinB.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,36 @@
+/*
+* 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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MixinB implements MixinInterface3
+{
+ public int mixin3()
+ {
+ return 3;
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface1.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface1.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface1.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MixinInterface1
+{
+ int mixin1();
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface2.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface2.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface2.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MixinInterface2
+{
+ int mixin2();
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface3.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface3.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/MixinInterface3.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface MixinInterface3
+{
+ int mixin3();
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/NamedPointcutAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/NamedPointcutAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/NamedPointcutAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,55 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.PointcutDef;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class NamedPointcutAspect
+{
+ public static boolean invoked;
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+
+ @PointcutDef("execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+ Object pointcut;
+
+ @Bind(pointcut="org.jboss.test.microcontainer.annotatedaop.NamedPointcutAspect.pointcut")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ invoked = true;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop;
+
+import org.jboss.aop.PrecedenceAdvice;
+import org.jboss.aop.PrecedenceInterceptor;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at org.jboss.aop.Precedence
+public class Precedence
+{
+ @PrecedenceAdvice ("advice")
+ Precedence1Aspect advice1;
+
+ @PrecedenceAdvice ("advice")
+ Precedence3Aspect advice2;
+
+ @PrecedenceInterceptor
+ Precedence2Interceptor interceptor2;
+
+ @PrecedenceInterceptor
+ Precedence4Interceptor interceptor4;
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence1Aspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence1Aspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence1Aspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,45 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class Precedence1Aspect
+{
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ Interceptions.add(1);
+
+ return inv.invokeNext();
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence2Interceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence2Interceptor.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence2Interceptor.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,51 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Bind;
+import org.jboss.aop.InterceptorDef;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at InterceptorDef(scope=Scope.PER_VM)
+ at Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+public class Precedence2Interceptor implements Interceptor
+{
+
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ Interceptions.add(2);
+ return invocation.invokeNext();
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence3Aspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence3Aspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence3Aspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,45 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class Precedence3Aspect
+{
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ Interceptions.add(3);
+
+ return inv.invokeNext();
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence4Interceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence4Interceptor.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/Precedence4Interceptor.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,51 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Bind;
+import org.jboss.aop.InterceptorDef;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at InterceptorDef(scope=Scope.PER_VM)
+ at Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+public class Precedence4Interceptor implements Interceptor
+{
+
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ Interceptions.add(4);
+ return invocation.invokeNext();
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/SimplePOJO.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/SimplePOJO.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/SimplePOJO.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.test.microcontainer.annotatedaop;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimplePOJO
+{
+ public String stuff;
+
+ public void method()
+ {
+
+ }
+
+ public void anotherMethod()
+ {
+
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,68 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_INSTANCE)
+public class TestAspect
+{
+ public static TestAspect last;
+ public static int invoked;
+ public static int advice;
+
+ public static void reset()
+ {
+ last = null;
+ invoked = 0;
+ advice = 0;
+ }
+
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+ public Object advice1(MethodInvocation inv) throws Throwable
+ {
+ last = this;
+ invoked++;
+ advice = 1;
+
+ return inv.invokeNext();
+ }
+
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->anotherMethod())")
+ public Object advice2(Invocation inv) throws Throwable
+ {
+ last = this;
+ invoked++;
+ advice = 2;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,56 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.CFlowDef;
+import org.jboss.aop.CFlowStackDef;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class TestCFlowAspect
+{
+ @CFlowStackDef(cflows= {@CFlowDef(expr="void org.jboss.test.microcontainer.annotatedaop.test.CFlowTestCase->testCFlowMatch()", called=true), @CFlowDef(expr="void org.jboss.test.microcontainer.annotatedaop.test.CFlowTestCase->makeCall()", called=true)})
+ public static Object cflowDef;
+
+ public static boolean invoked;
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+
+ @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect.cflowDef")
+ public Object advice1(MethodInvocation inv) throws Throwable
+ {
+ invoked = true;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowInterceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowInterceptor.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestCFlowInterceptor.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,56 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Bind;
+import org.jboss.aop.InterceptorDef;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at InterceptorDef(scope=Scope.PER_VM)
+ at Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect.cflowDef")
+public class TestCFlowInterceptor implements Interceptor
+{
+ public static boolean invoked;
+
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked = true;
+ return invocation.invokeNext();
+ }
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestInterceptor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestInterceptor.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TestInterceptor.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,59 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Bind;
+import org.jboss.aop.InterceptorDef;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at InterceptorDef(scope=Scope.PER_INSTANCE)
+ at Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())")
+public class TestInterceptor implements Interceptor
+{
+ public static int invoked;
+ public static TestInterceptor last;
+
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked++;
+ last = this;
+ return invocation.invokeNext();
+ }
+
+ public static void reset()
+ {
+ invoked = 0;
+ last = null;
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TypedefAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TypedefAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/TypedefAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,55 @@
+/*
+* 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.annotatedaop;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.TypeDef;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class TypedefAspect
+{
+ public static boolean invoked;
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+
+ @TypeDef("class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)")
+ Object typedef;
+
+ @Bind(pointcut="execution(* $typedef{org.jboss.test.microcontainer.annotatedaop.TypedefAspect.typedef}->method())")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ invoked = true;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,64 @@
+/*
+* 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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+import org.jboss.test.microcontainer.annotatedaop.TestAspect;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public AspectTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testAspect()
+ {
+ TestAspect.reset();
+ SimplePOJO pojoA = (SimplePOJO)getBean("BeanA");
+ pojoA.method();
+ assertEquals(1, TestAspect.invoked);
+ assertEquals(1, TestAspect.advice);
+
+ //Now check that the scope was honoured
+ TestAspect testA = TestAspect.last;
+
+ TestAspect.reset();
+ pojoA.anotherMethod();
+ assertEquals(1, TestAspect.invoked);
+ assertEquals(2, TestAspect.advice);
+ assertSame(testA, TestAspect.last);
+
+ TestAspect.reset();
+ SimplePOJO pojoB = (SimplePOJO)getBean("BeanB");
+ pojoB.method();
+ assertEquals(1, TestAspect.invoked);
+ assertEquals(1, TestAspect.advice);
+ assertNotSame(testA, TestAspect.last);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,68 @@
+/*
+* 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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+import org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect;
+import org.jboss.test.microcontainer.annotatedaop.TestCFlowInterceptor;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CFlowTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public CFlowTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testCFlowMatch()
+ {
+ TestCFlowAspect.reset();
+ TestCFlowInterceptor.reset();
+
+ makeCall();
+
+ assertTrue(TestCFlowAspect.invoked);
+ assertTrue(TestCFlowInterceptor.invoked);
+ }
+
+ public void testCFlowNotMatch()
+ {
+ TestCFlowAspect.reset();
+ TestCFlowInterceptor.reset();
+
+ makeCall();
+
+ assertFalse(TestCFlowAspect.invoked);
+ assertFalse(TestCFlowInterceptor.invoked);
+ }
+
+ private void makeCall()
+ {
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,78 @@
+/*
+* 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.annotatedaop.test;
+
+import java.util.Iterator;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.pointcut.DeclareDef;
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeclareTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public DeclareTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDeclare()
+ {
+ AspectManager am = (AspectManager)getBean("AspectManager");
+ Iterator<DeclareDef> it = am.getDeclares();
+ int declares = 0;
+ boolean gotError = false;
+ boolean gotWarning = false;
+
+ while (it.hasNext())
+ {
+ DeclareDef def = it.next();
+ declares++;
+
+ if (def.getWarning())
+ {
+ gotWarning = true;
+ checkDeclare(def,"call(void org.acme.Warning->warning())", "warning");
+ }
+ else
+ {
+ gotError = true;
+ checkDeclare(def, "call(void org.acme.Error->error())", "error");
+ }
+ }
+
+ assertEquals(2, declares);
+ assertTrue(gotError);
+ assertTrue(gotWarning);
+ }
+
+ private void checkDeclare(DeclareDef def, String pointcut, String msg)
+ {
+ assertEquals(def.getExpr(), pointcut);
+ assertEquals(def.getMsg(), msg);
+ }
+
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,55 @@
+/*
+* 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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.DynamicCFlowAspect;
+import org.jboss.test.microcontainer.annotatedaop.DynamicCFlowImpl;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DynamicCFlowTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public DynamicCFlowTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testIntrodution()
+ {
+ DynamicCFlowAspect.reset();
+
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+ assertFalse(DynamicCFlowAspect.invoked);
+
+ DynamicCFlowImpl.setFlag(true);
+
+ pojo.method();
+ assertTrue(DynamicCFlowAspect.invoked);
+
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,60 @@
+/*
+* 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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+import org.jboss.test.microcontainer.annotatedaop.TestInterceptor;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public InterceptorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testInterceptor()
+ {
+ TestInterceptor.reset();
+ SimplePOJO pojoA = (SimplePOJO)getBean("BeanA");
+ pojoA.method();
+ assertEquals(1, TestInterceptor.invoked);
+
+ //Now check that the scope was honoured
+ TestInterceptor testA = TestInterceptor.last;
+ TestInterceptor.reset();
+ pojoA.method();
+ assertEquals(1, TestInterceptor.invoked);
+ assertSame(testA, TestInterceptor.last);
+
+ TestInterceptor.reset();
+ SimplePOJO pojoB = (SimplePOJO)getBean("BeanB");
+ pojoB.method();
+ assertEquals(1, TestInterceptor.invoked);
+ assertNotSame(testA, TestInterceptor.last);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,73 @@
+/*
+* 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.annotatedaop.test;
+
+import java.util.Arrays;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.EmptyInterface1;
+import org.jboss.test.microcontainer.annotatedaop.EmptyInterface2;
+import org.jboss.test.microcontainer.annotatedaop.EmptyInterface3;
+import org.jboss.test.microcontainer.annotatedaop.MixinA;
+import org.jboss.test.microcontainer.annotatedaop.MixinInterface1;
+import org.jboss.test.microcontainer.annotatedaop.MixinInterface2;
+import org.jboss.test.microcontainer.annotatedaop.MixinInterface3;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class IntroductionTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public IntroductionTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testIntroductionsAndMixins() throws Exception
+ {
+ SimplePOJO pojo = getBean();
+ System.out.println("-------------->" + Arrays.asList(pojo.getClass().getInterfaces()));
+
+ assertInstanceOf(pojo, EmptyInterface1.class);
+ assertInstanceOf(pojo, EmptyInterface2.class);
+ assertInstanceOf(pojo, EmptyInterface3.class);
+
+ assertInstanceOf(pojo, MixinInterface1.class);
+ assertEquals(1, ((MixinInterface1)pojo).mixin1());
+
+ assertInstanceOf(pojo, MixinInterface2.class);
+ assertEquals(2, ((MixinInterface2)pojo).mixin2());
+
+ assertInstanceOf(pojo, MixinInterface3.class);
+ assertEquals(3, ((MixinInterface3)pojo).mixin3());
+
+ assertNotNull(MixinA.pojo);
+ }
+
+ private SimplePOJO getBean()
+ {
+ return (SimplePOJO)getBean("Bean");
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.NamedPointcutAspect;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class NamedPointcutTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public NamedPointcutTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testIntrodution()
+ {
+ NamedPointcutAspect.reset();
+
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+
+ assertTrue(NamedPointcutAspect.invoked);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.test.microcontainer.annotatedaop.test;
+
+import java.util.List;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.Interceptions;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrecedenceTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public PrecedenceTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testPrecedence()
+ {
+ Interceptions.clear();
+
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+
+ List<Integer> interceptions = Interceptions.getInterceptions();
+ assertEquals(4, interceptions.size());
+
+ for (int i = 0 ; i < 4 ; i++)
+ {
+ int res = interceptions.get(i);
+ switch (i)
+ {
+ case 0:
+ assertEquals(1, res);
+ break;
+ case 1:
+ assertEquals(3, res);
+ break;
+ case 2:
+ assertEquals(2, res);
+ break;
+ case 3:
+ assertEquals(4, res);
+ break;
+ }
+ }
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+import org.jboss.test.microcontainer.annotatedaop.TypedefAspect;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class TypedefTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public TypedefTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testTypedef()
+ {
+ TypedefAspect.reset();
+
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+
+ assertTrue(TypedefAspect.invoked);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/AnnotationIntroductionAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/AnnotationIntroductionAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/AnnotationIntroductionAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,55 @@
+/*
+* 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.annotatedaop.woven;
+
+import org.jboss.aop.AnnotationIntroductionDef;
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.advice.Scope;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class AnnotationIntroductionAspect
+{
+ public static boolean invoked;
+
+ public static void reset()
+ {
+ invoked = false;
+ }
+
+ @AnnotationIntroductionDef(expr="class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)", annotation="@org.jboss.test.microcontainer.annotatedaop.woven.TestAnnotation", invisible=false)
+ Object intro;
+
+ @Bind(pointcut="execution(* @org.jboss.test.microcontainer.annotatedaop.woven.TestAnnotation->method())")
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ invoked = true;
+
+ return inv.invokeNext();
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/PrepareAspect.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/PrepareAspect.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/PrepareAspect.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,38 @@
+/*
+* 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.annotatedaop.woven;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Prepare;
+import org.jboss.aop.advice.Scope;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect(scope=Scope.PER_VM)
+public class PrepareAspect
+{
+ @Prepare("all(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)")
+ public Object prepare;
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/TestAnnotation.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/TestAnnotation.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/TestAnnotation.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,38 @@
+/*
+* 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.annotatedaop.woven;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface TestAnnotation
+{
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -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.annotatedaop.woven.test;
+
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.woven.AnnotationIntroductionAspect;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationIntroductionTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public AnnotationIntroductionTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testIntrodution()
+ {
+ AnnotationIntroductionAspect.reset();
+
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ pojo.method();
+
+ assertTrue(AnnotationIntroductionAspect.invoked);
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.java (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.java 2008-07-22 17:04:29 UTC (rev 76111)
@@ -0,0 +1,45 @@
+/*
+* 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.annotatedaop.woven.test;
+
+import org.jboss.aop.Advised;
+import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.annotatedaop.SimplePOJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrepareTestCase extends AnnotatedAOPMicrocontainerTest
+{
+ public PrepareTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testPrepare()
+ {
+ SimplePOJO pojo = (SimplePOJO)getBean("Bean");
+ assertInstanceOf(pojo, Advised.class);
+ }
+}
More information about the jboss-cvs-commits
mailing list