[jboss-cvs] JBossAS SVN: r82284 - in projects/microcontainer/trunk/aop-mc-int/src/test: resources/org/jboss/test/microcontainer/beans/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 15 13:42:06 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-12-15 13:42:06 -0500 (Mon, 15 Dec 2008)
New Revision: 82284
Added:
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml
Removed:
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml
Modified:
projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
Log:
[JBMICROCONT-402] Improve test
Modified: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java 2008-12-15 18:42:06 UTC (rev 82284)
@@ -40,4 +40,16 @@
super(test);
}
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml";
+ }
+
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java 2008-12-15 18:42:06 UTC (rev 82284)
@@ -39,4 +39,16 @@
{
super(test);
}
+
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml";
+ }
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java 2008-12-15 18:42:06 UTC (rev 82284)
@@ -40,4 +40,16 @@
super(test);
}
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml";
+ }
+
}
Modified: projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java 2008-12-15 18:42:06 UTC (rev 82284)
@@ -30,7 +30,7 @@
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
-public class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest
+public abstract class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest
{
public AspectFactoryWithDependencyTest(String name)
@@ -40,13 +40,52 @@
public void testIntercepted() throws Exception
{
- DependencyFactoryAspect.invoked = null;
- POJO pojo = (POJO)getBean("Bean");
- int ret = pojo.method(2);
- assertEquals(4, ret);
- POJO dep = (POJO)getBean("Dependency");
- assertSame(dep, DependencyFactoryAspect.invoked);
+ try
+ {
+ deploy(getFile0());
+
+ assertCannotFindBean("Bean");
+ assertCannotFindBean("Dependency");
+
+ try
+ {
+ deploy(getFile1());
+
+ POJO dependency = (POJO)getBean("Dependency");
+ DependencyFactoryAspect.invoked = null;
+ POJO pojo = (POJO)getBean("Bean");
+ int ret = pojo.method(2);
+ assertEquals(4, ret);
+ POJO dep = (POJO)getBean("Dependency");
+ assertSame(dep, DependencyFactoryAspect.invoked);
+ }
+ finally
+ {
+ undeploy(getFile1());
+ }
+ assertCannotFindBean("Bean");
+ assertCannotFindBean("Dependency");
+ }
+ finally
+ {
+ undeploy(getFile0());
+ }
}
-
+ private void assertCannotFindBean(String name)
+ {
+ try
+ {
+ Object o = getBean(name);
+ fail("Should not have found '" + name + "'");
+ }
+ catch (Exception expected)
+ {
+ }
+ }
+
+
+ protected abstract String getFile0();
+
+ protected abstract String getFile1();
}
\ No newline at end of file
Deleted: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -1,21 +0,0 @@
-<?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>
-
- <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
-
- <aspect factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
- <property name="pojo"><inject bean="Dependency"/></property>
- </aspect>
-
- <bind pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
- <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
- </bind>
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</aop>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,21 @@
+<?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>
+
+ <aspect factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+ <property name="pojo"><inject bean="Dependency"/></property>
+ </aspect>
+
+ <bind pointcut="execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..))">
+ <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
+ </bind>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+ <annotation>@org.jboss.test.microcontainer.beans.Annotation1</annotation>
+ </bean>
+
+</aop>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+ <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</aop>
Deleted: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="AspectManager" class="org.jboss.aop.AspectManager">
- <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
- </bean>
-
- <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
-
- <beanfactory name="Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
- <property name="pojo"><inject bean="Dependency"/></property>
- <install bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="install">
- <parameter><this/></parameter>
- </install>
- <uninstall bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="uninstall"/>
- </beanfactory>
-
- <bean name="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.aop.microcontainer.beans.Aspect">
- <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency</property>
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="name">org.jboss.test.microcontainer.beans.TestAspectWithDependency</property>
- <property name="factory">true</property>
- </bean>
-
- <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
- <property name="pointcut">execution(* org.jboss.test.microcontainer.beans.POJO->*(..))</property>
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="advices">
- <list>
- <inject bean="TestAspectBinding$1"/>
- </list>
- </property>
- </bean>
- <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency"/></property>
- <property name="aspectMethod">advice</property>
- <property name="binding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
- </bean>
-
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>
+
+ <beanfactory name="Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+ <property name="pojo"><inject bean="Dependency"/></property>
+ <install bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="install">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" method="uninstall"/>
+ </beanfactory>
+
+ <bean name="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" class="org.jboss.aop.microcontainer.beans.Aspect">
+ <property name="adviceBean">Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency</property>
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="name">org.jboss.test.microcontainer.beans.TestAspectWithDependency</property>
+ <property name="factory">true</property>
+ </bean>
+
+ <bean name="TestAspectBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
+ <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..))</property>
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="advices">
+ <list>
+ <inject bean="TestAspectBinding$1"/>
+ </list>
+ </property>
+ </bean>
+ <bean name="TestAspectBinding$1" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency"/></property>
+ <property name="aspectMethod">advice</property>
+ <property name="binding"><inject bean="TestAspectBinding" state="Instantiated"/></property>
+ </bean>
+
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+ <annotation>@org.jboss.test.microcontainer.beans.Annotation1</annotation>
+ </bean>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>
Deleted: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml 2008-12-15 16:44:50 UTC (rev 82283)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="AspectManager" class="org.jboss.aop.AspectManager">
- <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
- </bean>
-
- <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
-
- <aspect xmlns="urn:jboss:aop-beans:1.0" factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
- <property name="pojo"><inject bean="Dependency"/></property>
- </aspect>
-
- <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
- <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
- </bind>
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>
+
+ <aspect xmlns="urn:jboss:aop-beans:1.0" factory="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency">
+ <property name="pojo"><inject bean="Dependency"/></property>
+ </aspect>
+
+ <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..))">
+ <advice aspect="org.jboss.test.microcontainer.beans.AspectFactoryWithDependency" name="advice"/>
+ </bind>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO">
+ <annotation>@org.jboss.test.microcontainer.beans.Annotation1</annotation>
+ </bean>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml 2008-12-15 18:42:06 UTC (rev 82284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Dependency" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>
More information about the jboss-cvs-commits
mailing list