Package com.volantis.mcs.devices

Examples of com.volantis.mcs.devices.InternalDeviceMock



    protected void setUp() throws Exception {
        super.setUp();
       
        deviceMock = new InternalDeviceMock("deviceMock", expectations);

        deviceMock.fuzzy.getBooleanPolicyValue(mockFactory.expectsAny())
                .returns(false).any();

        initializeTransformer();
View Full Code Here


     *
     * @throws java.io.IOException thrown if DOM cannot be converted to a String
     */
    public void testTransformElementWithEmulatedElements() throws IOException {

        deviceMock = new InternalDeviceMock("deviceMock", expectations);

        populateEmulateEmphasisTags();

        initializeTransformer();
        Document orig = domFactory.createDocument();
        Element wml = generateTestWML();
        orig.addNode(wml);

        transformer.transformElement(wml);

        String expected =
                "<wml>" +
                    "<card title=\"the test title\">" +
                        "<BLOCK>" +
                            "<div>TITLEthe test titleTITLE</div>" +
                        "</BLOCK>" +
                        "<BLOCK align=\"center\">" +
                            "<div>**<a href=\"wtai://wp/mc;20405050606\">20405050606</a>**</div>" +
                            "<div>**<anchor href=\"wtai://wp/mc;20405050606\">20405050606</anchor>**</div>" +
                            "<div>BIGThis is big text.BIG</div>" +
                            "<div>BOLDThis is b text.BOLD</div>" +
                            "<div>EMThis is em text.EM</div>" +
                            "<div>ITALICThis is i text.ITALIC</div>" +
                            "<div>SMALLThis is small text.SMALL</div>" +
                            "<div>STRONGThis is strong text.STRONG</div>" +
                            "<div>_This is u text._</div>" +
                        "</BLOCK>" +
                    "</card>" +
                "</wml>";

        assertEquals(expected, DOMUtilities.toString(orig));

        // And again.
        deviceMock = new InternalDeviceMock("deviceMock", expectations);

        // test that prefixes on their own are correctly rendered
        expectEmphasisTag(DevicePolicyConstants.EMULATE_WML_BOLD_TAG, true,
                "BOLD", "BOLD", null);

        // test that an altTag on its own is correctly rendered
        expectEmphasisTag(DevicePolicyConstants.EMULATE_WML_EMPHASIZE_TAG, true,
                null, null, "div");

        // test that link highlighting without an alternate tag works correctly
        expectEmphasisTag(DevicePolicyConstants.EMULATE_WML_LINK_HIGHLIGHTING,
                true, "**", "**", null);

        // special case - test that card titles with prefixes but no altTag
        // are correctly rendered
        expectEmphasisTag(DevicePolicyConstants.EMULATE_WML_CARD_TITLE, true,
                "TITLE", "TITLE", null);

        populateEmulateEmphasisTags();

        initializeTransformer();

        orig = domFactory.createDocument();
        wml = generateTestWML();
        orig.addNode(wml);

        transformer.transformElement(wml);

        expected =
                "<wml>" +
                    "<card title=\"the test title\">" +
                        "<BLOCK>TITLEthe test titleTITLE</BLOCK>" +
                        "<BLOCK align=\"center\">" +
                            "**<a href=\"wtai://wp/mc;20405050606\">20405050606</a>**" +
                            "**<anchor href=\"wtai://wp/mc;20405050606\">20405050606</anchor>**" +
                            "<div>BIGThis is big text.BIG</div>" +
                            "BOLDThis is b text.BOLD" +
                            "<div>This is em text.</div>" +
                            "<div>ITALICThis is i text.ITALIC</div>" +
                            "<div>SMALLThis is small text.SMALL</div>" +
                            "<div>STRONGThis is strong text.STRONG</div>" +
                            "<div>_This is u text._</div>" +
                        "</BLOCK>" +
                    "</card>" +
                "</wml>";

        assertEquals(expected, DOMUtilities.toString(orig));

        // And again.
        deviceMock = new InternalDeviceMock("deviceMock", expectations);

        // test that prefixes on their own are correctly rendered
        expectEmphasisTag(DevicePolicyConstants.EMULATE_WML_BOLD_TAG, true,
                "BOLD", "BOLD", null);

View Full Code Here

        protocol.setMarinerPageContext(pageContextMock);

        LinkAssetReference reference =
                new LiteralLinkAssetReference(assetURL);

        final InternalDeviceMock deviceMock =
                new InternalDeviceMock("deviceMock", expectations);

        pageContextMock.expects.getRequestURL(false)
                .returns(new MarinerURL("defaultSegment"));
        pageContextMock.expects.getDevice().returns(deviceMock).any();
        deviceMock.expects.getPolicyValue("aggregation").returns("false").any();
View Full Code Here

        final String marqueeSupport = supportsMarquee? "full": "none";
        final String blinkSupport = supportsBlink? "full": "none";
        final String underlineSupport = supportsUnderline? "full": "none";
        final String strikeSupport = supportsStrike? "full": "none";
        device = new InternalDeviceMock("device", expectations);
        builder = new DeviceCapabilityManagerBuilder(device);

        // from DeviceCapabilityManagerBuilder#addHrElementCapabilities
        device.expects.getPolicyValue(
                DeviceCapabilityConstants.HR_SUPPORTED).returns("true").any();
View Full Code Here

                        "transformationConfigurationMock", expectations);

        MarinerPageContextMock pageContextMock = new MarinerPageContextMock(
                "pageContextMock", expectations);

        InternalDeviceMock deviceMock = new InternalDeviceMock(
                "deviceMock", expectations);

        ProtocolConfigurationMock protocolConfigMock =
                new ProtocolConfigurationMock("protocolConfigMock",
                        expectations);
View Full Code Here

        final MutableParameters parameters = COMMON_FACTORY.createMutableParameters();
       
        parameters.setParameterValue(MediaAgent.OUTPUT_URL_PARAMETER_NAME,
                transcodedUrl);
       
        InternalDeviceMock internalDeviceMock =
            new InternalDeviceMock("internal device", expectations);
       
        internalDeviceMock.fuzzy
            .getPolicyValue(mockFactory.expectsAny()).returns(null).any();
        internalDeviceMock.fuzzy
            .getIntegerPolicyValue(mockFactory.expectsAny()).returns(0).any();
View Full Code Here

                expectations);

//        policyAccessorMock = new PolicyAccessorMock("policyAccessorMock",
//                expectations);

        targetDeviceMock = new InternalDeviceMock("targetDeviceMock",
                expectations);

        pcDeviceMock = new InternalDeviceMock("pcDeviceMock", expectations);

        masterDeviceMock = new InternalDeviceMock("masterDeviceMock",
                expectations);

        encodingCollectionMock = new EncodingCollectionMock(
                "encodingCollectionMock", expectations);
View Full Code Here

        protocolConfigurationMock = new ProtocolConfigurationMock(
                "protocolConfigurationMock", expectations);

        elementMock = new ElementMock("element", expectations);

        deviceMock = new InternalDeviceMock("device", expectations);

        validationHelperMock = new ValidationHelperMock("validationHelper",
                expectations);

        marinerRequestContextMock = new MarinerRequestContextMock(
View Full Code Here

TOP

Related Classes of com.volantis.mcs.devices.InternalDeviceMock

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.