[jboss-cvs] JBossAS SVN: r75924 - in trunk/testsuite: src/main/org/jboss/test/aop/jdk15annotated and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 16 09:20:43 EDT 2008
Author: stalep
Date: 2008-07-16 09:20:42 -0400 (Wed, 16 Jul 2008)
New Revision: 75924
Added:
trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.java
trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.java
trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/
trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/
trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-aop.xml
trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-service.xml
Modified:
trunk/testsuite/imports/sections/aop.xml
trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedAnnotatedTestCase.java
trunk/testsuite/src/resources/aop/jdk15annotated/scoped/META-INF/jboss-service.xml
Log:
[JBAS-5757] Added scoped tests of annotated aop aspects/mixin/etc
Modified: trunk/testsuite/imports/sections/aop.xml
===================================================================
--- trunk/testsuite/imports/sections/aop.xml 2008-07-16 13:01:02 UTC (rev 75923)
+++ trunk/testsuite/imports/sections/aop.xml 2008-07-16 13:20:42 UTC (rev 75924)
@@ -261,6 +261,8 @@
<include name="org/jboss/test/aop/jdk15annotated/*.class"/>
<exclude name="org/jboss/test/aop/jdk15annotated/AnnotatedTester.class" />
<exclude name="org/jboss/test/aop/jdk15annotated/AnnotatedTesterMBean.class" />
+ <exclude name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.class" />
+ <exclude name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.class" />
</fileset>
<fileset dir="${build.resources}/aop/jdk15annotated">
<include name="META-INF/jboss-aop.xml"/>
@@ -285,6 +287,8 @@
<include name="org/jboss/test/aop/jdk15annotated/*.class"/>
<exclude name="org/jboss/test/aop/jdk15annotated/AnnotatedTester.class" />
<exclude name="org/jboss/test/aop/jdk15annotated/AnnotatedTesterMBean.class" />
+ <exclude name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.class" />
+ <exclude name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.class" />
</fileset>
<fileset dir="${build.resources}/aop/jdk15annotated/scoped">
<include name="META-INF/jboss-aop.xml"/>
@@ -292,8 +296,8 @@
</jar>
<jar destfile="${build.lib}/aop-scoped-annotated.sar">
<fileset dir="${build.classes}">
- <include name="org/jboss/test/aop/jdk15annotated/AnnotatedTester.class" />
- <include name="org/jboss/test/aop/jdk15annotated/AnnotatedTesterMBean.class" />
+ <include name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.class" />
+ <include name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.class" />
</fileset>
<fileset dir="${build.lib}">
<include name="aop-scoped-annotated.aop" />
@@ -302,7 +306,41 @@
<include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
-
+
+ <jar destfile="${build.lib}/aop-scoped-annotated2.aop">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/aop/jdk15annotated/AnotherPOJO.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/AspectFromFactory.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/ComparableMixin.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/EmptyInterface.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/ExternalizableMixin.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/Interceptions.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/IntroducedAnnotationPOJO.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/MyAnnotation.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/NoInterfacesPOJO.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/NoInterfacesPOJO2.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/POJO.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/POJO2.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/PreparePOJO.class"/>
+ <include name="org/jboss/test/aop/jdk15annotated/VariaPOJO.class"/>
+ </fileset>
+ <fileset dir="${build.resources}/aop/jdk15annotated/scoped2">
+ <include name="META-INF/jboss-aop.xml"/>
+ </fileset>
+ </jar>
+ <jar destfile="${build.lib}/aop-scoped-annotated2.sar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.class" />
+ <include name="org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.class" />
+ </fileset>
+ <fileset dir="${build.lib}">
+ <include name="aop-scoped-annotated2.aop" />
+ </fileset>
+ <fileset dir="${build.resources}/aop/jdk15annotated/scoped2">
+ <include name="META-INF/jboss-service.xml"/>
+ </fileset>
+ </jar>
+
<!-- jars for scoped test -->
<jar destfile="${build.lib}/aop-scopedtest1.aop">
<fileset dir="${build.classes}">
Added: trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTester.java 2008-07-16 13:20:42 UTC (rev 75924)
@@ -0,0 +1,413 @@
+/*
+ * 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.jdk15annotated;
+
+import org.jboss.aop.Advised;
+import org.jboss.aop.Advisor;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AdviceBinding;
+import org.jboss.aop.advice.AdviceFactory;
+import org.jboss.aop.advice.AspectDefinition;
+
+/**
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision$
+ */
+public class ScopedAnnotatedTester implements ScopedAnnotatedTesterMBean
+{
+
+ public void testBinding() throws Exception
+ {
+ System.out.println("***** testBinding() ****");
+ AspectPerVM vm = null;
+ AspectPerClass perClass = null;
+ AspectPerClass perClass2 = null;
+
+ try
+ {
+ System.out.println("---- POJO ---");
+ POJO pojo = new POJO();
+ pojo.field++;
+ pojo.someMethod();
+ System.out.println("---- POJO2 ---");
+ POJO2 pojo2 = new POJO2();
+ pojo2.field++;
+ pojo2.someMethod();
+
+ System.out.println("-- get stats --");
+ vm = (AspectPerVM) AspectManager.instance().getPerVMAspect("org.jboss.test.aop.jdk15annotated.AspectPerVM");
+ System.out.println("perVM stats: " + vm.constructorCalled + " " + vm.methodCalled + " " + vm.fieldRead + " " + vm.fieldWrite);
+ assertEquals(2, vm.constructorCalled);
+ assertEquals(2, vm.methodCalled);
+ assertEquals(2, vm.fieldRead);
+ assertEquals(2, vm.fieldWrite);
+
+ Advisor advisor = ((Advised) pojo)._getAdvisor();
+ perClass = (AspectPerClass) advisor.getPerClassAspect("org.jboss.test.aop.jdk15annotated.AspectPerClass");
+ System.out.println("POJO perClass stats: " + perClass.constructorCalled + " " + perClass.methodCalled + " " + perClass.fieldRead + " " + perClass.fieldWrite);
+ assertEquals(1, perClass.constructorCalled);
+ assertEquals(1, perClass.methodCalled);
+ assertEquals(1, perClass.fieldRead);
+ assertEquals(1, perClass.fieldWrite);
+
+ advisor = ((Advised) pojo2)._getAdvisor();
+ perClass2 = (AspectPerClass) advisor.getPerClassAspect("org.jboss.test.aop.jdk15annotated.AspectPerClass");
+ System.out.println("POJO2 perClass stats: " + perClass.constructorCalled + " " + perClass.methodCalled + " " + perClass.fieldRead + " " + perClass.fieldWrite);
+ assertEquals(1, perClass2.constructorCalled);
+ assertEquals(1, perClass2.methodCalled);
+ assertEquals(1, perClass2.fieldRead);
+ assertEquals(1, perClass2.fieldWrite);
+
+ InstanceAdvisor ia = ((Advised) pojo)._getInstanceAdvisor();
+ AspectPerInstance perInstance = (AspectPerInstance) ia.getPerInstanceAspect("org.jboss.test.aop.jdk15annotated.AspectPerInstance");
+ System.out.println("pojo perInstance stats: " + perInstance.methodCalled + " " + perInstance.fieldRead + " " + perInstance.fieldWrite);
+ assertEquals(1, perInstance.methodCalled);
+ assertEquals(1, perInstance.fieldRead);
+ assertEquals(1, perInstance.fieldWrite);
+
+ ia = ((Advised) pojo2)._getInstanceAdvisor();
+ perInstance = (AspectPerInstance) ia.getPerInstanceAspect("org.jboss.test.aop.jdk15annotated.AspectPerInstance");
+ System.out.println("pojo2 perInstance stats: " + perInstance.methodCalled + " " + perInstance.fieldRead + " " + perInstance.fieldWrite);
+ assertEquals(1, perInstance.methodCalled);
+ assertEquals(1, perInstance.fieldRead);
+ assertEquals(1, perInstance.fieldWrite);
+ }
+ finally
+ {
+ if (vm != null) vm.reset();
+ if (perClass != null) perClass.reset();
+ if (perClass2 != null) perClass2.reset();
+ }
+ }
+
+ public void testBindingNoAspects() throws Exception
+ {
+
+ try
+ {
+ Object vm = AspectManager.instance().getPerVMAspect("org.jboss.test.aop.jdk15annotated.AspectPerVM");
+ if(vm != null)
+ throw new RuntimeException("AspectPerVm should not be available in this deployment.");
+
+ POJO pojo = new POJO();
+ Advisor advisor = ((Advised) pojo)._getAdvisor();
+ throw new RuntimeException("POJO should not be advised in this deployment.");
+
+ }
+ catch(Exception expected)
+ {
+ }
+ }
+
+ public void testNoMixin() throws Exception
+ {
+ try
+ {
+ NoInterfacesPOJO2 pojo2 = new NoInterfacesPOJO2();
+ ((Comparable<Object>) pojo2).compareTo(null);
+ throw new RuntimeException("Mixins should not be available in this deployment");
+ }
+ catch(Exception e)
+ {
+ }
+ }
+
+
+ public void testCompostition() throws Exception
+ {
+ AspectPerVM vm = null;
+ try
+ {
+ System.out.println("***** testCompostition() ****");
+ System.out.println("---- AnotherPOJO ---");
+ AnotherPOJO apojo = new AnotherPOJO();
+ apojo.field++;
+ apojo.someMethod();
+
+ vm = (AspectPerVM) AspectManager.instance().getPerVMAspect("org.jboss.test.aop.jdk15annotated.AspectPerVM");
+ assertEquals(4, vm.anotherPOJOAccess);
+ }
+ finally
+ {
+ if (vm != null) vm.reset();
+ }
+ }
+
+ public void testMixin() throws Exception
+ {
+ System.out.println("***** testMixin() ****");
+ ExternalizableMixin.write = false;
+ ExternalizableMixin.read = false;
+ NoInterfacesPOJO pojo = new NoInterfacesPOJO();
+
+ pojo.stuff = "hello world";
+ java.rmi.MarshalledObject mo = new java.rmi.MarshalledObject(pojo);
+ pojo = (NoInterfacesPOJO)mo.get();
+ System.out.println("deserialized pojo2.stuff2: " + pojo.stuff);
+ assertTrue("writeExternal was not called", ExternalizableMixin.write);
+ assertTrue("readExternal was not called", ExternalizableMixin.read);
+
+ ExternalizableMixin.write = false;
+ ExternalizableMixin.read = false;
+ NoInterfacesPOJO2 pojo2 = new NoInterfacesPOJO2();
+
+ pojo2.stuff = "whatever";
+ java.rmi.MarshalledObject mo2 = new java.rmi.MarshalledObject(pojo2);
+ pojo2 = (NoInterfacesPOJO2)mo2.get();
+ System.out.println("deserialized pojo2.stuff2: " + pojo2.stuff);
+ assertTrue("writeExternal was not called for pojo2", ExternalizableMixin.write);
+ assertTrue("readExternal was not called for pojo2", ExternalizableMixin.read);
+
+ ComparableMixin.COMPARED = false;
+ ((Comparable<Object>) pojo2).compareTo(null);
+ assertTrue("mixin method was not called", ComparableMixin.COMPARED);
+ }
+
+ public void testIntroduction() throws Exception
+ {
+ System.out.println("***** testIntroduction() ****");
+ NoInterfacesPOJO pojo = new NoInterfacesPOJO();
+
+ try
+ {
+ EmptyInterface eif = (EmptyInterface)pojo;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException("pojo does not implement EmptyInterface");
+ }
+
+ NoInterfacesPOJO2 pojo2 = new NoInterfacesPOJO2();
+
+
+ try
+ {
+ EmptyInterface eif = (EmptyInterface)pojo2;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException("pojo2 does not implement EmptyInterface");
+ }
+
+ }
+
+ public void testInterceptorDef()throws Exception
+ {
+ System.out.println("***** testInterceptorDef() ****");
+
+ CountingInterceptor.count = 0;
+ VariaPOJO pojo = new VariaPOJO();
+ pojo.methodWithInterceptor();
+ System.out.println("Count: " + CountingInterceptor.count);
+ assertEquals("execution of POJO.methodWithInterceptor() was not intercepted", 1, CountingInterceptor.count);
+
+ CountingInterceptor.count = 0;
+ pojo.methodWithInterceptorFactory();
+ System.out.println("Count: " + CountingInterceptor.count);
+ assertEquals("execution of POJO.methodWithInterceptorFactory() was not intercepted", 1, CountingInterceptor.count);
+ }
+
+ public void testTypedef()throws Exception
+ {
+ System.out.println("***** testTypedef() ****");
+
+ VariaPOJO pojo = new VariaPOJO();
+ pojo.methodWithTypedef();
+ System.out.println("Intercepted: " + TypedefAspect.intercepted);
+ assertTrue("execution of POJO.methodWithTypedef() was not intercepted", TypedefAspect.intercepted);
+ }
+
+ public void testCFlow()throws Exception
+ {
+ System.out.println("***** testCFlow() ****");
+
+ CFlowAspect.cflowAccess = 0;
+
+ VariaPOJO pojo = new VariaPOJO();
+ pojo.cflowMethod1();
+ assertEquals("Wrong number of interceptions 1) for cflow Advice", 1, CFlowAspect.cflowAccess);
+
+ CFlowAspect.cflowAccess = 0;
+ pojo.cflowMethod2();
+ System.out.println("ints: " + CFlowAspect.cflowAccess);
+ assertEquals("Wrong number of interceptions 2) for cflow Advice", 1, CFlowAspect.cflowAccess );
+
+ }
+
+ public void testPrepare()throws Exception
+ {
+ System.out.println("***** testPrepare() ****");
+ PreparePOJO pojo = new PreparePOJO();
+ pojo.someMethod();
+
+ Advised advised = (Advised)pojo;
+ Advisor advisor = advised._getAdvisor();
+ }
+
+ public void testPrepareAtClassLevel() throws Exception
+ {
+ System.out.println("***** testPrepareAtClassLevel() ****");
+ PreparedPOJO pojo = new PreparedPOJO();
+ pojo.someMethod();
+
+ Advised advised = (Advised)pojo;
+ Advisor advisor = advised._getAdvisor();
+ }
+
+ public void testDynamicCFlow()throws Exception
+ {
+ System.out.println("***** testDynamicCFlow() ****");
+
+ CFlowAspect.cflowAccess = 0;
+
+ VariaPOJO pojo = new VariaPOJO();
+ pojo.dynamicCFlowMethod();
+ assertEquals("Wrong number of interceptions for dynamic cflow Advice", 0, CFlowAspect.cflowAccess);
+
+ SimpleDynamicCFlow.execute = true;
+ pojo.dynamicCFlowMethod();
+ assertEquals("Wrong number of interceptions for dynamic cflow Advice", 1, CFlowAspect.cflowAccess);
+
+ SimpleDynamicCFlow.execute = false;
+ pojo.dynamicCFlowMethod();
+ assertEquals("Wrong number of interceptions for dynamic cflow Advice (2)", 1, CFlowAspect.cflowAccess);
+ }
+
+ public void testAnnotationIntroduction() throws Exception
+ {
+ System.out.println("***** testAnnotationIntroduction() ****");
+ IntroducedAnnotationPOJO pojo = new IntroducedAnnotationPOJO();
+ assertNull("IntroducedAnnotationPOJO should not have had a constructor annotation", IntroducedAnnotationInterceptor.lastMyAnnotation);
+
+ pojo.annotationIntroductionMethod();
+ MyAnnotation annotation = IntroducedAnnotationInterceptor.lastMyAnnotation;
+ assertNotNull("IntroducedAnnotationPOJO.annotationIntroductionMethod() should have had a method annotation", annotation);
+ assertEquals("Wrong value for MyAnnotation.string()", "hello", annotation.string());
+ assertEquals("Wrong value for MyAnnotation.integer()", 5, annotation.integer());
+ assertEquals("Wrong value for MyAnnotation.bool()", true, annotation.bool());
+ pojo.noAnnotationIntroductionMethod();
+ assertNull("IntroducedAnnotationPOJO.noAnnotationIntroductionMethod() should not have had a method annotation", IntroducedAnnotationInterceptor.lastMyAnnotation);
+ }
+
+ public void testPrecedence() throws Exception
+ {
+ System.out.println("***** testPrecedence() ****");
+ VariaPOJO pojo = new VariaPOJO();
+
+ pojo.precedenceMethod();
+ java.util.ArrayList intercepted = Interceptions.intercepted;
+ assertEquals("Wrong number of interceptions", 4 ,intercepted.size());
+
+ int precedenceIntercptor1 = intercepted.indexOf("PrecedenceInterceptor1");
+ int precedenceAspect_advice1 = intercepted.indexOf("PrecedenceAspect1.advice1");
+ int precedenceAspect_advice2 = intercepted.indexOf("PrecedenceAspect1.advice2");
+ int precedenceIntercptor2 = intercepted.indexOf("PrecedenceInterceptor2");
+
+ assertTrue("PrecedenceInterceptor1 must come before PrecedenceInterceptor2 as defined in Precedence1", precedenceIntercptor1 < precedenceIntercptor2);
+
+ assertEquals("PrecedenceInterceptor2 must be the last element", 3, precedenceIntercptor2);
+ assertTrue("PrecedenceInterceptor.advice2 must come before PrecedenceInterceptor.advice1 as defined in Precedence2", precedenceAspect_advice2 < precedenceAspect_advice1);
+ assertTrue("PrecedenceInterceptor.advice1 must come before PrecedenceInterceptor.advice1 as defined in Precedence2", precedenceAspect_advice1 < precedenceIntercptor2);
+ }
+
+ /**
+ * Tests the annotation of an aspect factory as @Aspect.
+ */
+ public void testAspectFactory() throws Exception
+ {
+ AdviceBinding binding = new AdviceBinding(
+ "execution(void *PreparedPOJO->someMethod(..))", null);
+ AspectDefinition aspectDefinition = AspectManager.instance()
+ .getAspectDefinition(AnnotatedAspectFactory.class.getName());
+ assertNotNull(aspectDefinition);
+ binding.addInterceptorFactory(new AdviceFactory(aspectDefinition,
+ "advice"));
+ AspectManager.instance().addBinding(binding);
+
+ PreparedPOJO pojo = new PreparedPOJO();
+ pojo.someMethod();
+ assertTrue(AnnotatedAspectFactory.isAspectCreated());
+ assertTrue(AnnotatedAspectFactory.getAspectCreated().isAdvised());
+ AspectManager.instance().removeBinding(binding.getName());
+ }
+
+ private void assertEquals(int expected, int current)
+ {
+ assertEquals("Expected value " + expected + ", was " + current, expected, current);
+ }
+
+ private void assertEquals(String output, int expected, int current)
+ {
+ if(expected != current)
+ throw new RuntimeException(output);
+ }
+
+ private void assertEquals(String expected, String current)
+ {
+ assertEquals("Expected value " + expected + ", was " + current, expected, current);
+ }
+
+ private void assertEquals(String output, String expected, String current)
+ {
+ if(!expected.equals(current))
+ throw new RuntimeException(output);
+ }
+
+ private void assertEquals(String output, boolean expected, boolean current)
+ {
+ if(expected != current)
+ throw new RuntimeException(output);
+ }
+
+ private void assertTrue(boolean b)
+ {
+ assertTrue("Expected true", b);
+ }
+
+ private void assertTrue(String output, boolean b)
+ {
+ if(!b)
+ throw new RuntimeException(output);
+ }
+
+ private void assertNotNull(Object o)
+ {
+ assertNotNull("Expected not null", o);
+ }
+
+ private void assertNotNull(String output, Object o)
+ {
+ if(o == null)
+ throw new RuntimeException(output);
+ }
+
+ private void assertNull(String output, Object o)
+ {
+ if(o != null)
+ throw new RuntimeException(output);
+ }
+
+}
+
+
Added: trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/aop/jdk15annotated/ScopedAnnotatedTesterMBean.java 2008-07-16 13:20:42 UTC (rev 75924)
@@ -0,0 +1,48 @@
+/*
+ * 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.jdk15annotated;
+
+/**
+ *
+ * @author <a href="stale.pedersen at jboss.org">Stale W. Pedersen</a>
+ * @version $Revision$
+ */
+public interface ScopedAnnotatedTesterMBean
+{
+ void testBinding() throws Exception;
+ void testBindingNoAspects() throws Exception;
+ void testCompostition() throws Exception;
+ void testMixin() throws Exception;
+ void testNoMixin() throws Exception;
+ void testIntroduction() throws Exception;
+ void testInterceptorDef()throws Exception;
+ void testTypedef()throws Exception;
+ void testCFlow()throws Exception;
+ void testPrepare()throws Exception;
+ void testPrepareAtClassLevel() throws Exception;
+ void testDynamicCFlow()throws Exception;
+ void testAnnotationIntroduction() throws Exception;
+ void testPrecedence() throws Exception;
+ void testAspectFactory() throws Exception;
+
+}
+
Modified: trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedAnnotatedTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedAnnotatedTestCase.java 2008-07-16 13:01:02 UTC (rev 75923)
+++ trunk/testsuite/src/main/org/jboss/test/aop/test/ScopedAnnotatedTestCase.java 2008-07-16 13:20:42 UTC (rev 75924)
@@ -37,6 +37,8 @@
public class ScopedAnnotatedTestCase extends JBossTestCase
{
+ static AOPClassLoaderHookTestSetup setup;
+
public ScopedAnnotatedTestCase(String name)
{
super(name);
@@ -44,16 +46,33 @@
public void testBinding() throws Exception
{
- /*
MBeanServerConnection server = getServer();
ObjectName testerName = new ObjectName("jboss.aop:name=ScopedAnnotatedTester");
Object[] params = {};
String[] sig = {};
server.invoke(testerName, "testBinding", params, sig);
- */
}
+
+ public void testBindingNoAspects() throws Exception
+ {
+ MBeanServerConnection server = getServer();
+ ObjectName testerName = new ObjectName("jboss.aop:name=ScopedAnnotatedTester2");
+ Object[] params = {};
+ String[] sig = {};
+ server.invoke(testerName, "testBindingNoAspects", params, sig);
+ }
- /*
+ public void testNoMixin() throws Exception
+ {
+ MBeanServerConnection server = getServer();
+ ObjectName testerName = new ObjectName("jboss.aop:name=ScopedAnnotatedTester2");
+ Object[] params = {};
+ String[] sig = {};
+ server.invoke(testerName, "testNoMixin", params, sig);
+ }
+
+
+
public void testCompostition() throws Exception
{
MBeanServerConnection server = getServer();
@@ -165,9 +184,23 @@
TestSuite suite = new TestSuite();
suite.addTest(new TestSuite(ScopedAnnotatedTestCase.class));
- AOPTestSetup setup = new AOPTestSetup(suite, "aop-scoped-annotated.sar");
+ setup = new AOPClassLoaderHookTestSetup(suite, new MySetupHook(), "aop-scoped-annotated.sar,aop-scoped-annotated2.sar");
return setup;
}
- */
+
+ static class MySetupHook implements SetupHook
+ {
+ public void setup(MBeanServerConnection server) throws Exception
+ {
+ ObjectName aspectManager = new ObjectName(AOPClassLoaderHookTestSetup.ASPECT_MANAGER_NAME);
+
+ }
+
+ public void teardown(MBeanServerConnection server) throws Exception
+ {
+ ObjectName aspectManager = new ObjectName(AOPClassLoaderHookTestSetup.ASPECT_MANAGER_NAME);
+ }
+ }
+
}
Modified: trunk/testsuite/src/resources/aop/jdk15annotated/scoped/META-INF/jboss-service.xml
===================================================================
--- trunk/testsuite/src/resources/aop/jdk15annotated/scoped/META-INF/jboss-service.xml 2008-07-16 13:01:02 UTC (rev 75923)
+++ trunk/testsuite/src/resources/aop/jdk15annotated/scoped/META-INF/jboss-service.xml 2008-07-16 13:20:42 UTC (rev 75924)
@@ -2,7 +2,9 @@
<server>
<loader-repository>
aop.loading:loader=scopedannotated
+ <!--
<loader-repository-config>java2ParentDelegation=true</loader-repository-config>
+ -->
</loader-repository>
- <mbean code="org.jboss.test.aop.jdk15annotated.AnnotatedTester" name="jboss.aop:name=ScopedAnnotatedTester"/>
+ <mbean code="org.jboss.test.aop.jdk15annotated.ScopedAnnotatedTester" name="jboss.aop:name=ScopedAnnotatedTester"/>
</server>
Added: trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-aop.xml
===================================================================
--- trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-aop.xml (rev 0)
+++ trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-aop.xml 2008-07-16 13:20:42 UTC (rev 75924)
@@ -0,0 +1,3 @@
+<aop>
+ <loader-repository>aop.loading:loader=scopedannotated2</loader-repository>
+</aop>
Added: trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-service.xml
===================================================================
--- trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-service.xml (rev 0)
+++ trunk/testsuite/src/resources/aop/jdk15annotated/scoped2/META-INF/jboss-service.xml 2008-07-16 13:20:42 UTC (rev 75924)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <loader-repository>
+ aop.loading:loader=scopedannotated2
+ </loader-repository>
+ <mbean code="org.jboss.test.aop.jdk15annotated.ScopedAnnotatedTester" name="jboss.aop:name=ScopedAnnotatedTester2"/>
+</server>
More information about the jboss-cvs-commits
mailing list