Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.TestMarinerPageContext


        TestMarinerRequestContext requestContext = new TestMarinerRequestContext();
        ContextInternals.setEnvironmentContext(requestContext,
                new TestEnvironmentContext());

        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        FormDescriptor fd = new FormDescriptor();
        String formSpecifier =
                pageContext.getFormDataManager().getFormSpecifier(fd);
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        pageContext.pushRequestContext(requestContext);
        protocol.setMarinerPageContext(pageContext);

        String result = protocol.getInitialValue(attributes);
        assertEquals(null, result);
View Full Code Here


     * @throws Exception
     */
    public void notestInitialisePreferredLocationFor() throws Exception {
        Volantis volantis = getVolantis();

        TestMarinerPageContext context = new TestMarinerPageContext();
        context.pushRequestContext(new TestMarinerRequestContext());
        context.setVolantis(volantis);
        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevice(InternalDeviceTestHelper.createTestDevice());
        context.setDevicePolicyValue(
            DevicePolicyConstants.STYLESHEET_LOCATION_DEVICE,
            null);

        context.setDevicePolicyValue(
            DevicePolicyConstants.STYLESHEET_LOCATION_LAYOUT,
            DevicePolicyConstants.STYLESHEET_RENDER_INTERNAL);

        context.setDevicePolicyValue(
            DevicePolicyConstants.STYLESHEET_LOCATION_THEME,
            DevicePolicyConstants.STYLESHEET_RENDER_EXTERNAL);

        protocol.initialise();

View Full Code Here

        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        pageContext.pushRequestContext(requestContext);
    }

    protected TestMarinerPageContext getPageContext() {
        return (new TestMarinerPageContext() {
            Stack privateStack = new Stack();
            public void popElement(PAPIElement expectedElement) {
                privateStack.pop();
            }
View Full Code Here

     * @param expected the expected support setting
     */
    protected void doAccesskeySupportTest(String accesskeyValue,
                                        boolean expected) {
        Volantis volantis = getVolantis();
        TestMarinerPageContext context = new TestMarinerPageContext();
        context.pushRequestContext(new TestMarinerRequestContext());
        context.setVolantis(volantis);
        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevice(InternalDeviceTestHelper.createTestDevice());

        context.setDevicePolicyValue(
                DevicePolicyConstants.ACCESSKEY_SUPPORTED,
                accesskeyValue);


        protocol.initialiseAccessKeySupport();
View Full Code Here

    public void testInitialiseDiallingLinkWithPrefix() throws Exception {
        final String prefix = "prefix:";

        Volantis volantis = getVolantis();
        TestMarinerPageContext context = new TestMarinerPageContext();
        context.pushRequestContext(new TestMarinerRequestContext());

        context.setVolantis(volantis);
        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevice(InternalDeviceTestHelper.createTestDevice());

        context.setBooleanDevicePolicyValue(
            DevicePolicyConstants.SUPPORTS_LINK_DIALLING,
            true);

        context.setDevicePolicyValue(
            DevicePolicyConstants.LINK_DIALLING_INFO_TYPE,
            DevicePolicyConstants.LINK_DIALLING_INFO_TYPE_PREFIX);

        context.setDevicePolicyValue(
            DevicePolicyConstants.LINK_DIALLING_INFO,
            prefix);

        protocol.initialiseDiallingLink();
View Full Code Here

        assertNull("resolution with no support should return null",
                   protocol.resolveQualifiedFullNumber(phoneNumber));
    }

    public void testResolvePhoneNumberAttributes() throws Exception {
        TestMarinerPageContext context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);

        PhoneNumberAttributes attributes =
            createPhoneNumberAttributes(phoneNumberReference);

        protocol.supportsDiallingLinks = true;
View Full Code Here

            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");
        protocol.setMarinerPageContext(context);
        context.setDevice(InternalDeviceTestHelper.createTestDevice());

        FraglinkAttributes attrs = new FraglinkAttributes();
        attrs.setStyles(StylesBuilder.getEmptyStyles());
        FragmentLinkRenderer renderer = null;
View Full Code Here

    /**
     * Tests that the default mime type for the protocol is returned if the
     * device doesn't specify an overriding policy value.
     */
    public void testMimeTypeDevicePolicyValueNull() throws Exception {
        TestMarinerPageContext context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevicePolicyValue(DevicePolicyConstants.PROTOCOL_MIME_TYPE,
                                     null);

        assertEquals("mime type not as",
                     protocol.defaultMimeType(),
                     protocol.mimeType());
View Full Code Here

    /**
     * Tests that the default mime type for the protocol is returned if the
     * device doesn't specify an overriding policy value.
     */
    public void testMimeTypeDevicePolicyValueEmpty() throws Exception {
        TestMarinerPageContext context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevicePolicyValue(DevicePolicyConstants.PROTOCOL_MIME_TYPE,
                                     "");

        assertEquals("mime type not as",
                     protocol.defaultMimeType(),
                     protocol.mimeType());
View Full Code Here

    /**
     * Tests that the default mime type for the protocol is returned if the
     * device doesn't specify a valid overriding policy value.
     */
    public void testMimeTypeDevicePolicyValueNoSlash() throws Exception {
        TestMarinerPageContext context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);
        context.setProtocol(protocol);
        context.setDevicePolicyValue(DevicePolicyConstants.PROTOCOL_MIME_TYPE,
                                     "invalidMimeType");

        assertEquals("mime type not as",
                     protocol.defaultMimeType(),
                     protocol.mimeType());
View Full Code Here

TOP

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

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.