Examples of TestMarinerPageContext


Examples of com.volantis.mcs.context.TestMarinerPageContext

        attributes.setMultiple(multipleSelect);
        attributes.setTitle("title");

        MarinerRequestContext requestContext = new TestMarinerRequestContext();

        TestMarinerPageContext context =
            (TestMarinerPageContext)protocol.getMarinerPageContext();

        context.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, context);

        PaneInstance paneInstance = new TestPaneInstance() {
            public OutputBuffer getCurrentBuffer() {
                return buffer;
            }
        };
        context.setFormatInstance(paneInstance);

        protocol.setMarinerPageContext(context);

        WMLDefaultSelectionRenderer renderer =
            (WMLDefaultSelectionRenderer)protocol.getSelectionRenderer(null); // Arguments are only used in WapTV5
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    // javadoc inherited
    protected AbstractMenuRenderer createTestableMenuRenderer() {

        // create and initialise the MarinerPageContext
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MarinerRequestContext requestContext = new TestMarinerRequestContext();

        pageContext.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        PaneInstance paneInstance = new TestPaneInstance() {
            public OutputBuffer getCurrentBuffer() {
                // return the output buffer that the base class has created
                return outputBuffer;
            }
        };
        pageContext.setFormatInstance(paneInstance);

        TestDeviceLayoutContext layoutContext = new TestDeviceLayoutContext();
        layoutContext.setFormatInstance(new Pane(new CanvasLayout()),
                NDimensionalIndex.ZERO_DIMENSIONS, paneInstance);
        pageContext.pushDeviceLayoutContext(layoutContext);
        protocol.setMarinerPageContext(pageContext);

        // create and initialize the MenuRenderContext
        MenuRendererContext rendererContext =
                new MenuRendererContext() {
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

     * Set up the tests in this class
     */
    private void privateSetUp() {
        canvasLayout = new CanvasLayout();

        pageContext = new TestMarinerPageContext();
        format = new Pane(canvasLayout);
        format.setName("pane");
        pageContext.addPaneMapping((Pane)format);
        grid = new Grid(canvasLayout);
        grid.setName("grid");
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() {
        TestMarinerPageContext context = new TestMarinerPageContext();
        TestMarinerRequestContext requestContext =
                new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext, context);
        context.pushRequestContext(requestContext);

        DeviceLayoutContext deviceContext = new TestDeviceLayoutContext();
        canvasLayout = new CanvasLayout();

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

        resetElement();

        attribute = new StyleAttributes();
        attribute.setStyles(StylesBuilder.getDeprecatedStyles());
        attribute.setTitle("My title");

        context.pushDeviceLayoutContext(deviceContext);
        protocol.setMarinerPageContext(context);

        int idx[] = {1, 0};
        NDimensionalIndex index = new NDimensionalIndex(idx);
        PaneInstance paneInstance = new PaneInstance(index);

        paneInstance.setStyleClass("fred");
        context.setFormatInstance(paneInstance);
        context.setDeviceName(NETSCAPE4_DEVICE_NAME);
        PageHead head = new PageHead();
        testable.setPageHead(head);
    }
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

    public void testDoImage() throws Exception {
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        // Needed to allow the call to getTextFromReference within doImage to work
        context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setStyles(StylesBuilder.getInitialValueStyles());
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

     */
    private void privateSetUp() {
        attributes = new HeadingAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        document = domFactory.createDocument();
        pageContext = new TestMarinerPageContext();
        requestContext = new TestMarinerRequestContext();
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        // Strangely, this line is only required in Mimas and not Metis. Weird.
        // I bet Paul knows why. Might be something to do with the
        // ApplicationContext stuff not being in Mimas yet?
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.getInitialValueStyles());
View Full Code Here

Examples of com.volantis.mcs.context.TestMarinerPageContext

                RuntimeDeviceLayoutTestHelper.activate(canvasLayout);
        RuntimeDeviceLayout runtimeDeviceLayout =
                runtimeDeviceLayout1;

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

        DeviceLayoutContext deviceContext = new TestDeviceLayoutContext();
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

    /**
     * Test for doProtocolString
     */
    public void testDoProtocolString() throws IOException, RepositoryException {
        context = new TestMarinerPageContext();
        protocol.setMarinerPageContext(context);

        checkDoProtocolString(protocol, getExpectedProtocolString());
    }
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.