/*
 * This code is generated by blanco Framework.
 * BlancoDbDotNetXmlHandler具象化SAXクラステストクラス<br>
 */
package blanco.db.concretesax;

import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.InputStream;

import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;

import junit.framework.TestCase;
import org.xml.sax.SAXException;

/**
 * BlancoDbDotNetXmlHandler具象化SAXクラステストクラス<br>
 * SAXを利用したXML読み込みをラッピングするクラスのテストクラスです。<br>
 * このクラスは解析用XMLファイルを入力として具象化SAXクラスとして生成されました。<br>
 * このソースコードはblancoIgにより機械的に自動生成されています。
 */
public class BlancoDbDotNetXmlHandlerTest extends TestCase {
    /**
     * テスト用のXMLデータです<br>
     * これがXML構造を解析する際の入力データでもあります。
     */
    public static final String fXmlImage = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<workbook>\n  <sheet name=\"queryName\">\n    <blancodbdotnet-common>\n      <query-type>caller</query-type>\n      <single>false</single>\n      <name>selectAll</name>\n    </blancodbdotnet-common>\n    <blancodbdotnet-inparameters>\n      <inparameter>\n        <no>param1</no>\n        <name>param1</name>\n        <type>java.lang.Long</type>\n        <description>コメント</description>\n        <samplevalue>参考値</samplevalue>\n      </inparameter>\n    </blancodbdotnet-inparameters>\n    <blancodbdotnet-detail>\n      <detail-line>detail of SQL.</detail-line> \n    </blancodbdotnet-detail>\n    <blancodbdotnet-query>\n      <query-line>select * from dula</query-line>\n      <query-line>order by a</query-line>\n    </blancodbdotnet-query>\n  </sheet>\n</workbook>\n";

    public void testHandler() throws Exception {
        SAXResult result = new SAXResult(new BlancoDbDotNetXmlHandler() {
            public void startDocument() throws SAXException {
            }

            public void endDocument() throws SAXException {
            }
            public void startElementWorkbook(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: workbook");
            }

            public void endElementWorkbook(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: workbook");
            }

            public void charactersWorkbook(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: workbook[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceWorkbook(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementSheet(String uri, String localName, String qName, String attrName) throws SAXException {
                System.out.println("start: sheet: name[" + attrName + "]");
            }

            public void endElementSheet(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: sheet");
            }

            public void charactersSheet(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: sheet[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceSheet(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementBlancodbdotnetCommon(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: blancodbdotnet-common");
            }

            public void endElementBlancodbdotnetCommon(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: blancodbdotnet-common");
            }

            public void charactersBlancodbdotnetCommon(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: blancodbdotnet-common[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceBlancodbdotnetCommon(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementQueryType(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: query-type");
            }

            public void endElementQueryType(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: query-type");
            }

            public void charactersQueryType(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: query-type[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceQueryType(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementSingle(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: single");
            }

            public void endElementSingle(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: single");
            }

            public void charactersSingle(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: single[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceSingle(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementName(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: name");
            }

            public void endElementName(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: name");
            }

            public void charactersName(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: name[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceName(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementBlancodbdotnetInparameters(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: blancodbdotnet-inparameters");
            }

            public void endElementBlancodbdotnetInparameters(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: blancodbdotnet-inparameters");
            }

            public void charactersBlancodbdotnetInparameters(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: blancodbdotnet-inparameters[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceBlancodbdotnetInparameters(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementInparameter(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: inparameter");
            }

            public void endElementInparameter(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: inparameter");
            }

            public void charactersInparameter(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: inparameter[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceInparameter(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementNo(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: no");
            }

            public void endElementNo(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: no");
            }

            public void charactersNo(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: no[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceNo(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementType(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: type");
            }

            public void endElementType(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: type");
            }

            public void charactersType(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: type[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceType(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementDescription(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: description");
            }

            public void endElementDescription(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: description");
            }

            public void charactersDescription(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: description[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceDescription(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementSamplevalue(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: samplevalue");
            }

            public void endElementSamplevalue(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: samplevalue");
            }

            public void charactersSamplevalue(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: samplevalue[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceSamplevalue(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementBlancodbdotnetDetail(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: blancodbdotnet-detail");
            }

            public void endElementBlancodbdotnetDetail(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: blancodbdotnet-detail");
            }

            public void charactersBlancodbdotnetDetail(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: blancodbdotnet-detail[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceBlancodbdotnetDetail(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementDetailLine(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: detail-line");
            }

            public void endElementDetailLine(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: detail-line");
            }

            public void charactersDetailLine(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: detail-line[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceDetailLine(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementBlancodbdotnetQuery(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: blancodbdotnet-query");
            }

            public void endElementBlancodbdotnetQuery(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: blancodbdotnet-query");
            }

            public void charactersBlancodbdotnetQuery(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: blancodbdotnet-query[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceBlancodbdotnetQuery(char[] ch, int start, int length) throws SAXException {
            }

            public void startElementQueryLine(String uri, String localName, String qName) throws SAXException {
                System.out.println("start: query-line");
            }

            public void endElementQueryLine(String uri, String localName, String qName) throws SAXException {
                System.out.println("end: query-line");
            }

            public void charactersQueryLine(char[] ch, int start, int length) throws SAXException {
                System.out.println("characters: query-line[" + new String(ch, start, length) + "]");
            }

            public void ignorableWhitespaceQueryLine(char[] ch, int start, int length) throws SAXException {
            }

        });

        InputStream inStream = null;
        try {
            inStream = new BufferedInputStream(new ByteArrayInputStream(fXmlImage.getBytes()));
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer transformer = tf.newTransformer();
            transformer.transform(new StreamSource(inStream), result);
        } finally {
            if (inStream != null) {
                inStream.close();
            }
        }
    }
}
