Browse Source

bit of tuning

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@597452 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 17 years ago
parent
commit
393f5d34fa
1 changed files with 17 additions and 16 deletions
  1. +17
    -16
      src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java

+ 17
- 16
src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java View File

@@ -165,6 +165,8 @@ public class Funtest extends Task {
/** {@value} */ /** {@value} */
public static final String SKIPPING_TESTS public static final String SKIPPING_TESTS
= "Condition failed -skipping tests"; = "Condition failed -skipping tests";
public static final String APPLICATION_EXCEPTION = "Application Exception";
public static final String TEARDOWN_EXCEPTION = "Teardown Exception";


/** /**
* Log if the definition is overriding something * Log if the definition is overriding something
@@ -355,6 +357,7 @@ public class Funtest extends Task {
/** /**
* Create a newly bound parallel instance with one child * Create a newly bound parallel instance with one child
* @param parallelTimeout timeout * @param parallelTimeout timeout
* @param child task
* @return a bound and initialised parallel instance. * @return a bound and initialised parallel instance.
*/ */
private Parallel newParallel(long parallelTimeout, Task child) { private Parallel newParallel(long parallelTimeout, Task child) {
@@ -463,16 +466,7 @@ public class Funtest extends Task {
} }
applicationException = worker.getBuildException(); applicationException = worker.getBuildException();


/**Now faults are analysed
the priority is
-testexceptions, except those indicating a build timeout when the application itself
failed.
(because often it is the application fault that is more interesting than the probe
failure, which is usually triggered by the application not starting
-application exceptions (above test timeout exceptions)
-teardown exceptions -except when they are being ignored
-any
*/
//Now faults are analysed


processExceptions(); processExceptions();
} }
@@ -502,9 +496,7 @@ public class Funtest extends Task {
if (taskException == null || taskException instanceof BuildTimeoutException) { if (taskException == null || taskException instanceof BuildTimeoutException) {
taskException = applicationException; taskException = applicationException;
} else { } else {
log("Application Exception:" + applicationException.toString(),
applicationException,
Project.MSG_WARN);
ignoringThrowable(APPLICATION_EXCEPTION, applicationException);
} }
} }


@@ -514,9 +506,7 @@ public class Funtest extends Task {
taskException = teardownException; taskException = teardownException;
} else { } else {
//don't let the cleanup exception get in the way of any other failure //don't let the cleanup exception get in the way of any other failure
log("teardown exception" + teardownException.toString(),
teardownException,
Project.MSG_WARN);
ignoringThrowable(TEARDOWN_EXCEPTION, teardownException);
} }
} }


@@ -536,4 +526,15 @@ public class Funtest extends Task {
throw taskException; throw taskException;
} }
} }

/**
* log that we are ignoring something rather than rethrowing it.
* @param type name of exception
* @param thrown what was thrown
*/
protected void ignoringThrowable(String type, Throwable thrown) {
log(type + ": "+ thrown.toString(),
thrown,
Project.MSG_WARN);
}
} }

Loading…
Cancel
Save