Examples of SDLDocumentAdaptor


Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

public class TestSDLDocumentAdaptor extends HiveMindTestCase
{
    public void testMinimalDocument() throws Exception
    {
        Document d = createDocument();
        SDLDocumentAdaptor adaptor = new SDLDocumentAdaptor(d);

        AttributesImpl a = new AttributesImpl();

        adaptor.startElement(null, "module", null, a);
        adaptor.endElement(null, "module", null);

        Element e = d.getDocumentElement();

        assertEquals("module", e.getTagName());
    }
View Full Code Here

Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

    }

    public void testNodeContent() throws Exception
    {
        Document d = createDocument();
        SDLDocumentAdaptor adaptor = new SDLDocumentAdaptor(d);

        AttributesImpl a = new AttributesImpl();

        adaptor.startElement(null, "module", null, a);

        adaptor.characters("text".toCharArray(), 0, 4);

        a = new AttributesImpl();

        adaptor.startElement(null, "fred", null, a);
        adaptor.endElement(null, "fred", null);
        adaptor.endElement(null, "module", null);

        Element e = d.getDocumentElement();
        assertEquals("module", e.getTagName());

        CDATASection cd = (CDATASection) e.getFirstChild();
View Full Code Here

Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

    }

    public void testAttributes() throws Exception
    {
        Document d = createDocument();
        SDLDocumentAdaptor adaptor = new SDLDocumentAdaptor(d);

        AttributesImpl a = new AttributesImpl();
        a.addAttribute(null, "id", null, "CDATA", "foo.bar.baz");

        adaptor.startElement(null, "module", null, a);
        adaptor.endElement(null, "module", null);

        Element e = d.getDocumentElement();
        assertEquals("module", e.getTagName());

        assertEquals("foo.bar.baz", e.getAttribute("id"));
View Full Code Here

Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

    }

    public void testParse() throws Exception
    {
        Document d = createDocument();
        SDLDocumentAdaptor adaptor = new SDLDocumentAdaptor(d);

        Resource r = getResource("Sample.sdl");

        adaptor.parse(r);

        Element e = d.getDocumentElement();
        assertEquals("module", e.getTagName());

        assertEquals("hivemind", e.getAttribute("id"));
View Full Code Here

Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

    private Document parseSDL(DocumentBuilder builder, Resource descriptor)
        throws SAXParseException, IOException
    {
        Document result = builder.newDocument();
        SDLDocumentAdaptor parser = new SDLDocumentAdaptor(result);

        parser.parse(descriptor);

        return result;
    }
View Full Code Here

Examples of org.apache.hivemind.sdl.SDLDocumentAdaptor

    private Document parseSDL(DocumentBuilder builder, Resource descriptor)
        throws SAXParseException, IOException
    {
        Document result = builder.newDocument();
        SDLDocumentAdaptor parser = new SDLDocumentAdaptor(result);

        parser.parse(descriptor);

        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.