Browse Source

new istrue/isfalse condition tests.

I stuck some contains tests in here too, not noticing that they were in ContainsTest. Well, extra tests are always good, and now we test validation too.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272524 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 23 years ago
parent
commit
bbe68be969
1 changed files with 66 additions and 0 deletions
  1. +66
    -0
      src/testcases/org/apache/tools/ant/taskdefs/ConditionTest.java

+ 66
- 0
src/testcases/org/apache/tools/ant/taskdefs/ConditionTest.java View File

@@ -189,5 +189,71 @@ public class ConditionTest extends BuildFileTest {
public void testFilesmatchMatch() {
expectPropertySet("filesmatch-match","filesmatch-match");
}
public void testContains() {
expectPropertySet("contains","contains");
}
public void testContainsDoesnt() {
expectPropertyUnset("contains-doesnt","contains-doesnt");
}

public void testContainsAnycase() {
expectPropertySet("contains-anycase","contains-anycase");
}

public void testContainsIncomplete1() {
expectSpecificBuildException("contains-incomplete1",
"Missing contains attribute",
"both string and substring are required in contains");
}
public void testContainsIncomplete2() {
expectSpecificBuildException("contains-incomplete2",
"Missing contains attribute",
"both string and substring are required in contains");
}
public void testIstrue() {
expectPropertySet("istrue","istrue");
}

public void testIstrueNot() {
expectPropertyUnset("istrue-not","istrue-not");
}
public void testIstrueFalse() {
expectPropertyUnset("istrue-false","istrue-false");
}

public void testIstrueIncomplete1() {
expectSpecificBuildException("istrue-incomplete",
"Missing attribute",
"Nothing to test for truth");
}

public void testIsfalseTrue() {
expectPropertyUnset("isfalse-true","isfalse-true");
}

public void testIsfalseNot() {
expectPropertySet("isfalse-not","isfalse-not");
}
public void testIsfalseFalse() {
expectPropertySet("isfalse-false","isfalse-false");
}

public void testIsfalseIncomplete1() {
expectSpecificBuildException("isfalse-incomplete",
"Missing attribute",
"Nothing to test for falsehood");
}
}


Loading…
Cancel
Save