Examples of DOMProtocol


Examples of com.volantis.mcs.protocols.DOMProtocol

                                 "DOM comparison failed - Test " + (i+1)));
        }
        Iterator iterator = tests.iterator();
        while (iterator.hasNext()) {
            Values values = (Values) iterator.next();
            DOMProtocol protocol = createProtocol();


            Document dom = getStrictStyledDOMHelper().parse(values.original);
            Document expected = getStrictStyledDOMHelper().parse(values.expected);
            String domAsString;
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

        Element child = domFactory.createElement();
        child.setName("p");
        column.addHead(child);

        MyXHTMLBasicTransformer transformer = new MyXHTMLBasicTransformer();
        DOMProtocol protocol = createProtocol();
        transformer.initialize(protocol);

        transformer.proxyTransformTableCell(column, newParent, forceLineBreak,
                doInlineDiv);
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

     */
    private Element doFlattenTable(Element input, String expected)
            throws Exception {
        Styles originalStyles = input.getStyles();
        MyXHTMLBasicTransformer transformer = new MyXHTMLBasicTransformer();
        DOMProtocol protocol = createProtocol();
        transformer.initialize(protocol);

        Element flattenedTable = transformer.proxyFlattenTable(input, 2, 1);
        assertNotNull("The flattened table should not be null",
                flattenedTable);
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

     * @throws Exception           if anything goes wrong
     */
    private void doTransformTest(String original, String expected)
            throws Exception  {

        DOMProtocol protocol = createProtocol();

        Document originalDOM = helper.parse(original);
        Document expectedDOM = helper.parse(expected);

        XHTMLBasic_MIB2_1Transformer transformer =
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

     */
    public void testMatches() throws Exception{
        Node node = null;
        MyXHTMLBasicMIB2_1Transformer transformer =
                new MyXHTMLBasicMIB2_1Transformer();
        DOMProtocol protocol = createProtocol();

        transformer.initialize(protocol);

        assertTrue(transformer.matches(node, null) == false);
        Element element = domFactory.createElement();
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

    extends XHTMLTransitionalTransVisitorTestCase {
   
    // javadoc inherited from superclass
    protected DOMProtocol createDOMProtocol(InternalDevice internalDevice) {
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestHTMLVersion4_0Factory(),
                internalDevice);
        return protocol;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        TestMarinerRequestContext requestContext = new TestMarinerRequestContext();
        TestEnvironmentContext environmentContext = new TestEnvironmentContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());

        ExpressionContext expressionContext =
                ExpressionFactory.getDefaultInstance().createExpressionContext(
                        null,
                        NamespaceFactory.getDefaultInstance().createPrefixTracker());

        ContextInternals.setEnvironmentContext(requestContext, environmentContext);
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        MCSExpressionHelper.setExpressionContext(requestContext, expressionContext);

        pageContext.pushRequestContext(requestContext);
        pageContext.setProtocol(protocol);

        ExpressionSupport.registerFunctions(expressionContext);
        expressionContext.setProperty(MarinerRequestContext.class,
                                      requestContext,
                                      true);

        protocol.setMarinerPageContext(pageContext);


        // Now can actually do the test.
        String paneName = "caption-pane";
        CanvasLayout canvasLayout =
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

        // Set up the common test environment
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());

        // Set up the protocol (needed for OutputBuffer management)
        // The test implementation avoids the need for an initialized volantis
        // bean, which is jolly handy in this case
        pageContext.setProtocol(protocol);

        // Set the Layout (needed for FormatReference and panes)
        CanvasLayout layout = new CanvasLayout();

        // Activate the device layout.
        RuntimeDeviceLayout runtimeDeviceLayout =
                RuntimeDeviceLayoutTestHelper.activate(layout);

        pageContext.setDeviceLayout(runtimeDeviceLayout);

        final PolicyReferenceResolverMock referenceResolverMock =
                new PolicyReferenceResolverMock("referenceResolverMock",
                        expectations);
        pageContext.setPolicyReferenceResolver(referenceResolverMock);

        // Link everything together
        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        pageContext.pushRequestContext(requestContext);
        protocol.setMarinerPageContext(pageContext);

        // Finally, test the required method
        command.execute(pageContext, element);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

        // configure MCS
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        MarinerRequestContext requestContext = new TestMarinerRequestContext();
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                InternalDeviceTestHelper.createTestDevice());

        pageContext.pushRequestContext(requestContext);
        pageContext.setProtocol(protocol);

        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        protocol.setMarinerPageContext(pageContext);

        // pane setup required by #exprElementStart
        Pane testPane =
                new Pane(new CanvasLayout());
        final String pane = "testPane";
View Full Code Here

Examples of com.volantis.mcs.protocols.DOMProtocol

public class XHTMLBasicTransVisitorTestCase extends TransVisitorTestAbstract {

    // javadoc inherited from superclass
    protected DOMProtocol createDOMProtocol(InternalDevice internalDevice) {
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestXHTMLBasicFactory(),
                internalDevice);
        return protocol;
    }
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.