Browse Source

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
master
Steve Loughran 23 years ago
parent
commit
b278e5fa0b
1 changed files with 38 additions and 0 deletions
  1. +38
    -0
      src/testcases/org/apache/tools/ant/BuildFileTest.java

+ 38
- 0
src/testcases/org/apache/tools/ant/BuildFileTest.java View File

@@ -219,6 +219,44 @@ public abstract class BuildFileTest extends TestCase {
} }
fail("Should throw BuildException because: " + cause); 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 { private class AntOutputStream extends java.io.OutputStream {
public void write(int b) { public void write(int b) {


Loading…
Cancel
Save