[jboss-cvs] JBossAS SVN: r64140 - in projects/aop/trunk/aop/src: resources/test/regression and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jul 19 10:54:16 EDT 2007
Author: kabir.khan at jboss.com
Date: 2007-07-19 10:54:16 -0400 (Thu, 19 Jul 2007)
New Revision: 64140
Added:
projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/
projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/InstanceDomainTestCase.java
projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/POJO.java
Modified:
projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java
projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml
Log:
[JBAOP-442] nstanceAdvisor domains incorrectly get added to AspectManager.subDomainsByClass
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java 2007-07-19 14:21:54 UTC (rev 64139)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/GeneratedAdvisorInstrumentor.java 2007-07-19 14:54:16 UTC (rev 64140)
@@ -361,7 +361,7 @@
String initBody =
"{" +
" String domainName = org.jboss.aop.Domain.getDomainName(" + DECLARING_CLASS + ", $2);" +
- " " + DOMAIN + "= new org.jboss.aop.GeneratedAdvisorDomain($1, domainName, " + DECLARING_CLASS + ", false); " +
+ " " + DOMAIN + "= new org.jboss.aop.GeneratedAdvisorDomain($1, domainName, " + DECLARING_CLASS + ", $2); " +
" ((org.jboss.aop.Domain)" + DOMAIN + ").setInheritsBindings(true); " +
" super.initialise(" + DECLARING_CLASS + ", " + DOMAIN + ");" +
"}";
Modified: projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml 2007-07-19 14:21:54 UTC (rev 64139)
+++ projects/aop/trunk/aop/src/resources/test/regression/jboss-aop.xml 2007-07-19 14:54:16 UTC (rev 64140)
@@ -168,5 +168,7 @@
<bind pointcut="all(org.jboss.test.aop.regression.jbaop398nosuchfield.POJO)">
<interceptor class="org.jboss.test.aop.regression.jbaop398nosuchfield.SimpleInterceptor" scope="PER_VM" />
- </bind>
+ </bind>
+
+ <prepare expr="all(org.jboss.test.aop.regression.jbaop442instancedomain.POJO)"/>
</aop>
\ No newline at end of file
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/InstanceDomainTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/InstanceDomainTestCase.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/InstanceDomainTestCase.java 2007-07-19 14:54:16 UTC (rev 64140)
@@ -0,0 +1,66 @@
+/*
+* 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.regression.jbaop442instancedomain;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.InstanceAdvised;
+import org.jboss.aop.InstanceAdvisor;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InstanceDomainTestCase extends TestCase
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("InstanceDomainTestCase");
+ suite.addTestSuite(InstanceDomainTestCase.class);
+ return suite;
+ }
+
+ public InstanceDomainTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testClassAdvisorAndNotInstanceAdvisor()
+ {
+ POJO pojo = new POJO();
+ InstanceAdvisor ia = ((InstanceAdvised)pojo)._getInstanceAdvisor();
+
+ Advisor advisor = AspectManager.instance().getAdvisor(POJO.class);
+ assertFalse(advisor instanceof InstanceAdvisor);
+ }
+}
Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/POJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/POJO.java (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/regression/jbaop442instancedomain/POJO.java 2007-07-19 14:54:16 UTC (rev 64140)
@@ -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.aop.regression.jbaop442instancedomain;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+{
+
+}
More information about the jboss-cvs-commits
mailing list