view gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java @ 1022:28a0628b11b0

Added license file and license header. gnv/trunk@1258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:15:08 +0000
parents 57fa8019fbdc
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.util;

import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import junit.framework.TestCase;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import org.w3c.dom.Document;

/**
 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
 *
 */
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);
        }
    }
}

http://dive4elements.wald.intevation.org