Package com.volantis.mcs.protocols.trans

Examples of com.volantis.mcs.protocols.trans.TransFactory


        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


    /**
     * Simple method test
     */
    public void testGetTable() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);
        Element element = domFactory.createElement();
        TransElement trans = factory.getTable(element, protocol);
       
        assertTrue("getTable returned an instance of " +
                   trans.getClass().getName(),
                   trans instanceof XHTMLBasicTransTable);
    }
View Full Code Here

    /**
     * Simple method test
     */
    public void testGetCell() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);
        Element element = domFactory.createElement();
        TransElement trans = factory.getCell(element, element, 0, 0, null);
       
        assertTrue("getCell returned an instance of " +
                   trans.getClass().getName(),
                   trans instanceof XHTMLBasicTransCell);    }
View Full Code Here

    /**
     * Simple method test
     */
    public void testGetVisitor() throws Exception {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);
        ProtocolBuilder builder = new ProtocolBuilder();
        DOMProtocol protocol = (DOMProtocol) builder.build(
                new TestProtocolRegistry.TestDOMProtocolFactory(),
                internalDevice);

        TransVisitor visitor = factory.getVisitor(protocol);

        assertTrue("The visitor should be an XHTMLBasicTransVisitor",
                   visitor instanceof XHTMLBasicTransVisitor);
    }
View Full Code Here

    /**
     * Simple method test
     */
    public void testGetLCM() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);

        assertSame("expect the factory to return the default LCM singleton",
                   factory.getLCM(),
                   LCMImpl.getInstance());
    }
View Full Code Here

    /**
     * Simple method test
     */
    public void testGetMapper() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);

        assertTrue("expect the factory to return a new XHTMLBasicTransMapper",
                   factory.getMapper(protocol) instanceof XHTMLBasicTransMapper);
    }
View Full Code Here

    /**
     * Simple method test
     */
    public void testGetElementHelper() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);

        assertSame("expect the factory to return the " +
                   "XHTMLBasicElementHelper singleton",
                   factory.getElementHelper(),
                   XHTMLBasicElementHelper.getInstance());
    }
View Full Code Here

    /**
     * Simple method test.
     */
    public void testGetContainerValidator() {
        TransFactory factory = new XHTMLBasicTransFactory(configuration);
        String[] elementNames =
          {"table",
           "tr",
           "td",
           "span",
           "div",
           "form",
           "strong"};
        int[] expectedResult =
            {ContainerActions.PROMOTE,
             ContainerActions.PROMOTE,
             ContainerActions.PROMOTE,
             ContainerActions.PROMOTE,
             ContainerActions.PROMOTE,
             ContainerActions.INVERSE_REMAP,
             ContainerActions.PROMOTE};
        ContainerValidator cv = factory.getContainerValidator(protocol);
        Element element = domFactory.createElement();

        for (int i = 0;
             i < elementNames.length;
             i++) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.trans.TransFactory

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.