Examples of DefaultDevice


Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

        policies.put("multi2", "");
        policies.put("four", "four");
        policies.put("five", "five");
        policies.put("ssversion", "hello, CSS1, CSS2");

        final DefaultDevice defaultDevice =
            new DefaultDevice("device", policies, null);
        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);

        return device;
    }
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

                    session.getMaxInactiveInterval());
        }

        // See if the device has previously been stored in the session and
        // use it if it has.
        DefaultDevice device = (DefaultDevice)
                session.getAttribute(SESSION_DEVICE_NAME);
        // Throw away devices which were constructed via serialisation
        // from persisted sessions, since we do not properly support
        // serialisation for now.
        if (device != null && !device.isValid()) {
            device = null;
        }

        // No device in the session, so we need to ID it.
        if(device == null) {
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

        request = new HttpServletRequestStub();
        context = new TestMarinerPageContext();
        Map policyMap = new HashMap();

        internalDevice = INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice("Test-Device", policyMap, null));
        context.setDevice(internalDevice);
    }
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

    private void check(String[] headers,
                       String deviceCharset,
                       String forcedCharset,
                       String expected) {
        request.setHeaders(headers);
        final DefaultDevice defaultDevice =
            (DefaultDevice) internalDevice.getDevice();
        defaultDevice.setPolicyValue(DevicePolicyConstants.DEFAULT_OUTPUT_CHARSET,
                                      deviceCharset);
        defaultDevice.setPolicyValue(DevicePolicyConstants.FORCED_OUTPUT_CHARSET,
                                      forcedCharset);
        HttpHeaders rHeaders = HttpServletFactory.
                getDefaultInstance().getHTTPHeaders(request);
        String charset = selector.selectCharset(rHeaders,
            (DefaultDevice) context.getDevice().getDevice());
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

        InternalDevice device = null;

        // Get to see if MarinerServletApplication#getDevice has put a device
        // in the session.
        if (session != null) {
            DefaultDevice defaultDevice =
                (DefaultDevice) session.getAttribute(
                    MarinerServletApplication.SESSION_DEVICE_NAME);
            if (defaultDevice != null && defaultDevice.isValid()) {
                device = INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);
            }
            // else, ignore devices which were constructed via serialisation
            // from persisted sessions, since we do not properly support
            // serialisation for now.
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

    protected TestMarinerPageContext createContexts() throws Exception {
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        pageContext.setVolantis(volantis);
        TestEnvironmentContext envContext = new TestEnvironmentContext();

        DefaultDevice dev = new DefaultDevice(null, null, null);
        dev.setName("myDevice");
        dev.setPolicyValue("protocol", "XHTMLBasic");
        MarinerSessionContext session = envContext.getSessionContext();
        InternalDevice internalDevice =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(dev);
        session.setDevice(internalDevice);
        pageContext.setDevice(session.getDevice());
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

            policies.put("pixeldepth", "16");
            policies.put("pixelsx", "640");
            policies.put("gpng16rule", "gp16");

            return INTERNAL_DEVICE_FACTORY.createInternalDevice(
                new DefaultDevice(deviceName, policies, null));
        }
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

        };

        pageContext.initialisePage(volantis, requestContext,
                null, null, null);

        final DefaultDevice dev = new DefaultDevice("myDevice", null, null);
        dev.setPolicyValue("protocol", "XHTMLBasic");
        dev.setPolicyValue("rendermode", "not-monochrome");
        dev.setPolicyValue("pixeldepth", "32");
        dev.setPolicyValue("jpeginpage", "true");
        dev.setPolicyValue("cjpeg24rule", rule);
        dev.setPolicyValue("preferredimagetype", "JPEG");

        // Set width on device.
        if (deviceWidth != 0) {
            dev.setPolicyValue("pixelsx",
                    StringConvertor.valueOf(deviceWidth));
        }

        final InternalDevice internalDevice =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(dev);
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

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

        DefaultDevice device = new DefaultDevice("TestDevice", null, null);
        device.setPolicyValue("ssversion", null);
        pageContext.setDevice(
            INTERNAL_DEVICE_FACTORY.createInternalDevice(device));

        protocol.initialise();
        assertFalse("iMode protocol should not support nested tables",
View Full Code Here

Examples of com.volantis.devrep.repository.api.devices.DefaultDevice

     */
    protected DOMProtocol createProtocol() {

        final ProtocolBuilder builder = new ProtocolBuilder();

        final DefaultDevice defaultDevice =
            new DefaultDevice("Test Device", new HashMap(), null);
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);

        return (DOMProtocol)builder.build(
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.