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

TarTest

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

Fields Summary
Constructors Summary
public TarTest(String name)

        super(name);
    
Methods Summary
public voidsetUp()

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

        executeTarget("cleanup");
    
public voidtest1()

        expectBuildException("test1", "required argument not specified");
    
public voidtest10()

        executeTarget("test10");
        File f1
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test10.xml");
        if (! f1.exists()) {
            fail("The fullpath attribute or the preserveLeadingSlashes attribute does not work propertly");
        }
    
public voidtest11()

        executeTarget("test11");
        File f1
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test11.xml");
        if (! f1.exists()) {
            fail("The fullpath attribute or the preserveLeadingSlashes attribute does not work propertly");
        }
    
public voidtest2()

        expectBuildException("test2", "required argument not specified");
    
public voidtest3()

        expectBuildException("test3", "required argument not specified");
    
public voidtest4()

        expectBuildException("test4", "tar cannot include itself");
    
public voidtest5()

        executeTarget("test5");
        File f
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test5.tar");

        if (!f.exists()) {
            fail("Tarring a directory failed");
        }
    
public voidtest6()

        expectBuildException("test6", "Invalid value specified for longfile attribute.");
    
private voidtest7(java.lang.String target)

        executeTarget(target);
        File f1
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test7-prefix");

        if (!(f1.exists() && f1.isDirectory())) {
            fail("The prefix attribute is not working properly.");
        }

        File f2
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test7dir");

        if (!(f2.exists() && f2.isDirectory())) {
            fail("The prefix attribute is not working properly.");
        }
    
public voidtest7()

        test7("test7");
    
public voidtest7UsingFileList()

        test7("test7UsingFileList");
    
public voidtest7UsingPlainFileSet()

        test7("test7UsingPlainFileSet");
    
public voidtest8()

        test8("test8");
    
private voidtest8(java.lang.String target)

        executeTarget(target);
        File f1
            = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/test8.xml");
        if (! f1.exists()) {
            fail("The fullpath attribute or the preserveLeadingSlashes attribute does not work propertly");
        }
    
public voidtest8UsingTarFilesetSrc()

        test8("test8UsingTarFilesetSrc");
    
public voidtest8UsingZipEntry()

        test8("test8UsingZipEntry");
    
public voidtest8UsingZipFileset()

        test8("test8UsingZipFileset");
    
public voidtest8UsingZipFilesetSrc()

        test8("test8UsingZipFilesetSrc");
    
public voidtest9()

        expectBuildException("test9", "Invalid value specified for compression attribute.");
    
public voidtestGZipResource()

        executeTarget("testGZipResource");
        assertTrue(FileUtils.getFileUtils()
                   .contentEquals(getProject().resolveFile("../asf-logo.gif"),
                                  getProject().resolveFile("testout/asf-logo.gif.gz")));