]> source.dussan.org Git - aspectj.git/commitdiff
overweaving tests
authoraclement <aclement>
Sat, 31 Oct 2009 01:25:10 +0000 (01:25 +0000)
committeraclement <aclement>
Sat, 31 Oct 2009 01:25:10 +0000 (01:25 +0000)
tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc167/overweaving.xml [new file with mode: 0644]

diff --git a/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java b/tests/src/org/aspectj/systemtest/ajc167/OverweavingTests.java
new file mode 100644 (file)
index 0000000..2f6bd85
--- /dev/null
@@ -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 (file)
index 0000000..84bed64
--- /dev/null
@@ -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