Package org.milyn.edisax

Examples of org.milyn.edisax.MockContentHandlerNS


   
    UNEdifactInterchangeParser parser = new UNEdifactInterchangeParser();
    parser.setMappingsRegistry(new DefaultMappingsRegistry(model1, model2));
    parser.ignoreNewLines(true);

    MockContentHandlerNS handler;
   
    // Test message 01 - no UNA segment...
    handler = new MockContentHandlerNS();
        NamespaceDeclarationStack namespaceDeclarationStack = new NamespaceDeclarationStack(parser);

        parser.setContentHandler(new NamespaceAwareHandler(handler, namespaceDeclarationStack));
    parser.parse(new InputSource(getClass().getResourceAsStream("unedifact-msg-01.edi")));   
    //System.out.println(handler.xmlMapping);
        XMLUnit.setIgnoreWhitespace( true );
        XMLAssert.assertXMLEqual(new InputStreamReader(getClass().getResourceAsStream("unedifact-msg-expected-01.xml")), new StringReader(handler.xmlMapping.toString()));

    // Test message 01 - has a UNA segment...
    handler = new MockContentHandlerNS();
    parser.setContentHandler(handler);   
    parser.parse(new InputSource(getClass().getResourceAsStream("unedifact-msg-02.edi")));
   
//    System.out.println(handler.xmlMapping);
        XMLUnit.setIgnoreWhitespace( true );
View Full Code Here


   
    UNEdifactInterchangeParser parser = new UNEdifactInterchangeParser();
    parser.setMappingsRegistry(new DefaultMappingsRegistry(model1, model2));
    parser.ignoreNewLines(true);

    MockContentHandlerNS handler;
   
    // Test message 01 - no UNA segment...
    handler = new MockContentHandlerNS();
        NamespaceDeclarationStack namespaceDeclarationStack = new NamespaceDeclarationStack(parser);
        parser.setContentHandler(new NamespaceAwareHandler(handler, namespaceDeclarationStack));
    parser.parse(new InputSource(getClass().getResourceAsStream("unedifact-msg-04.edi")));
    //System.out.println(handler.xmlMapping);
        XMLUnit.setIgnoreWhitespace( true );
View Full Code Here

TOP

Related Classes of org.milyn.edisax.MockContentHandlerNS

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.