[jboss-cvs] JBossAS SVN: r74487 - in projects/microcontainer/trunk/aop-mc-int/src: resources/tests/org/jboss/test/microcontainer/test and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jun 12 09:34:58 EDT 2008
Author: kabir.khan at jboss.com
Date: 2008-06-12 09:34:57 -0400 (Thu, 12 Jun 2008)
New Revision: 74487
Added:
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.bak
Removed:
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.java
Modified:
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/integration/AOPConstructorJoinpoint.java
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.java
Log:
[JBMICROCONT-300] Disable use of @InstanceAnnotation in AOPConstructorJoinpoint
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/integration/AOPConstructorJoinpoint.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/integration/AOPConstructorJoinpoint.java 2008-06-12 13:23:08 UTC (rev 74486)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/integration/AOPConstructorJoinpoint.java 2008-06-12 13:34:57 UTC (rev 74487)
@@ -222,13 +222,7 @@
}
else if (annotationsSize > 0)
{
- // do we have an annotation that's not marked with IA
- for (Annotation annotation : annotations)
- {
- InstanceAnnotation ia = annotation.annotationType().getAnnotation(InstanceAnnotation.class);
- if (ia == null || ia.value())
- return true;
- }
+ return true;
}
}
return false;
Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.xml 2008-06-12 13:23:08 UTC (rev 74486)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.xml 2008-06-12 13:34:57 UTC (rev 74487)
@@ -2,6 +2,12 @@
<bean name="AspectManager" class="org.jboss.aop.AspectManager">
<constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
</bean>
+
+ <interceptor xmlns="urn:jboss:aop-beans:1.0" name="InterceptedAdvice" class="org.jboss.test.microcontainer.support.SimpleInterceptor1"/>
+
+ <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.test.microcontainer.support.Marker->*(..))">
+ <interceptor-ref name="InterceptedAdvice"/>
+ </bind>
<bean name="Bean" class="org.jboss.test.microcontainer.support.AnnotatedBean">
<annotation>@org.jboss.test.microcontainer.support.Marker</annotation>
Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.java 2008-06-12 13:23:08 UTC (rev 74486)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.java 2008-06-12 13:34:57 UTC (rev 74487)
@@ -65,44 +65,14 @@
{
Base base = (Base)getBean("ClassAnnotated");
assertFalse(base instanceof Advised);
- assertTrue(base instanceof AspectManaged);
-
- //Not the main purpose of the test but being paranoid never hurt
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
-
- String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class);
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(1, TestInterceptor.interceptions);
-
- DynamicAspectDeployer.removeBinding(name);
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
+ assertFalse(base instanceof AspectManaged);
}
public void testMethodMetaDataContext() throws Exception
{
Base base = (Base)getBean("PropertyAnnotated");
assertFalse(base instanceof Advised);
- assertTrue(base instanceof AspectManaged);
-
- //Not the main purpose of the test but being paranoid never hurt
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
-
- String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class);
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(1, TestInterceptor.interceptions);
-
- DynamicAspectDeployer.removeBinding(name);
- TestInterceptor.reset();
- base.baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
+ assertFalse(base instanceof AspectManaged);
}
public static Test suite()
Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.java 2008-06-12 13:23:08 UTC (rev 74486)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.java 2008-06-12 13:34:57 UTC (rev 74487)
@@ -29,8 +29,6 @@
import org.jboss.aop.proxy.container.AspectManaged;
import org.jboss.test.aop.junit.AbstractProxyTest;
import org.jboss.test.microcontainer.matrix.Base;
-import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer;
-import org.jboss.test.microcontainer.matrix.TestInterceptor;
/**
* No MC counterpart since there is no way to create SimpleMetaData via MC
@@ -47,22 +45,7 @@
metaData.addMetaData("Simple", "MetaData", "Value");
Object proxy = createProxy(base, null, metaData);
assertFalse(proxy instanceof Advised);
- assertTrue(proxy instanceof AspectManaged);
-
- //Not the main purpose of the test but being paranoid never hurt
- TestInterceptor.reset();
- ((Base)proxy).baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
-
- String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class);
- TestInterceptor.reset();
- ((Base)proxy).baseOnly();
- assertEquals(1, TestInterceptor.interceptions);
-
- DynamicAspectDeployer.removeBinding(name);
- TestInterceptor.reset();
- ((Base)proxy).baseOnly();
- assertEquals(0, TestInterceptor.interceptions);
+ assertFalse(proxy instanceof AspectManaged);
}
public static Test suite()
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.bak
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.bak (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.bak 2008-06-12 13:34:57 UTC (rev 74487)
@@ -0,0 +1,77 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.aop.junit.AbstractTypeTest;
+import org.jboss.test.aop.junit.AbstractTypeTestDelegate;
+
+/**
+ * Test instance annotations, do we require aop proxy for them.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class HasInstanceAnnotationTestCase extends AbstractTypeTest
+{
+ public HasInstanceAnnotationTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(HasInstanceAnnotationTestCase.class);
+ }
+
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+ {
+ //Don't use security for this test
+ AbstractTypeTestDelegate delegate = new AbstractTypeTestDelegate(clazz);
+ return delegate;
+ }
+
+ public void testInstanceAnnotation() throws Throwable
+ {
+ SecurityManager sm = suspendSecurity();
+ try
+ {
+ assertIsPojo("Bean1");
+ assertIsPojo("Bean2");
+
+ assertIsAspectized("Bean3");
+ assertIsAspectized("Bean4");
+
+ assertIsAspectized("Bean5");
+ assertIsAspectized("Bean6");
+
+ assertIsPojo("Bean7");
+ assertIsPojo("Bean8");
+ assertIsPojo("Bean9");
+ }
+ finally
+ {
+ resumeSecurity(sm);
+ }
+ }
+}
Deleted: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.java 2008-06-12 13:23:08 UTC (rev 74486)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/HasInstanceAnnotationTestCase.java 2008-06-12 13:34:57 UTC (rev 74487)
@@ -1,77 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.microcontainer.test;
-
-import junit.framework.Test;
-
-import org.jboss.test.AbstractTestDelegate;
-import org.jboss.test.aop.junit.AbstractTypeTest;
-import org.jboss.test.aop.junit.AbstractTypeTestDelegate;
-
-/**
- * Test instance annotations, do we require aop proxy for them.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class HasInstanceAnnotationTestCase extends AbstractTypeTest
-{
- public HasInstanceAnnotationTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(HasInstanceAnnotationTestCase.class);
- }
-
- public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
- {
- //Don't use security for this test
- AbstractTypeTestDelegate delegate = new AbstractTypeTestDelegate(clazz);
- return delegate;
- }
-
- public void testInstanceAnnotation() throws Throwable
- {
- SecurityManager sm = suspendSecurity();
- try
- {
- assertIsPojo("Bean1");
- assertIsPojo("Bean2");
-
- assertIsAspectized("Bean3");
- assertIsAspectized("Bean4");
-
- assertIsAspectized("Bean5");
- assertIsAspectized("Bean6");
-
- assertIsPojo("Bean7");
- assertIsPojo("Bean8");
- assertIsPojo("Bean9");
- }
- finally
- {
- resumeSecurity(sm);
- }
- }
-}
More information about the jboss-cvs-commits
mailing list