From 3189369baa42e562541ba2c3f4c2f6619f1b532f Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 24 Apr 2008 04:07:25 +0000 Subject: [PATCH] 226567: test and fix - generic return types and overridden methods --- tests/bugs161/pr226567/Bar.java | 9 ++++++ tests/bugs161/pr226567/BarAspect.aj | 9 ++++++ tests/bugs161/pr226567/Foo.java | 11 +++++++ tests/bugs161/pr226567/Main.java | 12 +++++++ .../org/aspectj/systemtest/AllTests16.java | 2 ++ .../systemtest/ajc160/Ajc160Tests.java | 3 ++ .../org/aspectj/systemtest/ajc160/ajc160.xml | 4 +++ .../systemtest/ajc161/Ajc161Tests.java | 32 +++++++++++++++++++ .../systemtest/ajc161/AllTestsAspectJ161.java | 25 +++++++++++++++ .../org/aspectj/systemtest/ajc161/ajc161.xml | 11 +++++++ 10 files changed, 118 insertions(+) create mode 100644 tests/bugs161/pr226567/Bar.java create mode 100644 tests/bugs161/pr226567/BarAspect.aj create mode 100644 tests/bugs161/pr226567/Foo.java create mode 100644 tests/bugs161/pr226567/Main.java create mode 100644 tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java create mode 100644 tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java create mode 100644 tests/src/org/aspectj/systemtest/ajc161/ajc161.xml diff --git a/tests/bugs161/pr226567/Bar.java b/tests/bugs161/pr226567/Bar.java new file mode 100644 index 000000000..c4a0316e1 --- /dev/null +++ b/tests/bugs161/pr226567/Bar.java @@ -0,0 +1,9 @@ +package b; + +import java.util.Collection; + + +public interface Bar { + + public Collection getFoos(); +} \ No newline at end of file diff --git a/tests/bugs161/pr226567/BarAspect.aj b/tests/bugs161/pr226567/BarAspect.aj new file mode 100644 index 000000000..1c62a4867 --- /dev/null +++ b/tests/bugs161/pr226567/BarAspect.aj @@ -0,0 +1,9 @@ +package a; + +import b.Bar; +import b.Foo; + +public aspect BarAspect { + + declare parents : Foo implements Bar; +} \ No newline at end of file diff --git a/tests/bugs161/pr226567/Foo.java b/tests/bugs161/pr226567/Foo.java new file mode 100644 index 000000000..db8076aab --- /dev/null +++ b/tests/bugs161/pr226567/Foo.java @@ -0,0 +1,11 @@ +package b; + +import java.util.ArrayList; +import java.util.Collection; + +public class Foo { + + public Collection getFoos() { + return new ArrayList() {{ add(new Foo()); }}; + } +} \ No newline at end of file diff --git a/tests/bugs161/pr226567/Main.java b/tests/bugs161/pr226567/Main.java new file mode 100644 index 000000000..51eab3381 --- /dev/null +++ b/tests/bugs161/pr226567/Main.java @@ -0,0 +1,12 @@ +package c; + +import b.Bar; +import b.Foo; + +public class Main { + + public static void main(String [] args) { + Foo foo = new Foo(); + System.out.println(foo instanceof Bar); + } +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/AllTests16.java b/tests/src/org/aspectj/systemtest/AllTests16.java index d23413e83..a698fba28 100644 --- a/tests/src/org/aspectj/systemtest/AllTests16.java +++ b/tests/src/org/aspectj/systemtest/AllTests16.java @@ -7,6 +7,7 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.aspectj.systemtest.ajc160.AllTestsAspectJ160; +import org.aspectj.systemtest.ajc161.AllTestsAspectJ161; public class AllTests16 { @@ -14,6 +15,7 @@ public class AllTests16 { TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.6"); //$JUnit-BEGIN$ suite.addTest(AllTestsAspectJ160.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour + suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour suite.addTest(AllTests15.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 index 7d20871db..6c993299f 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java @@ -22,6 +22,9 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.0rc1 + // public void testPipelineCompilationGenericReturnType_pr226567() { + // runTest("pipeline compilation and generic return type"); + //} public void testPipelineCompilationAnonymous_pr225916() { runTest("pipeline compilation and anonymous type"); } diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml index eb8f28b06..809d307d0 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml +++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml @@ -3,6 +3,10 @@ + + + + diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java new file mode 100644 index 000000000..d9321b6aa --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * 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.ajc161; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + // AspectJ1.6.0rc1 + public void testPipelineCompilationGenericReturnType_pr226567() { runTest("pipeline compilation and generic return type"); } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc161Tests.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc161/ajc161.xml"); + } + +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java b/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java new file mode 100644 index 000000000..5ce598fa8 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc161/AllTestsAspectJ161.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.ajc161; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTestsAspectJ161 { + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.6.1 tests"); + //$JUnit-BEGIN$ + suite.addTest(Ajc161Tests.suite()); + //$JUnit-END$ + return suite; + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml new file mode 100644 index 000000000..77b0b60af --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file -- 2.39.5