From 39e580cff820df73d5b7fefb32a80e3410064fbd Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 18 Dec 2007 15:46:04 +0000 Subject: [PATCH] 166647 changed the error message to a lint --- tests/bugs154/pr166647/aop1.xml | 2 +- .../aspectj/systemtest/ajc154/Ajc154Tests.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/bugs154/pr166647/aop1.xml b/tests/bugs154/pr166647/aop1.xml index d4b88e7ef..fa5795a71 100644 --- a/tests/bugs154/pr166647/aop1.xml +++ b/tests/bugs154/pr166647/aop1.xml @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java index f381cda80..c2abd1bab 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java @@ -26,6 +26,7 @@ import org.aspectj.weaver.tools.FuzzyBoolean; import org.aspectj.weaver.tools.MatchingContext; import org.aspectj.weaver.tools.PointcutDesignatorHandler; +import junit.framework.AssertionFailedError; import junit.framework.Test; /** @@ -45,7 +46,19 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase { //public void testAfterThrowingAnnotationStyle_pr211674_2() { runTest("after throwing annotation style problem - 2");} // crappy solution - see the bug -// public void testCflowLtwProblem_pr166647_1() { runTest("ltw and cflow problem"); } + public void testCflowLtwProblem_pr166647_1() { + try { + runTest("ltw and cflow problem"); + } catch (AssertionFailedError afe) { + // this is OK.... sadly + // at least lets check we warned the user it was going to happen: + String stderr = (getLastRunResult()==null?"":getLastRunResult().getStdErr()); + // Expected line: + // [WeavingURLClassLoader] warning XML Defined aspects must be woven in cases where cflow pointcuts are involved. Currently the include/exclude patterns exclude 'x.Aspect2' [Xlint:mustWeaveXmlDefinedAspects] + assertTrue("Did not see warning about needing to weave xml defined aspects",stderr.indexOf("warning XML Defined aspects must be woven in cases where cflow pointcuts are involved.")!=-1); + assertTrue("Xlint warning was expected '[Xlint:mustWeaveXmlDefinedAspects]'",stderr.indexOf("[Xlint:mustWeaveXmlDefinedAspects]")!=-1); + } + } // Testing some issues with declare at type public void testDeclareAtTypeProblems_pr211052_1() { runTest("declare atType problems - 1"); } -- 2.39.5