Package com.volantis.devrep.repository.api.devices

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


        final Map policies = new HashMap();
        final String expression = "length(css('width'),'px')";
        policies.put("x-element.img.attribute.foo.expression", expression);
        final String ssversion = DevicePolicyConstants.CSS_WAP;
        policies.put("ssversion", ssversion);
        final DefaultDevice device = createDevice("Master", policies, null);

        final CSSSupportConfigurator configurator =
            new CSSSupportConfigurator(
                INTERNAL_DEVICE_FACTORY.createInternalDevice(device));
        final Map remappableElements = configurator.getFallbackAttributeExpressions();
View Full Code Here


        policies.put("x-element.img.attribute.foo.expression", fooExpression);
        final String barExpression = "length(css('width'),'px')";
        policies.put("x-element.img.attribute.bar.expression", barExpression);
        final String ssversion = DevicePolicyConstants.CSS_WAP;
        policies.put("ssversion", ssversion);
        final DefaultDevice device = createDevice("Master", policies, null);

        final CSSSupportConfigurator configurator =
            new CSSSupportConfigurator(
                INTERNAL_DEVICE_FACTORY.createInternalDevice(device));
        final Map remappableElements = configurator.getFallbackAttributeExpressions();
View Full Code Here

        //       +-+ XHTML-Handset (CSS1)
        //         +-+ Samsung-XHTML (CSS1)
        //           +-+ Samsung-SprintPCS (CSS1)
        //             +-+ Samsung-SPH-A600 (CSS2)

        final DefaultDevice master = createDevice("Master", "none", null);
        final DefaultDevice mobile = createDevice("Mobile", "none", master);
        final DefaultDevice handset = createDevice("Handset", "ll ", mobile);
        final DefaultDevice xhtmlHandset = createDevice("XHTML-Handset",
                DevicePolicyConstants.CSS1, handset);
        final DefaultDevice samsungXHTML = createDevice("Samsung-XHTML",
                DevicePolicyConstants.CSS1, xhtmlHandset);
        final DefaultDevice samsungSprintPCs = createDevice("Samsung-SprintPCS",
                DevicePolicyConstants.CSS1, samsungXHTML);

        final Map samsungA600Policies = new HashMap();
        final String fooExpression = "length(css('width'),'px')";
        samsungA600Policies.put(
            "x-element.img.attribute.foo.expression", fooExpression);
        final String barExpression = "length(css('height'),'px')";
        samsungA600Policies.put(
            "x-element.img.attribute.bar.expression", barExpression);
        samsungA600Policies.put("ssversion", DevicePolicyConstants.CSS2);
        final DefaultDevice samsungA600 = createDevice("Samsung-SPH-A600",
            samsungA600Policies, samsungSprintPCs);

        final CSSSupportConfigurator configurator =
            new CSSSupportConfigurator(
                INTERNAL_DEVICE_FACTORY.createInternalDevice(samsungA600));
View Full Code Here

    DefaultDevice createDevice(String name, Map policyValues,
            DefaultDevice parent) {

        HashMap policies = new HashMap();
        policies.putAll(policyValues);
        DefaultDevice device = new DefaultDevice(name, policies,
            new PolicyValueFactory() {
                public PolicyValue createPolicyValue(
                    DefaultDevice device, String policyName) {
                    return null;
                }
            });
        if (parent != null) {
            device.setFallbackDevice(parent);
        }
        return device;
    }
View Full Code Here

    // Javadoc inherited.
    protected void setUp() throws Exception {
        super.setUp();
        policies = new HashMap();
        DefaultDevice masterDevice =
            new DefaultDevice(
                "Master", policies,
                new PolicyValueFactory() {
                    public PolicyValue createPolicyValue(
                        DefaultDevice device, String policyName) {
                        return null;
View Full Code Here

     * Create XHTMLBasic protocol to test against.
     */   
    protected DOMProtocol createProtocol() {
        ProtocolBuilder builder = new ProtocolBuilder();

        final DefaultDevice defaultDevice =
            new DefaultDevice("device", new HashMap(), null);
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
   
        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);
        DOMProtocol protocol = (DOMProtocol)builder.build(
View Full Code Here

        ProtocolBuilder builder = new ProtocolBuilder();

        ProtocolRegistry.WMLVersion1_3Factory protocolFactory =
                new ProtocolRegistry.WMLVersion1_3Factory();

        final DefaultDevice defaultDevice = (DefaultDevice) device.getDevice();
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.DEVICE_HONOURS_ALIGN_WHEN_MODE_NOWRAP, "true");

        //device.setProtocolConfiguration(protocolFactory.createConfiguration(device));
        device.setProtocolConfiguration(null);
       
View Full Code Here

     */   
    protected DOMProtocol createDOMProtocol() {
       
        ProtocolBuilder builder = new ProtocolBuilder();

        final DefaultDevice defaultDevice = new DefaultDevice("device", null, null);
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_JAVASCRIPT, "true");
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_VFC, "true");
        defaultDevice.setPolicyValue(
            DevicePolicyConstants.SUPPORTS_VFC_SINCE, "4.0.0");

        InternalDevice device =
            INTERNAL_DEVICE_FACTORY.createInternalDevice(defaultDevice);
        return (DOMProtocol)builder.build(
View Full Code Here

    public void testInitialisePage() throws Exception {

        // Prepare mocks and stubs

        InternalDevice device = INTERNAL_DEVICE_FACTORY.createInternalDevice(
            new DefaultDevice(null, null, null));
        final VolantisProtocolMock protocolMock =
                new VolantisProtocolMock("protocolMock", expectations, null);
        final StylingFactoryMock stylingFactoryMock =
                new StylingFactoryMock("stylingFactoryMock", expectations);
        final MarinerRequestContextMock requestContextMock =
View Full Code Here

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

        final DOMProtocol protocol = (DOMProtocol)builder.build(
View Full Code Here

TOP

Related Classes of com.volantis.devrep.repository.api.devices.DefaultDevice

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.