From 1d384ecdfaeaeabc0d2bf3a08961d5ebb24fa8a4 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 27 Aug 2004 16:02:18 +0000 Subject: [PATCH] Improved testcase for this 1.5 problem. --- .../aspectj/systemtest/ajc121/Ajc121Tests.java | 16 +++++++++++++++- .../aspectj/systemtest/ajc121/ajc121-tests.xml | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java index 98c1b8d5d..bb9f64266 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java @@ -10,9 +10,12 @@ package org.aspectj.systemtest.ajc121; import java.io.File; +import java.util.Iterator; +import java.util.List; import junit.framework.Test; +import org.aspectj.bridge.WeaveMessage; import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { @@ -270,6 +273,17 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void test051_arrayCloningInJava5() { runTest("AJC possible bug with static nested classes"); + List l = ajc.getLastCompilationResult().getInfoMessages(); + assertTrue("Should at least have had one weaving message",l!=null && l.size()>0); + boolean gotWeaveMessage = false; + for (Iterator msg = l.iterator(); msg.hasNext();) { + Object element = (Object) msg.next(); + if (element instanceof WeaveMessage) { + WeaveMessage wm = (WeaveMessage)element; + if (wm.getMessage().indexOf("advised by around advice from")!=-1) gotWeaveMessage = true; + } + } + assertTrue("Expected a weaving message but only found "+l,gotWeaveMessage); } public void test052_bogusMessage1() { @@ -281,7 +295,7 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase { } public void test054_cnfe() { - runTest("passing null to array arguments confuzes static join point signature. (1)"); + runTest("passing null to array arguments confuzes static join point signature. (1)"); } public void test055_cnfe() { diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml index dedc94112..43dce6610 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml @@ -414,8 +414,8 @@ - - + +