/**
 * 試験用コード
 */
package blanco.commons.calc.parser.t001;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

import junit.framework.TestCase;
import blanco.commons.calc.parser.BlancoCalcParser;

/**
 * blancoResourceBundle <br>
 * メタ情報からプロパティファイルやリソースバンドルアクセサJavaソースコードを自動生成 <br>
 * 
 * メタ情報を入力してXMLを出力(XMLへ変換)します。 <br>
 * 
 * @author IGA Tosiki
 */
public class BlancoCalcParserT001 extends TestCase {

    public void testBlancoCalcParser() throws Exception {
        new File("tmp/test/calc/parser").mkdirs();

        InputStream inStream = null;
        OutputStream outStream = null;
        InputStream inStreamDef = null;
        try {
            inStream = new BufferedInputStream(new FileInputStream(
                    "./test/calc/parser/t001/t001.xls"));
            outStream = new BufferedOutputStream(new FileOutputStream(
                    "./tmp/test/calc/parser/t001.out.xml"));
            inStreamDef = new BufferedInputStream(new FileInputStream(
                    "./test/calc/parser/t001/t001.xml"));
            new BlancoCalcParser().process(inStreamDef, inStream, outStream);
            outStream.flush();
        } finally {
            if (inStream != null) {
                inStream.close();
            }
            if (outStream != null) {
                outStream.close();
            }
            if (inStreamDef != null) {
                inStreamDef.close();
            }
        }
    }
}