Examples of TestMarinerPageContext


Examples of com.volantis.mcs.context.TestMarinerPageContext

     * Test the protocols doImplicitValue
     */
    public void testDoImplicitValue() throws Exception {
        DOMOutputBuffer buffer = getNewDOMOutputBuffer();

        TestMarinerPageContext context = new TestMarinerPageContext();
        protocol.setMarinerPageContext(context);

        XMLReader reader = DOMUtilities.getReader();

        XFImplicitAttributes attributes = new XFImplicitAttributes();
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    /**
     * 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() {
        context = new TestMarinerPageContext();
        TestMarinerRequestContext requestContext =
                new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext, context);
        context.pushRequestContext(requestContext);

View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    /**
     * Test the method: closePane
     */
    public void testClosePane() throws Exception {
        context = new TestMarinerPageContext();
        protocol.setMarinerPageContext(context);
        TestDeviceLayoutContext deviceContext = new TestDeviceLayoutContext();
        context.pushDeviceLayoutContext(deviceContext);

        DOMOutputBuffer dom = new DOMOutputBuffer();
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

            final String expectedUnstyledAttributes,
            final String expectedStyledAttributes,
            final String expectedStylesheetAttributes)
            throws Exception {

        context = new TestMarinerPageContext();
        TestMarinerRequestContext requestContext1 =
                new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext1, context);
        context.pushRequestContext(requestContext1);
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

        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);
        TestMarinerRequestContext requestContext = new TestMarinerRequestContext();
        pageContext.pushRequestContext( requestContext );
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

     * Test the openAction method
     */
    public void testOpenAction() {
        privateSetUp();

        TestMarinerPageContext mpc = new TestMarinerPageContext();
        mpc.pushRequestContext( new TestMarinerRequestContext());

        ProtocolsConfiguration config = new ProtocolsConfiguration();
        config.setWmlPreferredOutputFormat("wmlc");
        Volantis bean = new Volantis();
        bean.setProtocolsConfiguration(config);
        mpc.setVolantis(bean);

        /**
         * Inner class that may be used to iterate through tests in the
         * specified order.
         */
        class Values {
            XFActionAttributes attributes;
            boolean inline = false;
            boolean supportsAccessKeys = false;
            String expected = null;

            Values(boolean inline,
                   boolean supportsAccessKeys,
                   String expected) {
                this(inline, supportsAccessKeys, null, expected);
            }
            Values(boolean inline,
                   boolean supportsAccessKeys,
                   String shortcut,
                   String expected) {
                this(inline, supportsAccessKeys, shortcut, null, null, expected);
            }
            Values(boolean inline,
                   boolean supportsAccessKeys,
                   int tabIndex,
                   String expected) {
                this(inline, supportsAccessKeys, null, expected);
                attributes.setTabindex(Integer.toString(tabIndex));
            }

            Values(boolean inline,
                   boolean supportsAccessKeys,
                   String shortcut,
                   String title,
                   String caption,
                   String expected) {

                this.inline = inline;
                this.supportsAccessKeys = supportsAccessKeys;
                this.expected = expected;
                attributes = new XFActionAttributes();
                attributes.setStyles(StylesBuilder.getInitialValueStyles());
                attributes.setShortcut(new LiteralTextAssetReference(shortcut));
                attributes.setCaption(new LiteralTextAssetReference(caption));
                attributes.setTitle(title);
            }
        }

        List tests = new ArrayList();

        // Test anchor generation (not inline)
        tests.add(new Values(false, false,
                             "<do name=\"" + mpc.generateWMLActionID() +
                             "\" type=\"accept\"/>"));

        // Test the tabindex addition
        tests.add(new Values(false, false, 8,
                                     "<do name=\"" + mpc.generateWMLActionID() +
                                     "\" type=\"accept\" tabindex=\"8\"/>"));
        // Test anchor generation (inline)
        tests.add(new Values(true, false,
                             "<anchor/>"));

        // Test shortcut accesskey attribute (accesskeys not allowed)
        tests.add(new Values(true, false, "shortcut",
                             "<anchor/>"));

        // Test shortcut accesskey attribute (accesskeys allowed)
        tests.add(new Values(true, true, "shortcut",
                             "<anchor accesskey=\"shortcut\"/>"));

        // Test caption generation (not inline)
        String caption = "Not Inline Caption";
        tests.add(new Values(false, false, null, null, caption,
                             "<do label=\"" + caption + "\" name=\"" +
                             mpc.generateWMLActionID() + "\" " +
                             "type=\"accept\"/>"));

        // Test caption generation (inline)
        caption = "Inline Caption";
        tests.add(new Values(true, false, null, null, caption,
                             "<anchor>" + caption + "</anchor>"));

        // Test caption generation (inline and acceskeys allowed)
        caption = "Inline Caption";
        tests.add(new Values(true, true, "shortcut", null, caption,
                             "<anchor accesskey=\"shortcut\">" + caption +
                             "</anchor>"));

        // Test title generation (not inline)
        String title = "Not Inline Title";
        tests.add(new Values(false, false, null, title, null,
                             "<do label=\"" + title + "\" name=\"" +
                             mpc.generateWMLActionID() + "\" " +
                             "type=\"accept\"/>"));

        // Test title generation (inline)
        title = "Inline Title";
        tests.add(new Values(true, false, null, title, null,
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    public void testSpatialFormatIteratorRowContainingTag() throws Exception {
        privateSetUp();

        MarinerRequestContext requestContext
                = new TestMarinerRequestContext();
        TestMarinerPageContext context = new TestMarinerPageContext();
        context.pushRequestContext(requestContext);
        protocol.setMarinerPageContext(context);

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();
        context.setCurrentOutputBuffer(buffer);

        SpatialFormatIteratorAttributes attributes =
                new SpatialFormatIteratorAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

        // Activate the device layout.
        RuntimeDeviceLayout runtimeDeviceLayout =
                RuntimeDeviceLayoutTestHelper.activate(canvasLayout);

        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        context = new TestMarinerPageContext();
        context.pushRequestContext(requestContext);
        context.setDeviceLayout(runtimeDeviceLayout);

        DeviceLayoutContext deviceContext = new DeviceLayoutContext();
        deviceContext.setDeviceLayout(runtimeDeviceLayout);
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    /**
     * 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

Examples of com.volantis.mcs.context.TestMarinerPageContext

    public void testDoHorizontalRuleEmulationOn() throws Exception {
        privateSetUp();
        protocol.emulateHorizontalTag = true;
        assertTrue("Emulation should be on", protocol.emulateHorizontalTag);

        pageContext = new TestMarinerPageContext();
        pageContext.setProtocol(protocol);
        pageContext.setDevicePolicyValue("charactersx", "10");
        protocol.doHorizontalRule(buffer, null);
        document.addNode(buffer.getRoot());
        String output = DOMUtilities.toString(
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.