FileDocCategorySizeDatePackage
TraXLiaisonTest.javaAPI DocApache Ant 1.703347Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.optional

TraXLiaisonTest

public class TraXLiaisonTest extends AbstractXSLTLiaisonTest implements org.apache.tools.ant.taskdefs.XSLTLogger
TraX XSLTLiaison testcase

Fields Summary
Constructors Summary
public TraXLiaisonTest(String name)

        super(name);
    
Methods Summary
public org.apache.tools.ant.taskdefs.XSLTLiaisoncreateLiaison()

        TraXLiaison l = new TraXLiaison();
        l.setLogger(this);
        return l;
    
public voidlog(java.lang.String message)

        throw new AssertionFailedError("Liaison sent message: "+message);
    
public voidtearDown()

        File f = new File("xalan2-redirect-out.tmp");
        if (f.exists()) {
            f.delete();
        }
    
public voidtestMultipleTransform()

        File xsl = getFile("/taskdefs/optional/xsltliaison-in.xsl");
        liaison.setStylesheet(xsl);
        liaison.addParam("param", "value");
        File in = getFile("/taskdefs/optional/xsltliaison-in.xml");
        // test for 10 consecutives transform
        for (int i = 0; i < 50; i++){
            File out = new File("xsltliaison" + i + ".tmp");
            try {
                liaison.transform(in, out);
            } catch (Exception e){
                throw new BuildException("failed in transform " + i, e);
            } finally {
                out.delete();
            }
        }
    
public voidtestSystemId()

        File file = null;
        if ( File.separatorChar == '\\" ){
            file = new File("d:\\jdk");
        } else {
            file = new File("/user/local/bin");
        }
        String systemid = JAXPUtils.getSystemId(file);
        assertTrue("SystemIDs should start by file:/", systemid.startsWith("file:/"));
        assertTrue("SystemIDs should not start with file:////", !systemid.startsWith("file:////"));
    
public voidtestXalan2Redirect()

        File xsl = getFile("/taskdefs/optional/xalan-redirect-in.xsl");
        liaison.setStylesheet(xsl);
        File out = new File("xalan2-redirect-out-dummy.tmp");
        File in = getFile("/taskdefs/optional/xsltliaison-in.xsl");
        try {
            liaison.addParam("xalan-version", "2");
            liaison.transform(in, out);
        } finally {
            out.delete();
        }