Examples of TestDOMOutputBuffer


Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

     * Test the method: checkpaneCellAttributes.
     */
    public void notestCheckPaneCellAttributes() throws Exception {
        Pane pane = new Pane(null);
        PaneAttributes attributes = new PaneAttributes();
        TestDOMOutputBuffer dom = new TestDOMOutputBuffer();

        Element element = dom.openStyledElement("td", attributes);

        attributes.setPane(pane);
       
        // No width set, return DO_NOTHING.
        PaneRendering result;
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

    private void privateSetUp() {
        canvasLayout = new CanvasLayout();
        //testable.setSupportsAccessKeyAttribute(false);
        element = domFactory.createElement();
        element.setName(elementName);
        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();
        testable.setCurrentBuffer(null, buffer);
        pageContext = new TestMarinerPageContext();
        pageContext.setFormFragmentResetState(true);
        pageContext.setProtocol(protocol);
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

                             title + "\">" + caption + "</anchor>"));
        // Iterate over the tests and an check the expected result equals
        // the actual result.
        for (int i = 0; i < tests.size(); i++) {
            Values values = (Values) tests.get(i);
            buffer = new TestDOMOutputBuffer();

            protocol.setMarinerPageContext(mpc);
            testable.setSupportsAccessKeyAttribute(values.supportsAccessKeys);
            //@todo need to reenable this check?
            //assertEquals(protocol.supportsAccessKeyAttribute(), values.supportsAccessKeys);
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

     */
    public void testAddPostFieldValueAttributes() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setValue("value");
        protocol.addPostField(buffer, attributes);
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

     */
    public void testAddPostFieldClientVariableName() throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setClientVariableName("clientVariableName");
        protocol.addPostField(buffer, attributes);
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

             throws Exception {
        privateSetUp();
        XFImplicitAttributes attributes = new XFImplicitAttributes();

        // Test that clientVariableName takes precedence over value
        buffer = new TestDOMOutputBuffer();
        document = domFactory.createDocument();

        attributes.setName("name");
        attributes.setValue("value");
        attributes.setClientVariableName("clientVariableName");
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

            builder.setHref(new LiteralLinkAssetReference(href));

            builder.startLabel();
   
            builder.startText();
            DOMOutputBuffer dom = new TestDOMOutputBuffer();
            dom.writeText(text);
            builder.setText(dom);
            builder.endText();
           
            builder.endLabel();
   
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

                    }
                };
        OpenWaveNumericShortcutFragmentLinkRenderer renderer =
                new OpenWaveNumericShortcutFragmentLinkRenderer(context);
       
        DOMOutputBuffer buffer = new TestDOMOutputBuffer();
        String href = "href";
        String text = "text";
        FraglinkAttributes attrs = new FraglinkAttributes();
        attrs.setHref(href);
        final DOMOutputBuffer outputBuffer = new DOMOutputBuffer();
        outputBuffer.writeText(text);
        attrs.setLinkText(outputBuffer);
        final StylingFactory factory = StylingFactory.getDefaultInstance();
        attrs.setStyles(factory.createStyles(factory.createPropertyValues(
                StylePropertyDetails.getDefinitions())));
        renderer.doFragmentLink(buffer, attrs);

        StyledDOMTester tester = new StyledDOMTester();

        String expected =
                "<BLOCK style='white-space: nowrap'>" +
                  "<select title=\"x\">" +
                    "<option onpick=\"" + href + "\" title=\"x\">" +
                      text +
                    "</option>" +
                  "</select>" +
                "</BLOCK>";
        String actual = tester.render(buffer.getRoot());
        assertEquals("Openwave Fragment Link not rendering correctly",
                tester.normalize(expected), actual);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

        // Create a plain text label.
        builder.startLabel();
        builder.startText();

        // Set the text.
        buffer = new TestDOMOutputBuffer();
        buffer.writeText("item 1");
        builder.setText(buffer);

        builder.endText();
        builder.endLabel();

        builder.endMenuItem();

        // Create the second menu item explicitly targeted at a different pane.
        builder.startMenuItem();

        // Set the style.
        builder.setElementDetails("menuitem", null,
                StylesBuilder.getInitialValueStyles());

        // Set the href.
        builder.setHref(new LiteralLinkAssetReference("href2.xml"));

        // Set the pane.
        builder.setPane(ITEM2_PANE);

        // Create a plain text label.
        builder.startLabel();
        builder.startText();

        // Set the text.
        buffer = new TestDOMOutputBuffer();
        buffer.writeText("item 2");
        builder.setText(buffer);

        builder.endText();
        builder.endLabel();
View Full Code Here

Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

     * Setup the unit test framework by creating some classes ensuring that each
     * test case starts off with a clean slate to work from
     */
    private void privateSetUp() {
        protocol.setMarinerPageContext(new TestMarinerPageContext());
        buffer = new TestDOMOutputBuffer();
        buffer.initialise();
        document = domFactory.createDocument();
        testable.setCurrentBuffer(null, buffer);
    }
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.