diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java b/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
index c0fa13565..910ded4a6 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
@@ -24,6 +24,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.TaskAdapter;
import org.apache.tools.ant.util.WorkerAnt;
import org.apache.tools.ant.taskdefs.condition.Condition;
+import org.apache.tools.ant.taskdefs.condition.ConditionBase;
import org.apache.tools.ant.taskdefs.Parallel;
import org.apache.tools.ant.taskdefs.Sequential;
import org.apache.tools.ant.taskdefs.WaitFor;
@@ -63,7 +64,8 @@ public class Funtest extends Task {
* easier to define complex tests that only
* run if certain conditions are met, such as OS or network state.
*/
- private Condition condition;
+
+ private NestedCondition condition;
/**
@@ -165,9 +167,9 @@ public class Funtest extends Task {
/** {@value} */
public static final String SKIPPING_TESTS
= "Condition failed -skipping tests";
- /** Application exception */
+ /** Application exception : {@value} */
public static final String APPLICATION_EXCEPTION = "Application Exception";
- /** Teardown exception */
+ /** Teardown exception : {@value} */
public static final String TEARDOWN_EXCEPTION = "Teardown Exception";
/**
@@ -178,17 +180,19 @@ public class Funtest extends Task {
*/
private void logOverride(String name, Object definition) {
if (definition != null) {
- log(WARN_OVERRIDING + '<' + name + '>', Project.MSG_WARN);
+ log(WARN_OVERRIDING + '<' + name + '>', Project.MSG_INFO);
}
}
/**
- * Add a condition.
- * @param newCondition the condition to add.
- */
- public void addCondition(Condition newCondition) {
+ * Add a condition element.
+ * @return ConditionBase
.
+ * @since Ant 1.6.2
+ */
+ public ConditionBase createCondition() {
logOverride("condition", condition);
- condition = newCondition;
+ condition = new NestedCondition();
+ return condition;
}
/**
@@ -368,6 +372,17 @@ public class Funtest extends Task {
return par;
}
+ /**
+ * Add any task validation needed to ensure internal code quality
+ * @param task task
+ * @param role role of the task
+ */
+ private void validateTask(Task task, String role) {
+ if (task!=null && task.getProject() == null) {
+ throw new BuildException(role + " task is not bound to the project" + task);
+ }
+ }
+
/**
* Run the functional test sequence.
*