[jboss-cvs] JBossAS SVN: r87637 - in projects/aop/branches/Branch_2_1/aop/src: test/java/org/jboss/test/aop/constructortarget and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 21 10:21:00 EDT 2009
Author: flavia.rainone at jboss.com
Date: 2009-04-21 10:21:00 -0400 (Tue, 21 Apr 2009)
New Revision: 87637
Added:
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass1.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass2.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass3.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/POJOTarget2.java
Modified:
projects/aop/branches/Branch_2_1/aop/src/resources/test/constructortarget/jboss-aop.xml
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/AspectTarget.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ConstructorTargetTester.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructionSyncThread.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByConstructorSyncThread.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByMethodSyncThread.java
projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorExecutionSyncThread.java
Log:
[JBAOP-567] Added tests for non-declared default constructor interception on constructortarget. Plus, removed the declaration of default constructors for constructor call and construction interception on rebuildingchain tests. Finally, removed TODOs associated with JBAOP-567, added a TODO associated with JBAOP-722, and added a TODO associated with JBAOP-718.
Modified: projects/aop/branches/Branch_2_1/aop/src/resources/test/constructortarget/jboss-aop.xml
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/resources/test/constructortarget/jboss-aop.xml 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/resources/test/constructortarget/jboss-aop.xml 2009-04-21 14:21:00 UTC (rev 87637)
@@ -3,7 +3,7 @@
<aspect class="org.jboss.test.aop.constructortarget.AspectTarget"/>
- <bind pointcut="execution(org.jboss.test.aop.constructortarget.POJOTarget->new(java.lang.String))">
+ <bind pointcut="execution(org.jboss.test.aop.constructortarget.*POJOTarget*->new(..))">
<advice aspect="org.jboss.test.aop.constructortarget.AspectTarget" name="constructor"/>
</bind>
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/AspectTarget.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/AspectTarget.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/AspectTarget.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -48,5 +48,4 @@
return o;
}
-
-}
+}
\ No newline at end of file
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ConstructorTargetTester.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ConstructorTargetTester.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ConstructorTargetTester.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -21,12 +21,12 @@
*/
package org.jboss.test.aop.constructortarget;
-import org.jboss.test.aop.AOPTestWithSetup;
-
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
+import org.jboss.test.aop.AOPTestWithSetup;
+
/**
*
*
@@ -55,20 +55,56 @@
// Public -------------------------------------------------------
- public void testConstruction()
+ public void setup() throws Exception
{
- try
- {
- System.out.println("RUNNING TEST ConstructorTargetTester");
- POJOTarget target = new POJOTarget("testing...");
- assertTrue(AspectTarget.intercepted);
- }
- catch(Exception e)
- {
- System.out.println("TEST CAST EXCEPTION!!");
- fail("Target object isnt correct!");
- }
-
+ super.setUp();
+ AspectTarget.intercepted = false;
}
-}
-
+
+ public void testConstruction1()
+ {
+ System.out.println("RUNNING TEST ConstructorTargetTester");
+ POJOTarget target = new POJOTarget("testing...");
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ public void testConstruction2()
+ {
+ POJOTarget2 target = new POJOTarget2();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ public void testConstruction3()
+ {
+ ExternalClass1.POJOTarget target = new ExternalClass1.POJOTarget();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ public void testConstruction4()
+ {
+ ExternalClass2.POJOTarget target = new ExternalClass2.POJOTarget();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ public void testConstruction5()
+ {
+ ExternalClass1 external = new ExternalClass1();
+ ExternalClass1.POJOTarget target = external.createTarget();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ public void testConstruction6()
+ {
+ ExternalClass2 external = new ExternalClass2();
+ ExternalClass2.POJOTarget target = external.createTarget();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }
+
+ // TODO JBAOP-718
+ /*public void testConstruction7()
+ {
+ ExternalClass3 external = new ExternalClass3();
+ external.createTarget();
+ assertTrue("Target object isnt correct!", AspectTarget.intercepted);
+ }*/
+}
\ No newline at end of file
Added: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass1.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass1.java (rev 0)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass1.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -0,0 +1,43 @@
+/*
+ * 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.constructortarget;
+
+/**
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ExternalClass1
+{
+
+ public POJOTarget createTarget()
+ {
+ return new POJOTarget();
+ }
+
+ public static class POJOTarget
+ {
+ public POJOTarget()
+ {
+
+ }
+ }
+}
\ No newline at end of file
Added: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass2.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass2.java (rev 0)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass2.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -0,0 +1,39 @@
+/*
+ * 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.constructortarget;
+
+/**
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ExternalClass2
+{
+
+ public POJOTarget createTarget()
+ {
+ return new POJOTarget();
+ }
+
+ public static class POJOTarget
+ {
+ }
+}
\ No newline at end of file
Added: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass3.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass3.java (rev 0)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/ExternalClass3.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -0,0 +1,37 @@
+/*
+ * 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.constructortarget;
+
+/**
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ExternalClass3
+{
+
+ public void createTarget()
+ {
+ new POJOTarget();
+ }
+
+ private static class POJOTarget {}
+}
\ No newline at end of file
Added: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/POJOTarget2.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/POJOTarget2.java (rev 0)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/constructortarget/POJOTarget2.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -0,0 +1,31 @@
+/*
+ * 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.constructortarget;
+
+/**
+ * Tests POJO with not declared defeault constructor.
+ *
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class POJOTarget2
+{
+}
\ No newline at end of file
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructionSyncThread.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructionSyncThread.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructionSyncThread.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -37,9 +37,5 @@
new Pojo();
}
- private static class Pojo
- {
- // TODO JBAOP-567 Remove this constructor.
- public Pojo() {}
- }
+ private static class Pojo {}
}
\ No newline at end of file
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByConstructorSyncThread.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByConstructorSyncThread.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByConstructorSyncThread.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -45,9 +45,5 @@
}
}
- private static class Pojo2
- {
- // TODO JBAOP-567 Remove this constructor.
- public Pojo2(){}
- }
+ private static class Pojo2 {}
}
\ No newline at end of file
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByMethodSyncThread.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByMethodSyncThread.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorCallByMethodSyncThread.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -37,9 +37,5 @@
new Pojo();
}
- private static class Pojo
- {
- // TODO JBAOP-567 Remove this constructor.
- public Pojo(){}
- }
+ private static class Pojo {}
}
\ No newline at end of file
Modified: projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorExecutionSyncThread.java
===================================================================
--- projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorExecutionSyncThread.java 2009-04-21 14:02:43 UTC (rev 87636)
+++ projects/aop/branches/Branch_2_1/aop/src/test/java/org/jboss/test/aop/rebuildingchain/ConstructorExecutionSyncThread.java 2009-04-21 14:21:00 UTC (rev 87637)
@@ -38,7 +38,7 @@
private static class Pojo
{
- // TODO JBAOP-567 Remove this constructor.
+ // TODO JBAOP-722 Remove this constructor.
public Pojo() {}
}
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list