Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Node


        privateSetUp();

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        ShardLinkAttributes attributes = new ShardLinkAttributes();
        Element anchor;
        Node node;
        String styleClass;

        buffer.initialise();
        attributes.setHref("http://www.volantis.com/page");
        attributes.setLinkText("Next");
View Full Code Here


        doTestBufferSelector(selector, null, null, false, false, true);

        // Test with valid entry pane and null caption pane.
        // Expected: entryPaneNode != null AND captionPaneNode == null AND
        //           entryBuffer == captionBuffer != null
        Node entry = domFactory.createElement();
        selector = protocol.createBufferSelector(
                entry, null, null, null, null);
        doTestBufferSelector(selector, null, entry, true, true, true);

        // Test with null entry pane and valid caption pane.
        // Expected: entryPaneNode == captionPaneNode != null AND
        //           entryBuffer == captionBuffer != null
        Node caption = domFactory.createElement();
        selector = protocol.createBufferSelector(
                null, caption, null, null, null);
        doTestBufferSelector(selector, caption, null, true, true, true);

        // Test with null entry pane and valid caption pane.
View Full Code Here

        Element onevent = domFactory.createElement();
        Element pre = domFactory.createElement();
        Element _do = domFactory.createElement();
        Element table = domFactory.createElement();
        boolean result;
        Node child;
        int count = 0;
        String[] expected = {"BLOCK", "timer", "onevent", "do", "BLOCK"};
        List actual = new ArrayList();

        card.setName("card");
        p.setName("BLOCK");
        timer.setName("timer");
        onevent.setName("onevent");
        pre.setName("pre");
        _do.setName("do");
        table.setName("table");

        card.addTail(p);
        card.addTail(timer);
        card.addTail(onevent);
        card.addTail(_do);
        card.addTail(pre);
        card.addTail(table);

        result = transformer.addBlocks(card);

        assertTrue("card should contain paragraphs",
                   result);

        child = card.getHead();
        while (child != null) {
            count++;

            if (child instanceof Element) {
                actual.add(((Element)child).getName());
            }

            child = child.getNext();
        }

        assertEquals("number of card children not as",
                     expected.length,
                     count);
View Full Code Here

     * todo simplify this so that instead of subclassing and creating a
     * todo transformer that it just creates the visitor directly and tests
     * todo that. Much simpler.
     */
    public void testMatches() throws Exception{
        Node node = null;
        MyXHTMLBasicMIB2_1Transformer transformer =
                new MyXHTMLBasicMIB2_1Transformer();
        DOMProtocol protocol = createProtocol();

        transformer.initialize(protocol);
View Full Code Here

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        ShardLinkAttributes attributes = new ShardLinkAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        Element anchor;
        Node node;

        buffer.initialise();
        attributes.setHref("http://www.volantis.com/page");
        attributes.setLinkText("Next");
        attributes.setShortcut("N");
View Full Code Here

        doTestBufferSelector(selector, null, null, false, false, true);

        // Test with valid entry pane and null caption pane.
        // Expected: entryPaneNode != null AND captionPaneNode == null AND
        //           entryBuffer == captionBuffer != null
        Node entry = domFactory.createElement();
        selector = protocol.createBufferSelector(
            entry, null, null, null, null);
        doTestBufferSelector(selector, null, entry, true, true, true);

        // Test with null entry pane and valid caption pane.
        // Expected: entryPaneNode == captionPaneNode != null AND
        //           entryBuffer == captionBuffer != null
        Node caption = domFactory.createElement();
        selector = protocol.createBufferSelector(
            null, caption, null, null, null);
        doTestBufferSelector(selector, caption, null, true, true, true);

        // Test with null entry pane and valid caption pane.
View Full Code Here

   
    /**
     * Test the basic behaviour of the WBSAXIgnoreElementProcessor.
     */
    public void testIgnoreElement() throws Exception {
        Node node = parseXml("<p><ignore><br/></ignore></p>");
       
        StringWriter out = new StringWriter();
        context.setContentHandler(new TestDebugProducer(out));
        outputter.addSpecialElementProcessor("ignore",
                new WBSAXIgnoreElementProcessor(context));
        node.accept(outputter);
        // Check for <p><br/></p>
        assertEquals("",
                "[se:(c:p),false,true]" +
                    "[sc]" +
                        "[se:(c:br),false,false]" +
View Full Code Here

     * Test the basic behaviour of WBSAXAccesskeyAnnotationElementProcessor.
     *
     * todo: later: split into it's own test case class.
     */
    public void testAccesskeyAnnotationElement() throws Exception {
        Node node = parseXml("<p><ak><a accesskey=\"x\">x abc</a></ak></p>");
       
        StringWriter out = new StringWriter();
        context.setContentHandler(new TestDebugProducer(out));
        outputter.addSpecialElementProcessor("ak",
                new WBSAXAccesskeyAnnotationElementProcessor(context, true));
        node.accept(outputter);
        // Check for <p><a accesskey="{opaque}">{opaque}abc</a></p>
        // The access key opaque values created by above cannot be rendered
        // until they have a value. For now we just check for the exception in
        // it's place as we are not testing the opaque value's behaviour.
        assertEquals("",
View Full Code Here

        assertEquals("Element's name attribute incorrect:",
                     name,
                     element.getAttributeValue("name"));

        if (elementShouldBeTransformed) {
            Node text = element.getHead();
            assertTrue(text instanceof Text);

            String str = (new String(((Text)text).getContents())).trim();
            assertEquals(str, caption);
        }
View Full Code Here

        buffer.initialise();
        TestMarinerPageContext context = new TestMarinerPageContext();
        ScriptAssetReference scriptObject = getDefaultScriptValue();
        Script script = createScript(context, scriptObject);
        script.appendTo(buffer);
        Node node = buffer.getRoot().getHead();
        checkAppendToResult(node);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.Node

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.