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

InitializeClassTest

public class InitializeClassTest extends org.apache.tools.ant.BuildFileTest
Test to see if static initializers are invoked the same way when is invoked in forked and unforked modes.

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


       
        super(name);
    
Methods Summary
public voidsetUp()

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

        f1.delete();
        f2.delete();
    
public voidtestAll()

        executeTarget("forked");
        PrintStream ps = System.out;
        PrintStream newps = new PrintStream(new FileOutputStream(f2));
        System.setOut(newps);
        project.executeTarget("unforked");
        System.setOut(ps);
        newps.close();
        assertTrue("Forked - non-forked mismatch", FILE_UTILS.contentEquals(f1, f2));