diff options
3 files changed, 190 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc1611/AllTestsAspectJ1611.java b/tests/src/org/aspectj/systemtest/ajc1611/AllTestsAspectJ1611.java index 6ae1215a5..d52d22ea7 100644 --- a/tests/src/org/aspectj/systemtest/ajc1611/AllTestsAspectJ1611.java +++ b/tests/src/org/aspectj/systemtest/ajc1611/AllTestsAspectJ1611.java @@ -19,6 +19,7 @@ public class AllTestsAspectJ1611 { TestSuite suite = new TestSuite("AspectJ 1.6.11 tests"); // $JUnit-BEGIN$ suite.addTest(Ajc1611Tests.suite()); + suite.addTest(NewFeatures.suite()); // $JUnit-END$ return suite; } diff --git a/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java b/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java new file mode 100644 index 000000000..5fd491f61 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc1611/NewFeatures.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2010 Lucierna + * 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: + * Abraham Nevado - initial API and implementation + *******************************************************************************/ +package org.aspectj.systemtest.ajc1611; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +public class NewFeatures extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testAddingRemoving() { + runTest("adding and removing"); + } + + public void testAddingRemoving2() { + runTest("adding and removing - 2"); + } + + public void testAddingRemoving3() { + runTest("adding and removing - 3"); + } + + public void testDeclareMinus() { + runTest("declare minus - 1"); + } + + public void testDeclareMinusItd() { + runTest("declare minus - itd"); + } + + public void testDeclareMinus2annos() { + runTest("declare minus - 2 annos"); + } + + public void testDeclareMinusmultifiles() { + runTest("declare minus - multifiles"); + } + + public void testDeclareMinusmultifiles2() { + runTest("declare minus - multifiles - 2"); + } + + public void testDeclareMinusmultifiles3() { + runTest("declare minus - multifiles - 3"); + } + + public void testBinaryWeaving() { + runTest("binary weaving"); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(NewFeatures.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml"); + } + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml b/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml new file mode 100644 index 000000000..d8bae42fb --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc1611/newfeatures-tests.xml @@ -0,0 +1,120 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<!-- AspectJ v1.6.11 Tests --> +<suite> + + <ajc-test dir="features1611/declareMinus" title="adding and removing - 3"> + <compile files="OnOffITD.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="'public int field2' of type 'OnOffITD' (OnOffITD.java) is annotated with @Anno field annotation from 'Foo' (OnOffITD.java:12)"/> + <message kind="weave" text="'public int field2' of type 'OnOffITD' (OnOffITD.java) has had @Anno field annotation removed by 'Foo' (OnOffITD.java:13)"/> + <message kind="weave" text="'public static int field' of type 'OnOffITD' (OnOffITD.java) is annotated with @Anno field annotation from 'Foo' (OnOffITD.java:9)"/> + <message kind="weave" text="'public static int field' of type 'OnOffITD' (OnOffITD.java) has had @Anno field annotation removed by 'Foo' (OnOffITD.java:8)"/> + <message kind="weave" text="Type 'OnOffITD' (OnOffITD.java) has intertyped field from 'B' (OnOffITD.java:'int OnOffITD.field')"/> + <message kind="weave" text="Type 'OnOffITD' (OnOffITD.java) has intertyped field from 'B' (OnOffITD.java:'int OnOffITD.field2')"/> + </compile> + <run class="OnOffITD"> + <stdout> + <line text="field annotated? no"/> + <line text="field2 annotated? no"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="adding and removing"> + <compile files="OnOff.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:12)"/> + <message kind="weave" text="'public int field2' of type 'OnOff' (OnOff.java) has had @Anno field annotation removed by 'Foo' (OnOff.java:13)"/> + <message kind="weave" text="'public static int field' of type 'OnOff' (OnOff.java) is annotated with @Anno field annotation from 'Foo' (OnOff.java:9)"/> + <message kind="weave" text="'public static int field' of type 'OnOff' (OnOff.java) has had @Anno field annotation removed by 'Foo' (OnOff.java:8)"/> + </compile> + <run class="OnOff"> + <stdout> + <line text="field annotated? no"/> + <line text="field2 annotated? no"/> + </stdout> + </run> + </ajc-test> + + + <ajc-test dir="features1611/declareMinus" title="adding and removing - 2"> + <compile files="OnOff2.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/> + <message kind="weave" text="'public int field2' of type 'OnOff2' (OnOff2.java) has had @Anno field annotation removed by 'Foo' (OnOff2.java:7)"/> + <message kind="weave" text="'public static int field' of type 'OnOff2' (OnOff2.java) is annotated with @Anno field annotation from 'Foo' (OnOff2.java:8)"/> + <message kind="weave" text="'public static int field' of type 'OnOff2' (OnOff2.java) has had @Anno field annotation removed by 'Foo' (OnOff2.java:7)"/> + </compile> + <run class="OnOff2"> + <stdout> + <line text="field annotated? no"/> + <line text="field2 annotated? no"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="declare minus - 1"> + <compile files="Code.java" options="-1.5"/> + <run class="Code"> <stdout> + <line text="no annotation"/> + </stdout></run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="declare minus - itd"> + <compile files="Code2.java" options="-1.5"/> + <run class="Code2"> + <stdout> + <line text="no annotation"/> + </stdout></run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="declare minus - 2 annos"> + <compile files="Code3.java" options="-1.5"/> + <run class="Code3"> + <stdout> + <line text="no Anno"/> + <line text="has AnnoB"/> + </stdout></run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles"> + <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java aspectjtest/MyEntity.java" options="-1.5"/> + <run class="aspectjtest.HelloTest"> + <stdout> + <line text="1"/> + <line text="interface aspectjtest.AnnotationB"/> + </stdout></run> + </ajc-test> + + <!-- different ordering --> + <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 2"> + <compile files="aspectjtest/MyEntity.java aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/ExampleItd.aj aspectjtest/HelloTest.java" options="-1.5"/> + <run class="aspectjtest.HelloTest"> + <stdout> + <line text="1"/> + <line text="interface aspectjtest.AnnotationB"/> + </stdout></run> + </ajc-test> + + <!-- different ordering --> + <ajc-test dir="features1611/declareMinus" title="declare minus - multifiles - 3"> + <compile files="aspectjtest/ExampleItd.aj aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" options="-1.5"/> + <run class="aspectjtest.HelloTest"> + <stdout> + <line text="1"/> + <line text="interface aspectjtest.AnnotationB"/> + </stdout></run> + </ajc-test> + + <ajc-test dir="features1611/declareMinus" title="binary weaving"> + <compile files="aspectjtest/AnnotationA.java aspectjtest/AnnotationB.java aspectjtest/MyEntity.java aspectjtest/HelloTest.java" outjar="code.jar" options="-1.5"/> + <compile files="aspectjtest/ExampleItd.aj" inpath="code.jar" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="'private String myField [RuntimeVisibleAnnotations]' of type 'aspectjtest.MyEntity' (MyEntity.java) has had @AnnotationA field annotation removed by"/> + <message kind="weave" text="'private String myField [RuntimeVisibleAnnotations]' of type 'aspectjtest.MyEntity' (MyEntity.java) is annotated with @AnnotationB field"/> + </compile> + <run class="aspectjtest.HelloTest"> + <stdout> + <line text="1"/> + <line text="interface aspectjtest.AnnotationB"/> + </stdout></run> + </ajc-test> + +</suite> |