Examples of TestDOMOutputBuffer


Examples of com.volantis.mcs.protocols.TestDOMOutputBuffer

     * This tests the start and end methods with no content between them to
     * ensure correct output generation.
     */
    public void testEmptyStartAndEnd() throws Exception {
        // Create the test buffer
        TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();

        // Create the renderer
        DefaultNumericShortcutEmulationRenderer renderer =
                new DefaultNumericShortcutEmulationRenderer(customisation);

        // Test the start call
        renderer.start(buffer);

        // Test the end call
        renderer.end(buffer);

        // Create expected
        String required = "<" + AccesskeyConstants.ACCESSKEY_ANNOTATION_ELEMENT + "/>";
        String expected = DOMUtilities.provideDOMNormalizedString(required);

        // Check state of buffer
        assertFalse("Should be contents in the buffer", buffer.isEmpty());

        // Extract the output from the menu rendering as a string.
        String actual = DOMUtilities.toString(buffer.getRoot());
        assertNotNull("The actual string should exist", actual);

        // Compare state and expected
        assertEquals("Strings should match", expected, actual);
    }
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.