aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2009-10-31 01:25:10 +0000
committeraclement <aclement>2009-10-31 01:25:10 +0000
commitabd03ff1cffea69c1b7ac196e5f10ff84d3ae0bd (patch)
tree29fc084f8f0f2473a369dc8dbb895d432cd87ad6 /tests
parent9c4df09945911f1ccec3d5413d11d522d3f47fe5 (diff)
downloadaspectj-abd03ff1cffea69c1b7ac196e5f10ff84d3ae0bd.tar.gz
aspectj-abd03ff1cffea69c1b7ac196e5f10ff84d3ae0bd.zip
overweaving tests
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java54
-rw-r--r--tests/src/org/aspectj/systemtest/ajc167/overweaving.xml44
2 files changed, 98 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java b/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
new file mode 100644
index 000000000..2f6bd8531
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc167;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ *
+ * @author Andy Clement
+ */
+public class OverweavingTests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testSimple() {
+ runTest("simple");
+ }
+
+ /**
+ * Now an aspect used on the original weave is mentioned in the aop.xml - we shouldn't apply it again!
+ */
+ public void testMessy() {
+ runTest("messy");
+ }
+
+ /**
+ * Testing a shadow munger created to support cflow
+ */
+ public void testCflow() {
+ runTest("cflow");
+ }
+
+ // --
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(OverweavingTests.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc167/overweaving.xml");
+ }
+
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml b/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml
new file mode 100644
index 000000000..84bed6486
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc167/overweaving.xml
@@ -0,0 +1,44 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="features167/overweaving" title="simple">
+ <compile files="A.aj C.java" options="-1.5"/>
+ <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
+ <run class="com.andy.C" ltw="aop.xml">
+ <stdout>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectA&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.run())"/>
+ <line text="hello andy"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="features167/overweaving/messy" title="messy">
+ <compile files="A.aj C.java" options="-1.5"/>
+ <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
+ <run class="com.andy.C" ltw="aop.xml">
+ <stdout>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectA&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.run())"/>
+ <line text="hello andy"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="features167/overweaving/cflow" title="cflow">
+ <compile files="A.aj C.java" options="-1.5"/>
+ <compile files="X.aj" options="-1.5 -Xlint:ignore"/>
+ <run class="com.andy.C" ltw="aop.xml">
+ <stdout>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectA&gt;&gt;execution(void com.andy.C.main(String[]))"/>
+ <line text="AspectX&gt;&gt;execution(void com.andy.C.run())"/>
+ <line text="hello andy"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+</suite> \ No newline at end of file