Mercurial > dive4elements > gnv-client
diff gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java @ 11:3cb753564552
Integration of the required XSL-Transformation of the Describe-Response of the Artifactdatabase
gnv/trunk@90 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 15 Sep 2009 14:19:55 +0000 |
parents | |
children | 4405f31bbc30 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java Tue Sep 15 14:19:55 2009 +0000 @@ -0,0 +1,55 @@ +/** + * + */ +package de.intevation.gnv.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient; + +import junit.framework.TestCase; + +/** + * @author Tim Englich <tim.englich@intevation.de> + * + */ +public class XSLTransformerTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static{ + BasicConfigurator.configure(); + log = Logger.getLogger(DefaultArtifactDatabaseClient.class); + } + + public XSLTransformerTestCase() { + super(); + } + + public XSLTransformerTestCase(String name) { + super(name); + } + + + public void testDescribeUI(){ + + try { + //System.setProperty("javax.xml.transform.TransformerFactory","com.icl.saxon.TransformerFactoryImpl"); + Document document = new XMLUtils().readDocument(new FileInputStream(new File("src/test/ressources/describe-ui-test.xml"))); + XSLTransformer transformer = new XSLTransformer(); + String value = transformer.transform(document, "UTF-8", "src/main/webapp/WEB-INF/config/templates/describe-ui.xsl"); + log.debug(value); + } catch (FileNotFoundException e) { + log.error(e,e); + } + } +}