summaryrefslogtreecommitdiffstats
path: root/taskdefs/testsrc
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-05-27 04:44:30 +0000
committerwisberg <wisberg>2003-05-27 04:44:30 +0000
commitc9f7a604ab3fcb9c8443d723184cac70567a1075 (patch)
tree892c79e9a923ba7750fbf3195ff90581fdadc88a /taskdefs/testsrc
parent11cf57eafef7855d931f58793aa7fe6a3ae76179 (diff)
downloadaspectj-c9f7a604ab3fcb9c8443d723184cac70567a1075.tar.gz
aspectj-c9f7a604ab3fcb9c8443d723184cac70567a1075.zip
fixing fork bugs:
- permitting fork in incremental mode only when using tag file - pulling aspectjtools also from the task classpath also failonerror default was not true as stated in the docs
Diffstat (limited to 'taskdefs/testsrc')
-rw-r--r--taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
index 89acd8d8f..8d96abd67 100644
--- a/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
+++ b/taskdefs/testsrc/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java
@@ -176,6 +176,9 @@ public class AjcTaskTest extends TestCase {
public void testFindAspectjtoolsJar() {
File toolsJar = AjcTask.findAspectjtoolsJar();
+ if (null != toolsJar) {
+ assertNull("tools jar found?: " + toolsJar, toolsJar);
+ }
// not found when unit testing b/c not on system classpath
// so just checking for exceptions.
// XXX need aspect to stub out System.getProperty(..)
@@ -213,6 +216,35 @@ public class AjcTaskTest extends TestCase {
return task;
}
+ public void testDefaultListForkedNoTools() {
+ AjcTask task = getTask("default.lst");
+ task.setFork(true);
+ boolean passed = false;
+ try {
+ runTest(task, BuildException.class, MessageHolderChecker.NONE);
+ passed = true;
+ } finally {
+ if (!passed) {
+ String m = "AjcTaskTest.testDefaultListForkedNoTools()"
+ + " fails if aspectjtools.jar is on the classpath";
+ System.err.println(m);
+ }
+ }
+ }
+
+ public void testDefaultListForkedIncremental() {
+ AjcTask task = getTask("default.lst");
+ task.setFork(true);
+ task.setIncremental(true);
+ runTest(task, BuildException.class, MessageHolderChecker.NONE);
+ }
+
+ /** failonerror should default to true, unlike other booleans */
+ public void testCompileErrorFailOnErrorDefault() {
+ AjcTask task = getTask("compileError.lst");
+ runTest(task, BuildException.class, MessageHolderChecker.ONE_ERROR);
+ }
+
public void testDefaultList() {
AjcTask task = getTask("default.lst");
runTest(task, NO_EXCEPTION, MessageHolderChecker.INFOS);
@@ -220,6 +252,7 @@ public class AjcTaskTest extends TestCase {
public void testCompileErrorList() {
AjcTask task = getTask("compileError.lst");
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR);
}
@@ -230,6 +263,7 @@ public class AjcTaskTest extends TestCase {
public void testNoSuchFileList() {
AjcTask task = getTask("NoSuchFile.lst");
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR_ONE_ABORT);
}
@@ -260,6 +294,7 @@ public class AjcTaskTest extends TestCase {
public void testNoFile() {
AjcTask task = getTask(NOFILE);
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR_ONE_ABORT);
}
@@ -268,16 +303,19 @@ public class AjcTaskTest extends TestCase {
public void testCompileErrorFile() {
AjcTask task = getTask("compileError.lst");
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR);
}
public void testCompileWarningFile() {
AjcTask task = getTask("compileWarning.lst");
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_WARNING);
}
public void testNoSuchFile() {
AjcTask task = getTask("NoSuchFile.lst");
+ task.setFailonerror(false);
runTest(task, NO_EXCEPTION, MessageHolderChecker.ONE_ERROR_ONE_ABORT);
}