FileDocCategorySizeDatePackage
ConditionTest.javaAPI DocApache Ant 1.707717Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs

ConditionTest

public class ConditionTest extends org.apache.tools.ant.BuildFileTest
created
13 January 2002

Fields Summary
Constructors Summary
public ConditionTest(String name)
Constructor for the ConditionTest object

param
name we dont know

        super(name);
    
Methods Summary
public voidsetUp()
The JUnit setup method

        configureProject("src/etc/testcases/taskdefs/condition.xml");
    
public voidtearDown()
The teardown method for JUnit

        executeTarget("cleanup");
    
public voidtestAnd()

        expectPropertySet("and","and");
    
public voidtestAndFails()

        expectPropertyUnset("andfails","andfails");
    
public voidtestAndIncomplete()

        expectPropertyUnset("andincomplete","andincomplete");
    
public voidtestAndempty()

        expectPropertySet("andempty","andempty");
    
public voidtestBasic()

       expectPropertySet("basic","basic");
    
public voidtestConditionEmpty()

        expectSpecificBuildException("condition-empty",
                                     "no conditions",
                                     "You must nest a condition into <condition>");
    
public voidtestConditionIncomplete()

        expectSpecificBuildException("condition-incomplete",
                                     "property attribute has been omitted",
                                     "The property attribute is required.");
    
public voidtestContains()

        expectPropertySet("contains","contains");
    
public voidtestContainsAnycase()

        expectPropertySet("contains-anycase","contains-anycase");
    
public voidtestContainsDoesnt()

        expectPropertyUnset("contains-doesnt","contains-doesnt");
    
public voidtestContainsIncomplete1()

        expectSpecificBuildException("contains-incomplete1",
                    "Missing contains attribute",
                    "both string and substring are required in contains");
    
public voidtestContainsIncomplete2()

        expectSpecificBuildException("contains-incomplete2",
                    "Missing contains attribute",
                    "both string and substring are required in contains");
    
public voidtestElse()

        executeTarget("testElse");
    
public voidtestFilesmatchDifferent()

        expectPropertyUnset("filesmatch-different","filesmatch-different");
    
public voidtestFilesmatchDifferentEol()

        executeTarget("filesmatch-different-eol");
    
public voidtestFilesmatchDifferentOnemissing()

        expectPropertyUnset("filesmatch-different-onemissing",
            "filesmatch-different-onemissing");
    
public voidtestFilesmatchDifferentSizes()

        expectPropertyUnset("filesmatch-different-sizes",
            "filesmatch-different-sizes");
    
public voidtestFilesmatchExistence()

        expectPropertyUnset("filesmatch-existence", "filesmatch-existence");
    
public voidtestFilesmatchIdentical()

        expectPropertySet("filesmatch-identical","filesmatch-identical");
    
public voidtestFilesmatchIncomplete()

        expectSpecificBuildException("filesmatch-incomplete",
                                     "Missing file2 attribute",
                                     "both file1 and file2 are required in filesmatch");
    
public voidtestFilesmatchMatch()

        expectPropertySet("filesmatch-match","filesmatch-match");
    
public voidtestFilesmatchNeitherExist()

        executeTarget("filesmatch-neitherexist");
    
public voidtestFilesmatchOddsizes()

        expectPropertyUnset("filesmatch-oddsizes","filesmatch-oddsizes");
    
public voidtestFilesmatchSameEol()

        executeTarget("filesmatch-same-eol");
    
public voidtestIsfalseFalse()

        expectPropertySet("isfalse-false","isfalse-false");
    
public voidtestIsfalseIncomplete1()

        expectSpecificBuildException("isfalse-incomplete",
                    "Missing attribute",
                    "Nothing to test for falsehood");
    
public voidtestIsfalseNot()

        expectPropertySet("isfalse-not","isfalse-not");
    
public voidtestIsfalseTrue()

        expectPropertyUnset("isfalse-true","isfalse-true");
    
public voidtestIstrue()

        expectPropertySet("istrue","istrue");
    
public voidtestIstrueFalse()

        expectPropertyUnset("istrue-false","istrue-false");
    
public voidtestIstrueIncomplete1()

        expectSpecificBuildException("istrue-incomplete",
                    "Missing attribute",
                    "Nothing to test for truth");
    
public voidtestIstrueNot()

        expectPropertyUnset("istrue-not","istrue-not");
    
public voidtestNegation()

        expectPropertySet("negation","negation");
    
public voidtestNegationFalse()

        expectPropertyUnset("negationfalse","negationfalse");
    
public voidtestNegationIncomplete()

        expectSpecificBuildException("negationincomplete",
                                     "no conditions in <not>",
                                     "You must nest a condition into <not>");
    
public voidtestOr()

        expectPropertySet("or","or");
    
public voidtestOrFails()

        expectPropertyUnset("orfails","orfails");
    
public voidtestOrboth()

        expectPropertySet("orboth","orboth");
    
public voidtestOrincomplete()

        expectPropertySet("or","or");
    
public voidtestResourcesmatchBinary()

        executeTarget("resourcesmatch-match-binary");
    
public voidtestResourcesmatchDiffer()

        executeTarget("resourcesmatch-differ");
    
public voidtestResourcesmatchEmpty()

        executeTarget("resourcesmatch-match-empty");
    
public voidtestResourcesmatchError()

        expectBuildException("resourcesmatch-error",
            "should fail because no resources specified");
    
public voidtestResourcesmatchMultipleBinary()

        executeTarget("resourcesmatch-match-multiple-binary");
    
public voidtestResourcesmatchNoneExist()

        executeTarget("resourcesmatch-noneexist");
    
public voidtestResourcesmatchOne()

        executeTarget("resourcesmatch-match-one");
    
public voidtestResourcesmatchText()

        executeTarget("resourcesmatch-match-text");
    
public voidtestSetValue()

        expectPropertySet("setvalue","setvalue","woowoo");
    
public voidtestShortcut()

        expectPropertySet("shortcut","shortcut","set");
    
public voidtestUnset()

        expectPropertyUnset("dontset","dontset");