From 82692416fb2dbae3d95a05c495e4917cb09ea0db Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 6 Mar 2009 18:57:46 +0000 Subject: [PATCH] declaremixin --- .../systemtest/ajc164/DeclareMixinTests.java | 30 ++++++++++++ .../systemtest/ajc164/declareMixin.xml | 47 ++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/tests/src/org/aspectj/systemtest/ajc164/DeclareMixinTests.java b/tests/src/org/aspectj/systemtest/ajc164/DeclareMixinTests.java index 1997c361c..5651913d6 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/DeclareMixinTests.java +++ b/tests/src/org/aspectj/systemtest/ajc164/DeclareMixinTests.java @@ -99,6 +99,36 @@ public class DeclareMixinTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("casek"); } + // mixin of a class - should be an error (this one reported by the compiler due to a failed cast) + public void testCaseL() { + runTest("casel"); + } + + // mixin of a class - should be an error (this one reported by the annotation processing) + public void testCaseM() { + runTest("casem"); + } + + // factory returns class but interface specified - this is OK + public void testCaseN() { + runTest("casen"); + } + + // factory returns class but interface specified - not ok as class doesn't implement interface + public void testCaseO() { + runTest("caseo"); + } + + // interface subsetting used (factory returns class) - but only one method should be delegated + public void testCaseP() { + runTest("casep"); + } + + // factory return type implements two interfaces, both should be mixed as specified + public void testCaseQ() { + runTest("caseq"); + } + // -- public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc164/declareMixin.xml b/tests/src/org/aspectj/systemtest/ajc164/declareMixin.xml index 6bf37adfa..cb229374c 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/declareMixin.xml +++ b/tests/src/org/aspectj/systemtest/ajc164/declareMixin.xml @@ -102,5 +102,50 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5