diff options
author | aclement <aclement> | 2006-11-29 10:50:51 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-11-29 10:50:51 +0000 |
commit | 145f2240e5706f4012cb1decf944023a12de48a8 (patch) | |
tree | 73e17e0acacd873259c09e0efd29f50e08da410a /tests | |
parent | 1dab3546e8f0e4dc317557563834db0bd6fac661 (diff) | |
download | aspectj-145f2240e5706f4012cb1decf944023a12de48a8.tar.gz aspectj-145f2240e5706f4012cb1decf944023a12de48a8.zip |
Test and fix for 165885: generic fields and pipelining problem
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs160/pr165885/Abstract.java | 7 | ||||
-rw-r--r-- | tests/bugs160/pr165885/Aspect.java | 6 | ||||
-rw-r--r-- | tests/bugs160/pr165885/Concrete.java | 11 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/AllTests16.java | 21 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java | 37 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java | 25 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc160/ajc160.xml | 16 | ||||
-rw-r--r-- | tests/testsrc/org/aspectj/tests/TestsModuleTests.java | 5 |
8 files changed, 126 insertions, 2 deletions
diff --git a/tests/bugs160/pr165885/Abstract.java b/tests/bugs160/pr165885/Abstract.java new file mode 100644 index 000000000..b2de830c4 --- /dev/null +++ b/tests/bugs160/pr165885/Abstract.java @@ -0,0 +1,7 @@ +package package1; + +public abstract class Abstract<T> { + + protected Object field; + +} diff --git a/tests/bugs160/pr165885/Aspect.java b/tests/bugs160/pr165885/Aspect.java new file mode 100644 index 000000000..127a8f271 --- /dev/null +++ b/tests/bugs160/pr165885/Aspect.java @@ -0,0 +1,6 @@ +public aspect Aspect { + + declare warning : set(* *) : "foo"; + + +} diff --git a/tests/bugs160/pr165885/Concrete.java b/tests/bugs160/pr165885/Concrete.java new file mode 100644 index 000000000..520d75a75 --- /dev/null +++ b/tests/bugs160/pr165885/Concrete.java @@ -0,0 +1,11 @@ +package bug.package2; + +import package1.Abstract; + +public class Concrete extends Abstract<Object> { + + public void method() { + field = null; + } + +} diff --git a/tests/src/org/aspectj/systemtest/AllTests16.java b/tests/src/org/aspectj/systemtest/AllTests16.java new file mode 100644 index 000000000..d187b5777 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/AllTests16.java @@ -0,0 +1,21 @@ +/* + * Created on 19-01-2005 + */ +package org.aspectj.systemtest; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.aspectj.systemtest.ajc160.AllTestsAspectJ160; + +public class AllTests16 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.6"); + //$JUnit-BEGIN$ + suite.addTest(AllTests15.suite()); + suite.addTest(AllTestsAspectJ160.suite()); + //$JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java new file mode 100644 index 000000000..5b22d1717 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2006 IBM + * 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.ajc160; + +import java.io.File; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +import junit.framework.Test; + +/** + * These are tests for AspectJ1.6 - they do not require a 1.6 VM. + */ +public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testGenericFieldNPE_pr165885() { runTest("generic field npe");} + + + ///////////////////////////////////////// + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc160Tests.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc160/ajc160.xml"); + } + + +}
\ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java b/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java new file mode 100644 index 000000000..1e93dca56 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc160/AllTestsAspectJ160.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2006 IBM + * 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.ajc160; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ160 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.6.0 tests"); + //$JUnit-BEGIN$ + suite.addTest(Ajc160Tests.suite()); + //$JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml new file mode 100644 index 000000000..2e12408fa --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml @@ -0,0 +1,16 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<!-- AspectJ v1.6.0 Tests --> +<suite> + + <!-- first section - dont need a 1.6 vm but fixed in the 1.6 branch of AspectJ --> + <ajc-test dir="bugs160/pr165885" title="generic field npe"> + <compile files="Concrete.java,Abstract.java,Aspect.java" options="-1.5"> + <message kind="warning" line="8" text="foo"/> + </compile> + </ajc-test> + + + <!-- second section - need a 1.6 vm --> + +</suite>
\ No newline at end of file diff --git a/tests/testsrc/org/aspectj/tests/TestsModuleTests.java b/tests/testsrc/org/aspectj/tests/TestsModuleTests.java index ddb62dd3e..48a190083 100644 --- a/tests/testsrc/org/aspectj/tests/TestsModuleTests.java +++ b/tests/testsrc/org/aspectj/tests/TestsModuleTests.java @@ -17,7 +17,7 @@ import junit.framework.TestSuite; import org.aspectj.systemtest.AllTests; import org.aspectj.systemtest.AllTests14; -import org.aspectj.systemtest.AllTests15; +import org.aspectj.systemtest.AllTests16; import org.aspectj.util.LangUtil; public class TestsModuleTests extends TestCase { @@ -27,7 +27,8 @@ public class TestsModuleTests extends TestCase { TestSuite suite = new TestSuite(name); // compiler tests, wrapped for JUnit if (LangUtil.is15VMOrGreater()) { - suite.addTest(AllTests15.suite()); +// suite.addTest(AllTests15.suite()); + suite.addTest(AllTests16.suite()); // there are currently (28/11/06) no tests specific to a 1.6 vm - so we can do this } else if (LangUtil.is14VMOrGreater()) { System.err.println("Skipping tests for 1.5"); //suite.addTest(TestUtil.skipTest("for 1.5")); |