FileDocCategorySizeDatePackage
AssertionsTest.javaAPI DocApache Ant 1.702960Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.types

AssertionsTest

public class AssertionsTest extends org.apache.tools.ant.BuildFileTest
test assertion handling

Fields Summary
Constructors Summary
public AssertionsTest(String name)

        super(name);
    
Methods Summary
protected voidexpectAssertion(java.lang.String target)
runs a test and expects an assertion thrown in forked code

param
target

        expectBuildExceptionContaining(target,
                "assertion not thrown in "+target,
                "Java returned: 1");
    
protected voidsetUp()

        configureProject("src/etc/testcases/types/assertions.xml");
    
protected voidtearDown()

        executeTarget("teardown");
    
public voidtestClassname()

        expectAssertion("test-classname");
    
public voidtestDisable()

        executeTarget("test-disable");
    
public voidtestEmptyAssertions()

        executeTarget("test-empty-assertions");
    
public voidtestJunit()

        executeTarget("test-junit");
    
public voidtestMultipleAssertions()

        expectBuildExceptionContaining("test-multiple-assertions",
                "multiple assertions rejected",
                "Only one assertion declaration is allowed");
    
public voidtestNofork()

        if (AssertionsTest.class.desiredAssertionStatus()) {
            return; // ran Ant tests with -ea and this would fail spuriously
        }
        expectLogContaining("test-nofork",
                "Assertion statements are currently ignored in non-forked mode");
    
public voidtestOverride()

        expectAssertion("test-override");
    
public voidtestOverride2()

        executeTarget("test-override2");
    
public voidtestPackage()

        expectAssertion("test-package");
    
public voidtestReferenceAbuse()

        expectBuildExceptionContaining("test-reference-abuse",
                "reference abuse rejected",
                "You must not specify");
    
public voidtestReferences()

        expectAssertion("test-references");