Package org.apache.click

Examples of org.apache.click.MockContainer


public class TabbedFormTest extends TestCase {

    public void testGetHeadElements() {
        // TabbedForm uses Velocity to render its template. In this test we start a
        // MockContainer which also configures Velocity
        MockContainer container = new MockContainer("web");
        container.start();

        // MockContext is created when a container tests a page. There
        // is no page to test so we manually create a MockContext
        // and reuse the Mock Servlet objects created in the container.
        MockContext.initContext(container.getServletConfig(),
            container.getRequest(), container.getResponse(), container.getClickServlet());

        TabbedForm form = new TabbedForm("form");

        assertTrue(form.toString().indexOf("<form") > 0);
        assertTrue(form.getHeadElements().toString().indexOf("/control.js") > 0);
        assertTrue(form.getHeadElements().toString().indexOf("/control.css") > 0);
        assertTrue(form.getHeadElements().toString().indexOf("/extras-control.css") > 0);
       
        container.stop();
    }
View Full Code Here

TOP

Related Classes of org.apache.click.MockContainer

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.