FileDocCategorySizeDatePackage
MoveTest.javaAPI DocApache Ant 1.705429Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs

MoveTest

public class MoveTest extends org.apache.tools.ant.BuildFileTest
Tests the Move task.

Fields Summary
private static final org.apache.tools.ant.util.FileUtils
FILE_UTILS
Utilities used for file operations
Constructors Summary
public MoveTest(String name)


       
        super(name);
    
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/move.xml");
    
public voidtearDown()

        executeTarget("cleanup");
    
private voidtestCompleteDirectoryMove(java.lang.String target)

        executeTarget(target);
        assertTrue(getProject().resolveFile("E").exists());
        assertTrue(getProject().resolveFile("E/1").exists());
        assertTrue(!getProject().resolveFile("A/1").exists());
        // <path> swallows the basedir, it seems
        //assertTrue(!getProject().resolveFile("A").exists());
    
public voidtestCompleteDirectoryMove()

        testCompleteDirectoryMove("testCompleteDirectoryMove");
    
public voidtestCompleteDirectoryMove2()

        testCompleteDirectoryMove("testCompleteDirectoryMove2");
    
public voidtestCompleteDirectoryMoveFileAndFileset()

        executeTarget("testCompleteDirectoryMoveFileAndFileset");
    
public voidtestCompleteDirectoryMoveFileToDir()

        executeTarget("testCompleteDirectoryMoveFileToDir");
    
public voidtestCompleteDirectoryMoveFileToDirWithExistingDir()

        executeTarget("testCompleteDirectoryMoveFileToDirWithExistingDir");
    
public voidtestCompleteDirectoryMoveFileToDirWithExistingFile()

        executeTarget("testCompleteDirectoryMoveFileToDirWithExistingFile");
    
public voidtestCompleteDirectoryMoveFileToExistingDir()

        executeTarget("testCompleteDirectoryMoveFileToExistingDir");
    
public voidtestCompleteDirectoryMoveFileToExistingFile()

        executeTarget("testCompleteDirectoryMoveFileToExistingFile");
    
public voidtestCompleteDirectoryMoveFileToFile()

        executeTarget("testCompleteDirectoryMoveFileToFile");
    
public voidtestCompleteDirectoryMoveToExistingDir()

        executeTarget("testCompleteDirectoryMoveToExistingDir");
    
public voidtestDirectoryRemoval()
Bugzilla Report 11732

        executeTarget("testDirectoryRemoval");
        assertTrue(!getProject().resolveFile("E/B/1").exists());
        assertTrue(getProject().resolveFile("E/C/2").exists());
        assertTrue(getProject().resolveFile("E/D/3").exists());
        assertTrue(getProject().resolveFile("A/B/1").exists());
        assertTrue(!getProject().resolveFile("A/C/2").exists());
        assertTrue(!getProject().resolveFile("A/D/3").exists());
        assertTrue(!getProject().resolveFile("A/C").exists());
        assertTrue(!getProject().resolveFile("A/D").exists());
    
public voidtestDirectoryRetaining()
Bugzilla Report 18886

        executeTarget("testDirectoryRetaining");
        assertTrue(getProject().resolveFile("E").exists());
        assertTrue(getProject().resolveFile("E/1").exists());
        assertTrue(!getProject().resolveFile("A/1").exists());
        assertTrue(getProject().resolveFile("A").exists());
    
public voidtestFilterChain()

        executeTarget("testFilterChain");
        File tmp  = new File(getProjectDir(), "move.filterchain.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(FILE_UTILS.contentEquals(tmp, check));
    
public voidtestFilterSet()

        executeTarget("testFilterSet");
        File tmp  = new File(getProjectDir(), "move.filterset.tmp");
        File check  = new File(getProjectDir(), "expected/copy.filterset.filtered");
        assertTrue(tmp.exists());
        assertTrue(FILE_UTILS.contentEquals(tmp, check));
    
public voidtestMoveFileAndFileset()

        executeTarget("testMoveFileAndFileset");
    
public voidtestPathElementMove()

        executeTarget("testPathElementMove");
        assertTrue(getProject().resolveFile("E").exists());
        assertTrue(getProject().resolveFile("E/1").exists());
        assertTrue(!getProject().resolveFile("A/1").exists());
        assertTrue(getProject().resolveFile("A").exists());