FileDocCategorySizeDatePackage
DefaultExcludesTest.javaAPI DocApache Ant 1.704086Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs

DefaultExcludesTest

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

Fields Summary
Constructors Summary
public DefaultExcludesTest(String name)

        super(name);
    
Methods Summary
private voidassertEquals(java.lang.String message, java.lang.String[] expected, java.lang.String[] actual)

        // check that both arrays have the same size
        assertEquals(message + " : string array length match", expected.length, actual.length);
        for (int counter=0; counter <expected.length; counter++) {
            assertEquals(message + " : " + counter + "th element in array match", expected[counter], actual[counter]);
        }

    
public voidsetUp()

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

        project.executeTarget("cleanup");
    
public voidtest1()

        String[] expected = {
                          "**/*~",
                          "**/#*#",
                          "**/.#*",
                          "**/%*%",
                          "**/._*",
                          "**/CVS",
                          "**/CVS/**",
                          "**/.cvsignore",
                          "**/SCCS",
                          "**/SCCS/**",
                          "**/vssver.scc",
                          "**/.svn",
                          "**/.svn/**",
                          "**/.DS_Store"};
        project.executeTarget("test1");
        assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes());
    
public voidtest2()

        String[] expected = {
                          "**/*~",
                          "**/#*#",
                          "**/.#*",
                          "**/%*%",
                          "**/._*",
                          "**/CVS",
                          "**/CVS/**",
                          "**/.cvsignore",
                          "**/SCCS",
                          "**/SCCS/**",
                          "**/vssver.scc",
                          "**/.svn",
                          "**/.svn/**",
                          "**/.DS_Store",
                          "foo"};
        project.executeTarget("test2");
        assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes());
    
public voidtest3()

        String[] expected = {
                          "**/*~",
                          "**/#*#",
                          "**/.#*",
                          "**/%*%",
                          "**/._*",
                          //CVS missing
                          "**/CVS/**",
                          "**/.cvsignore",
                          "**/SCCS",
                          "**/SCCS/**",
                          "**/vssver.scc",
                          "**/.svn",
                          "**/.svn/**",
                          "**/.DS_Store"};
        project.executeTarget("test3");
        assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes());