Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.TestDOMProtocol


    public static class TestDOMProtocolFactory extends DOMProtocolFactory {

        public VolantisProtocol createProtocol(
                ProtocolSupportFactory supportFactory,
                ProtocolConfiguration configuration) {
            return new TestDOMProtocol(supportFactory, configuration);
        }
View Full Code Here


    private TransformingVisitor createVisitor() {

        InternalDevice internalDevice = InternalDeviceTestHelper.createTestDevice();

        ProtocolBuilder builder = new ProtocolBuilder();
        TestDOMProtocol protocol = (TestDOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);
        TestMarinerPageContext context = new TestMarinerPageContext();
        context.setDevicePolicyValue(DevicePolicyConstants.FIX_FOR_OPEN_INLINE_STYLING_ELEMENTS,
                                     DevicePolicyConstants.WHITESPACE_INSIDE);
        context.setDevicePolicyValue(DevicePolicyConstants.FIX_FOR_CLOSING_INLINE_STYLING_ELEMENTS,
                                     DevicePolicyConstants.WHITESPACE_INSIDE);
        context.setDevicePolicyValue(DevicePolicyConstants.FIX_FOR_OPEN_ANCHOR_ELEMENT,
                                     DevicePolicyConstants.WHITESPACE_INSIDE_AND_OUTSIDE);
        context.setDevicePolicyValue(DevicePolicyConstants.FIX_FOR_CLOSING_ANCHOR_ELEMENT,
                                     DevicePolicyConstants.NON_BREAKING_SPACE_OUTSIDE);

        protocol.setMarinerPageContext(context);
        Set inlineStyleElements = new HashSet();
        inlineStyleElements.add("strong");
        inlineStyleElements.add("i");
        Set inlineLinkElements = new HashSet();
        inlineLinkElements.add("a");
View Full Code Here

     * for the com.volantis.mcs.protocols.html.xhtmlfull.XHTMLFullTransFactory
     * class.
     */
    public void testGetMapper() throws Exception {
        ProtocolBuilder builder = new ProtocolBuilder();
        TestDOMProtocol protocol = (TestDOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);

        final TransFactory factory = getFactory();
        // default is true for nested table support.
        assertTrue("There should not be mapper if nested tables are supported",
                factory.getMapper(protocol) == null);

        protocol.setSupportsNestedTables(true);
        assertTrue("There should not be mapper if nested tables are supported",
                factory.getMapper(protocol) == null);

        protocol.setSupportsNestedTables(false);
        assertTrue("There should be a mapper if nested tables are not supported",
                factory.getMapper(protocol) != null);
    }
View Full Code Here

     *
     * @throws Exception
     */
    public void testRedundantTableRemovalNestedDisabled() throws Exception {
        // Use TestDOMProtocol so we can vary the nested table support easily.
        TestDOMProtocol protocol = (TestDOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);
        protocol.setSupportsNestedTables(false);

        String original =
            "<html>" +
              "<body>" +
                "<table border=\"1\">" +
View Full Code Here

     *
     * @throws Exception
     */
    public void testOptimizationNestedDisabled() throws Exception {
        // Use TestDOMProtocol so we can vary the nested table support easily.
        TestDOMProtocol protocol = (TestDOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);
        protocol.setSupportsNestedTables(false);

        // All these tables are optimised away because nested tables are
        // disabled.
        String original =
            "<html>" +
View Full Code Here

     *
     * @throws Exception
     */
    public void testInverseRemapTableRetentionNestedDisabled() throws Exception {
        // Use TestDOMProtocol so we can vary the nested table support easily.
        TestDOMProtocol protocol = (TestDOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);
        protocol.setSupportsNestedTables(false);
        String original =
            "<html xmlns=\"http://www.w3.org/1999/xhtml\">" +
              "<head>" +
                "<title></title>" +
              "</head>" +
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.TestDOMProtocol

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.