Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerRequestContext


     * Check the configuration of markup plugins.
     */
    private void checkMCSPlugins() {
        MarinerApplication application = new MarinerApplication(){};
        ApplicationInternals.setVolantisBean(application, volantis);     
        MarinerRequestContext context = new TestMarinerRequestContext();
        ContextInternals.setMarinerApplication(context, application);
        for (int pluginCount=0; pluginCount < 6; pluginCount++) {
            MarkupPluginManager manager = volantis.getMarkupPluginManager();
            InvokeAttributes attrs = new InvokeAttributes();
            attrs.setName("myPlugin" + pluginCount);
View Full Code Here


        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MockMenuModelBuilder menuModelBuilder = new MockMenuModelBuilder();
        pageContext.setMenuBuilder(menuModelBuilder);

        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());
View Full Code Here

    public void testElementStartAddsStyles() throws Throwable {
        MenuItemElementImpl element =
                (MenuItemElementImpl)createTestablePAPIElement();

        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());
View Full Code Here

     */
    public void testModeAttributeWithStyles() throws Exception {
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        TestMarinerPageContext testContext = new TestMarinerPageContext();
        testContext.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, testContext);
        protocol.setMarinerPageContext(testContext);

View Full Code Here

     */
    public void testModeAttributeWithNoStyle() throws Exception {
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        TestMarinerPageContext testContext = new TestMarinerPageContext();
        testContext.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, testContext);
        protocol.setMarinerPageContext(testContext);

View Full Code Here

    public void testElementStartAddsStyles() throws Exception {
        MenuElementImpl element =
                (MenuElementImpl) createTestablePAPIElement();

        // configure MCS
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
View Full Code Here

        // If so, we need to go and get the resource.
        remappedURL = httpResponse.encodeRedirectURL(remappedURL);
        try {
           
            // create MarinerRequestContext instance
            MarinerRequestContext marinerRequestContext = null;
            try {                   
                MarinerServletRequestContext msrc =
                    new MarinerServletRequestContext(
                        filterConfig.getServletContext(), httpRequest, httpResponse);
                marinerRequestContext =                
                    MarinerServletRequestContext.findInstance(httpRequest);                   
            } catch (Exception e) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.warn("Cannot create MarinerRequestContext");
                }
                }

            // Create the web driver configuration - this information
            // comes from mcs-config.xml in normal MCS operation.
            WebDriverConfiguration webdConfig =
                createWebDriverConfig();
           
            // set encoding if available
            // ported from 4.2.0, see vbm 2007070313
            if (marinerRequestContext != null) {
                webdConfig.setCharacterEncoding(
                        marinerRequestContext.getCharacterEncoding());
            }

            // Create a pipeline configuration which knows about the web
            // driver configuration that we've specified, and the default
            // MCS dynamic pipeline configuration.
View Full Code Here

    /**
     * Test the method elementStart.
     */
    public void noTestElementStartAddsStyles() throws Exception {
        // configure MCS
        final MarinerRequestContext requestContext =
                new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(), null);
        final TestMarinerPageContext pageContext = new TestMarinerPageContext();
View Full Code Here

        ProtocolsConfiguration config = new ProtocolsConfiguration();
        config.setWmlPreferredOutputFormat("wml");
        volantis.setProtocolsConfiguration(config);


        MarinerRequestContext requestContext =
                ProtocolTestAbstract.initialiseMarinerRequestContext(
                        expectations);
        pageContext.pushRequestContext(requestContext);

        protocol.setMarinerPageContext(pageContext);
View Full Code Here

        if (!protocol.supportsFragmentation) {
            return;
        }

        // Set up the required contexts
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        TestMarinerPageContext context = new TestMarinerPageContext();
        context.pushRequestContext(requestContext);
        ContextInternals.setMarinerPageContext(requestContext, context);
        testable.setStyleSheetRenderer(CSSStyleSheetRenderer.getSingleton());
        context.setDeviceName("PC-Win32-IE5.5");
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.MarinerRequestContext

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.