[jboss-cvs] JBossAS SVN: r58287 - in projects/microcontainer/trunk/aop-mc-int/src: resources/tests/org/jboss/test/microcontainer/test tests/org/jboss/test/microcontainer/support tests/org/jboss/test/microcontainer/test
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Nov 12 19:15:16 EST 2006
Author: kabir.khan at jboss.com
Date: 2006-11-12 19:15:11 -0500 (Sun, 12 Nov 2006)
New Revision: 58287
Added:
projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/BeanCallingMethodInCtor.java
projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.java
Log:
Add test trying to reproduce http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985286#3985286
Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml 2006-11-12 22:39:20 UTC (rev 58286)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml 2006-11-13 00:15:11 UTC (rev 58287)
@@ -0,0 +1,17 @@
+<?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="Bean" class="org.jboss.test.microcontainer.support.BeanCallingMethodInCtorTestCase"/>
+
+ <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
+ name="InterceptedAdvice"
+ class="org.jboss.test.microcontainer.support.CalledInterceptor"
+ pointcut="execution(* org.jboss.test.microcontainer.support.BeanCallingMethodInCtorTestCase->*(..))">
+ </aop:aspect>
+
+</deployment>
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/BeanCallingMethodInCtor.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/BeanCallingMethodInCtor.java 2006-11-12 22:39:20 UTC (rev 58286)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/support/BeanCallingMethodInCtor.java 2006-11-13 00:15:11 UTC (rev 58287)
@@ -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.support;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanCallingMethodInCtor
+{
+ public BeanCallingMethodInCtor()
+ {
+ publicMethod();
+ privateMethod();
+ }
+
+ public void publicMethod()
+ {
+
+ }
+
+ private void privateMethod()
+ {
+
+ }
+}
Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.java 2006-11-12 22:39:20 UTC (rev 58286)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.java 2006-11-13 00:15:11 UTC (rev 58287)
@@ -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.test;
+
+import org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.support.BeanCallingMethodInCtor;
+import org.jboss.test.microcontainer.support.CalledInterceptor;
+
+import junit.framework.Test;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanCallingMethodInCtorTestCase extends AOPMicrocontainerTest
+{
+ public static Test suite()
+ {
+ return suite(InterceptedTestCase.class);
+ }
+
+ public BeanCallingMethodInCtorTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testIntercepted()
+ {
+ BeanCallingMethodInCtor bean = (BeanCallingMethodInCtor) getBean("Bean");
+ CalledInterceptor.intercepted = false;
+ bean.publicMethod();
+ assertTrue("Should have invoked the CalledInterceptor", CalledInterceptor.intercepted);
+ }
+}
More information about the jboss-cvs-commits
mailing list