From: aclement Date: Wed, 13 Aug 2008 16:12:26 +0000 (+0000) Subject: 242797: a testcase X-Git-Tag: V162DEV_M1~144 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff47623a811fc7747e7ca9ea87e003457fb511ba;p=aspectj.git 242797: a testcase --- diff --git a/tests/bugs162/pr242797/case1/CMEFinder.java b/tests/bugs162/pr242797/case1/CMEFinder.java new file mode 100644 index 000000000..a7bb5f4b1 --- /dev/null +++ b/tests/bugs162/pr242797/case1/CMEFinder.java @@ -0,0 +1,9 @@ +import java.util.List; + +public class CMEFinder extends OnetFinder{ +} + +class CMEStub {} +class PartitionedCME implements Partitioned{ } +class LocalizedCME implements Localized {} +class ContentModelElement extends OnetElement {} \ No newline at end of file diff --git a/tests/bugs162/pr242797/case1/ClassUtils.java b/tests/bugs162/pr242797/case1/ClassUtils.java new file mode 100644 index 000000000..496255d5b --- /dev/null +++ b/tests/bugs162/pr242797/case1/ClassUtils.java @@ -0,0 +1,4 @@ + +public class ClassUtils { + public static Class guessGenericType(Class c) { return c; } +} diff --git a/tests/bugs162/pr242797/case1/Finder.java b/tests/bugs162/pr242797/case1/Finder.java new file mode 100644 index 000000000..68021e550 --- /dev/null +++ b/tests/bugs162/pr242797/case1/Finder.java @@ -0,0 +1,2 @@ +public interface Finder { +} diff --git a/tests/bugs162/pr242797/case1/H2Deployment.java b/tests/bugs162/pr242797/case1/H2Deployment.java new file mode 100644 index 000000000..6b80df488 --- /dev/null +++ b/tests/bugs162/pr242797/case1/H2Deployment.java @@ -0,0 +1,5 @@ +import java.util.List; +public class H2Deployment { + public static H2Deployment instance() { return new H2Deployment(); } + List getPartitionOrder(Class c) { return null;} +} diff --git a/tests/bugs162/pr242797/case1/Localized.java b/tests/bugs162/pr242797/case1/Localized.java new file mode 100644 index 000000000..ba6076cbd --- /dev/null +++ b/tests/bugs162/pr242797/case1/Localized.java @@ -0,0 +1 @@ +public interface Localized {} diff --git a/tests/bugs162/pr242797/case1/LocalizedFinder.java b/tests/bugs162/pr242797/case1/LocalizedFinder.java new file mode 100644 index 000000000..983cbd9a8 --- /dev/null +++ b/tests/bugs162/pr242797/case1/LocalizedFinder.java @@ -0,0 +1,2 @@ +public interface LocalizedFinder extends Finder { +} diff --git a/tests/bugs162/pr242797/case1/OnetElement.java b/tests/bugs162/pr242797/case1/OnetElement.java new file mode 100644 index 000000000..7091a5461 --- /dev/null +++ b/tests/bugs162/pr242797/case1/OnetElement.java @@ -0,0 +1,3 @@ +public class OnetElement implements Partitioned,Localized { + +} diff --git a/tests/bugs162/pr242797/case1/OnetFinder.java b/tests/bugs162/pr242797/case1/OnetFinder.java new file mode 100644 index 000000000..ddcbba97b --- /dev/null +++ b/tests/bugs162/pr242797/case1/OnetFinder.java @@ -0,0 +1,2 @@ +public abstract class OnetFinder, L extends Localized, O extends OnetElement> implements Finder,PartitionedFinder,LocalizedFinder { +} diff --git a/tests/bugs162/pr242797/case1/Partitioned.java b/tests/bugs162/pr242797/case1/Partitioned.java new file mode 100644 index 000000000..fba526c62 --- /dev/null +++ b/tests/bugs162/pr242797/case1/Partitioned.java @@ -0,0 +1,9 @@ +public interface Partitioned { + public String getPartitionId(); +} + +aspect PartitionedI { + public String Partitioned.getPartitionId() { + return null; + } +} \ No newline at end of file diff --git a/tests/bugs162/pr242797/case1/PartitionedFinder.java b/tests/bugs162/pr242797/case1/PartitionedFinder.java new file mode 100644 index 000000000..02ad16bcb --- /dev/null +++ b/tests/bugs162/pr242797/case1/PartitionedFinder.java @@ -0,0 +1,34 @@ +import java.util.List; + +public interface PartitionedFinder

> extends Finder { +// public List bestLanguageMatch(List list, List languageOrder); + public > List bestPartitionMatch(List list, List partitionOrder); +} + +aspect PartitionedFinderAspect { + + public Class PartitionedFinder

.getPartitionedType(){ + return ClassUtils.guessGenericType(getClass()); + } + + public List PartitionedFinder

.getPartitionOrder(){ + return H2Deployment.instance().getPartitionOrder(getPartitionedType()); + } + + public > List PartitionedFinder

.bestPartitionMatch(List list, List partitionOrder){ + return new OrderComparator(partitionOrder){ + + @Override + public String getOrdering(T partitioned){ + return partitioned.getPartitionId(); + } + + }.bestMatch(list); + } +} + +class OrderComparator { + OrderComparator(List ls) {} + public String getOrdering(A a) {return "";} + List bestMatch(List l) {return null;} +} diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index 1b278cb6c..0871d5b86 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 + public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); } // public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");} // public void testParamAnnoInner_pr241861() { runTest("param annotation inner class"); } public void testAnnotationDecp_pr239441() { runTest("annotation decp"); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index dc9d4bf8c..1fc19bbbf 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -3,13 +3,18 @@ - + + + + + + - +