package com.uas.report.crystal2jasper;

import org.dom4j.DocumentException;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.xml.transform.TransformerException;
import java.io.File;
import java.io.IOException;

/**
 * @author sunyj
 * @since 2017/12/19 17:49
 */
public class CrystalToJasperTest {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Test
    public void test() throws DocumentException, TransformerException, IOException {
        File rptZipFile = ResourceUtils.getFile("formatted-rpts");
        File outDir = ResourceUtils.getFile("out");
        File styleFile = ResourceUtils.getFile("crystal2jasper.xsl");
        boolean remainHierarchy = false;

        CrystalToJasper crystalToJasper = new CrystalToJasper();
        crystalToJasper.translate(rptZipFile, outDir, remainHierarchy, styleFile);
        logger.info("translation complete!");
    }
}
