Mercurial > dive4elements > gnv-client
comparison 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 |
comparison
equal
deleted
inserted
replaced
10:e6c47838eee6 | 11:3cb753564552 |
---|---|
1 /** | |
2 * | |
3 */ | |
4 package de.intevation.gnv.util; | |
5 | |
6 import java.io.File; | |
7 import java.io.FileInputStream; | |
8 import java.io.FileNotFoundException; | |
9 | |
10 import org.apache.log4j.BasicConfigurator; | |
11 import org.apache.log4j.Logger; | |
12 import org.w3c.dom.Document; | |
13 | |
14 import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient; | |
15 | |
16 import junit.framework.TestCase; | |
17 | |
18 /** | |
19 * @author Tim Englich <tim.englich@intevation.de> | |
20 * | |
21 */ | |
22 public class XSLTransformerTestCase extends TestCase { | |
23 | |
24 /** | |
25 * the logger, used to log exceptions and additonaly information | |
26 */ | |
27 private static Logger log = null; | |
28 | |
29 static{ | |
30 BasicConfigurator.configure(); | |
31 log = Logger.getLogger(DefaultArtifactDatabaseClient.class); | |
32 } | |
33 | |
34 public XSLTransformerTestCase() { | |
35 super(); | |
36 } | |
37 | |
38 public XSLTransformerTestCase(String name) { | |
39 super(name); | |
40 } | |
41 | |
42 | |
43 public void testDescribeUI(){ | |
44 | |
45 try { | |
46 //System.setProperty("javax.xml.transform.TransformerFactory","com.icl.saxon.TransformerFactoryImpl"); | |
47 Document document = new XMLUtils().readDocument(new FileInputStream(new File("src/test/ressources/describe-ui-test.xml"))); | |
48 XSLTransformer transformer = new XSLTransformer(); | |
49 String value = transformer.transform(document, "UTF-8", "src/main/webapp/WEB-INF/config/templates/describe-ui.xsl"); | |
50 log.debug(value); | |
51 } catch (FileNotFoundException e) { | |
52 log.error(e,e); | |
53 } | |
54 } | |
55 } |