From b278e5fa0b4e277d44bc620493800f1dbe628aaa Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Mon, 14 Jan 2002 00:00:30 +0000 Subject: [PATCH] added expect() clauses for properties being set, unset. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270746 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/BuildFileTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/testcases/org/apache/tools/ant/BuildFileTest.java b/src/testcases/org/apache/tools/ant/BuildFileTest.java index 47ea8dbdb..1884e4405 100644 --- a/src/testcases/org/apache/tools/ant/BuildFileTest.java +++ b/src/testcases/org/apache/tools/ant/BuildFileTest.java @@ -219,6 +219,44 @@ public abstract class BuildFileTest extends TestCase { } fail("Should throw BuildException because: " + cause); } + + + /** + * call a target, verify property is as expected + * + * @param target build file target + * @param property property name + * @param value expected value + */ + + protected void expectPropertySet(String target, String property, String value) { + executeTarget(target); + String result = project.getProperty(property); + assertEquals("property " + property,value,result); + } + + + /** + * call a target, verify property is "true" + * + * @param target build file target + * @param property property name + */ + protected void expectPropertySet(String target, String property) { + expectPropertySet(target, property, "true"); + } + + + /** + * call a target, verify property is null + * @param target build file target + * @param property property name + */ + protected void expectPropertyUnset(String target, String property) { + expectPropertySet(target, property, null); + } + + private class AntOutputStream extends java.io.OutputStream { public void write(int b) {