FileDocCategorySizeDatePackage
LocationTest.javaAPI DocApache Ant 1.702945Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant

LocationTest

public class LocationTest extends BuildFileTest

Fields Summary
Constructors Summary
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/core/location.xml");
    
public voidtestConditionTask()

        executeTarget("testConditionTask");
        TaskAdapter ta = (TaskAdapter) getProject().getReference("cond");
        ConditionTask c = (ConditionTask) ta.getProxy();
        assertFalse(c.getLocation() == Location.UNKNOWN_LOCATION);
        assertFalse(c.getLocation().getLineNumber() == 0);
    
public voidtestMacrodefWrappedTask()

        executeTarget("testMacrodefWrappedTask");
        Echo e = (Echo) getProject().getReference("echo3");
        assertTrue(getLog().indexOf("Line: " 
                                    + (e.getLocation().getLineNumber() + 1))
                   > -1);
    
public voidtestPlainTask()

        executeTarget("testPlainTask");
        Echo e = (Echo) getProject().getReference("echo");
        assertFalse(e.getLocation() == Location.UNKNOWN_LOCATION);
        assertFalse(e.getLocation().getLineNumber() == 0);
    
public voidtestPresetdefWrappedTask()

        executeTarget("testPresetdefWrappedTask");
        Echo e = (Echo) getProject().getReference("echo4");
        assertTrue(getLog().indexOf("Line: " 
                                    + (e.getLocation().getLineNumber() + 1))
                   > -1);
    
public voidtestStandaloneType()

        executeTarget("testStandaloneType");
        Echo e = (Echo) getProject().getReference("echo2");
        FileSet f = (FileSet) getProject().getReference("fs");
        assertFalse(f.getLocation() == Location.UNKNOWN_LOCATION);
        assertEquals(e.getLocation().getLineNumber() + 1,
                     f.getLocation().getLineNumber());