FileDocCategorySizeDatePackage
SubAntTest.javaAPI DocApache Ant 1.704899Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs

SubAntTest

public class SubAntTest extends org.apache.tools.ant.BuildFileTest

Fields Summary
Constructors Summary
public SubAntTest(String name)

        super(name);
    
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/subant.xml");
    
protected voidtestBaseDirs(java.lang.String target, java.lang.String[] dirs)

        SubAntTest.BasedirChecker bc = new SubAntTest.BasedirChecker(dirs);
        project.addBuildListener(bc);
        executeTarget(target);
        AssertionFailedError ae = bc.getError();
        if (ae != null) {
            throw ae;
        }
        project.removeBuildListener(bc);
    
public voidtestMultipleTargets()

        executeTarget("multipleTargets");
        assertLogContaining("test1-one");
        assertLogContaining("test1-two");
        assertLogContaining("test2-one");
        assertLogContaining("test2-two");
    
public voidtestMultipleTargetsOneDoesntExist_FOEfalse()

        executeTarget("multipleTargetsOneDoesntExist_FOEfalse");
        assertLogContaining("Target \"three\" does not exist in the project \"subant\"");
    
public voidtestMultipleTargetsOneDoesntExist_FOEtrue()

        expectBuildExceptionContaining("multipleTargetsOneDoesntExist_FOEtrue", 
                                       "Calling not existent target", 
                                       "Target \"three\" does not exist in the project \"subant\"");
    
public voidtestantfile()

        File dir1 = project.resolveFile(".");
        // basedir of subant/subant-test1/subant.xml is ..
        // therefore we expect here the subant/subant-test1 subdirectory
        File dir2 = project.resolveFile("subant/subant-test1");
        // basedir of subant/subant-test2/subant.xml is ..
        // therefore we expect here the subant subdirectory
        File dir3 = project.resolveFile("subant");

        testBaseDirs("testantfile",
                     new String[] { dir1.getAbsolutePath(),
                         dir2.getAbsolutePath(),
                         dir3.getAbsolutePath()

                     });

    
public voidtestgenericantfile()

        File dir1 = project.resolveFile(".");
        File dir2 = project.resolveFile("subant/subant-test1");
        File dir3 = project.resolveFile("subant/subant-test2");

        testBaseDirs("testgenericantfile",
                     new String[] { dir1.getAbsolutePath(),
                         dir2.getAbsolutePath(),
                         dir3.getAbsolutePath()

                     });
    
public voidtestnodirs()

        project.executeTarget("testnodirs");
        expectLog("testnodirs", "No sub-builds to iterate on");