aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java4
-rw-r--r--taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java15
2 files changed, 19 insertions, 0 deletions
diff --git a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
index 1cf3d11d3..f5321c87b 100644
--- a/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
+++ b/taskdefs/src/org/aspectj/tools/ant/taskdefs/AjcTask.java
@@ -462,6 +462,10 @@ public class AjcTask extends MatchingTask {
public void setXReweavable(boolean reweavable) {
cmd.addFlag("-Xreweavable",reweavable);
}
+
+ public void setShowWeaveInfo(boolean showweaveinfo) {
+ cmd.addFlag("-showWeaveInfo",showweaveinfo);
+ }
public void setNowarn(boolean nowarn) {
cmd.addFlag("-nowarn", nowarn);
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
index 96618a708..25030c116 100644
--- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
+++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
@@ -414,6 +414,17 @@ public class AjcTaskTest extends TestCase {
task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR);
}
+
+ public void testShowWeaveInfo() {
+ AjcTask task = getTask("showweaveinfo.lst");
+ task.setShowWeaveInfo(true);
+ MessageHandler mh = new MessageHandler(false);
+ mh.dontIgnore(IMessage.WEAVEINFO);
+ MessageHolderChecker mhc = new MessageHolderChecker(0,0,0,0,MessageHolderChecker.IGNORE);
+ mhc.weaveinfos = 2; // Expect 2 weaving messages
+ runTest(task,NO_EXCEPTION,mhc);
+ mhc.weaveinfos = MessageHolderChecker.IGNORE;
+ }
public void testCompileWarningList() {
AjcTask task = getTask("compileWarning.lst");
@@ -634,8 +645,10 @@ public class AjcTaskTest extends TestCase {
/** one warning, any number of info messages */
static MessageHolderChecker ONE_WARNING =
new MessageHolderChecker(0, 0, 0, 1, IGNORE);
+
int aborts, fails, errors, warnings, infos;
+ int weaveinfos;
public MessageHolderChecker(
int aborts,
int fails,
@@ -647,6 +660,7 @@ public class AjcTaskTest extends TestCase {
this.errors = errors;
this.warnings = warnings;
this.infos = infos;
+ this.weaveinfos = IGNORE;
}
public boolean expectFail() {
@@ -661,6 +675,7 @@ public class AjcTaskTest extends TestCase {
check(holder, errors, IMessage.ERROR);
check(holder, warnings, IMessage.WARNING);
check(holder, infos, IMessage.INFO);
+ check(holder, weaveinfos, IMessage.WEAVEINFO);
failed = false;
} finally {
if (failed) {