aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5
diff options
context:
space:
mode:
authoravasseur <avasseur>2005-05-04 14:57:21 +0000
committeravasseur <avasseur>2005-05-04 14:57:21 +0000
commit2679e77604bf50748ec715206258dd8a3586fb87 (patch)
tree3ea1965e734da2b1490aff3460ef37c8bd3fb05a /tests/java5
parent929c87018158604e439a24fbdfdb721d6a07fff7 (diff)
downloadaspectj-2679e77604bf50748ec715206258dd8a3586fb87.tar.gz
aspectj-2679e77604bf50748ec715206258dd8a3586fb87.zip
LTW modules + AntSpec to test LTW in the sandbox + code cleanup in my FIXME + fix in error handling when no debug info can be read from @Aj aspect (many files modified since refactored IMessageHanlder for LTW dontIgnore method)
Diffstat (limited to 'tests/java5')
-rw-r--r--tests/java5/ataspectj/ajc-ant.xml20
-rw-r--r--tests/java5/ataspectj/ataspectj/AllLTWTests.java46
-rw-r--r--tests/java5/ataspectj/ataspectj/BindingTest.java8
-rw-r--r--tests/java5/ataspectj/ataspectj/aop.xml25
4 files changed, 95 insertions, 4 deletions
diff --git a/tests/java5/ataspectj/ajc-ant.xml b/tests/java5/ataspectj/ajc-ant.xml
new file mode 100644
index 000000000..4aaf76d0d
--- /dev/null
+++ b/tests/java5/ataspectj/ajc-ant.xml
@@ -0,0 +1,20 @@
+<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
+<project name="foo" default="all">
+
+ <target name="compile:javac">
+ <!-- compile only javac compilable stuff -->
+ <javac destdir="${aj.sandbox}" classpathref="aj.path"
+ srcdir="${basedir}"
+ includes="ataspectj/*"
+ debug="true">
+ </javac>
+ </target>
+
+ <target name="all" depends="compile:javac">
+ <java fork="yes" classname="ataspectj.AllLTWTests" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+ <jvmarg value="-Daj5.def=ataspectj/aop.xml"/>
+ </java>
+ </target>
+</project> \ No newline at end of file
diff --git a/tests/java5/ataspectj/ataspectj/AllLTWTests.java b/tests/java5/ataspectj/ataspectj/AllLTWTests.java
new file mode 100644
index 000000000..eddd0cde2
--- /dev/null
+++ b/tests/java5/ataspectj/ataspectj/AllLTWTests.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Contributors.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Alexandre Vasseur initial implementation
+ *******************************************************************************/
+package ataspectj;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import test.loadtime5.AtAspectJTest;
+
+/**
+ * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ */
+public class AllLTWTests extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("All tests");
+
+ suite.addTestSuite(ataspectj.SingletonAspectBindingsTest.class);
+ suite.addTestSuite(ataspectj.CflowTest.class);
+ suite.addTestSuite(ataspectj.PointcutReferenceTest.class);
+ suite.addTestSuite(ataspectj.AfterXTest.class);
+ //FIXME AV - fix the pc grammar to support if for @AJ aspects
+ System.err.println("(AllTests: IfPointcutTest fails)");
+ //suite.addTestSuite(IfPointcutTest.class);
+ suite.addTestSuite(ataspectj.XXJoinPointTest.class);
+ suite.addTestSuite(ataspectj.PrecedenceTest.class);
+ suite.addTestSuite(ataspectj.BindingTest.class);
+ suite.addTestSuite(ataspectj.PerClauseTest.class);
+ suite.addTestSuite(AroundInlineMungerTest.class);
+
+ return suite;
+ }
+
+ public static void main(String[] args) {
+ TestHelper.runAndThrowOnFailure(suite());
+ }
+
+}
diff --git a/tests/java5/ataspectj/ataspectj/BindingTest.java b/tests/java5/ataspectj/ataspectj/BindingTest.java
index 342b8ebf0..62e1dfe13 100644
--- a/tests/java5/ataspectj/ataspectj/BindingTest.java
+++ b/tests/java5/ataspectj/ataspectj/BindingTest.java
@@ -82,12 +82,12 @@ public class BindingTest extends TestCase {
}
public void testAccessAspectState() {
- //TestAspect_1 aspect = (TestAspect_1) Aspects.aspectOf(TestAspect_1.class);
- //aspect.m_count = 0;
+ TestAspect_1 aspect = (TestAspect_1) Aspects.aspectOf(TestAspect_1.class);
+ aspect.m_count = 0;
int res = echo(3);
res += echo(3);
assertEquals(6, res);
- //assertEquals(2, aspect.m_count);
+ assertEquals(2, aspect.m_count);
}
public void testTryCatch() {
@@ -181,7 +181,7 @@ public class BindingTest extends TestCase {
@Around("call(int echo(int)) && withincode(void ataspectj.BindingTest.testAccessAspectState()) && args(i)")
public Object aaround7(int i, final ProceedingJoinPoint jp) throws Throwable {
- //m_count++;// what if inlined ?//FIXME
+ m_count++;// will be wrapped for inlining support
return jp.proceed();
}
diff --git a/tests/java5/ataspectj/ataspectj/aop.xml b/tests/java5/ataspectj/ataspectj/aop.xml
new file mode 100644
index 000000000..d76592f04
--- /dev/null
+++ b/tests/java5/ataspectj/ataspectj/aop.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<aspectj>
+ <aspects>
+ <!-- see here nested class with ".", "$" is accepted as well -->
+ <aspect name="ataspectj.SingletonAspectBindingsTest.TestAspect"/>
+ <aspect name="ataspectj.CflowTest.TestAspect"/>
+ <aspect name="ataspectj.PointcutReferenceTest.TestAspect"/>
+ <aspect name="ataspectj.AfterXTest.TestAspect"/>
+<!-- <aspect name="ataspectj.IfPointcutTest.TestAspect"/>-->
+ <aspect name="ataspectj.XXJoinPointTest.TestAspect"/>
+ <aspect name="ataspectj.PrecedenceTest.TestAspect_2"/>
+ <aspect name="ataspectj.PrecedenceTest.TestAspect_1"/>
+ <aspect name="ataspectj.PrecedenceTest.TestAspect_3"/>
+ <aspect name="ataspectj.PrecedenceTest.TestAspect_Order"/>
+
+ <aspect name="ataspectj.BindingTest.TestAspect_1"/>
+
+ <aspect name="ataspectj.PerClauseTest.TestAspectPerSingleton"/>
+ <aspect name="ataspectj.PerClauseTest.TestAspectPerTarget"/>
+ <aspect name="ataspectj.PerClauseTest.TestAspectPerCflow"/>
+ <aspect name="ataspectj.PerClauseTest.TestAspectPTW"/>
+
+ <aspect name="ataspectj.AroundInlineMungerTest.Open"/>
+ </aspects>
+</aspectj>