Package org.apache.tapestry.dom

Examples of org.apache.tapestry.dom.Document


    public void submit_aso()
    {
        String appPackage = "org.apache.tapestry.integration.app2";
        String appName = "";
        _tester = new PageTester(appPackage, appName);
        Document doc = _tester.renderPage("TestPageForASO");
        assertTrue(doc.toString().contains("bar"));
    }
View Full Code Here


    public void submit_context_asset()
    {
        String appPackage = "org.apache.tapestry.integration.app2";
        String appName = "";
        _tester = new PageTester(appPackage, appName, "src/test/app2");
        Document doc = _tester.renderPage("TestPageForAsset");
        assertTrue(doc.toString().contains("test.css"));
    }
View Full Code Here

    public void template_in_web_inf()
    {
        String appPackage = "org.apache.tapestry.integration.app2";
        String appName = "";
        _tester = new PageTester(appPackage, appName, "src/test/app2");
        Document doc = _tester.renderPage("TestPageForTemplateInWEBINF");
        assertTrue(doc.toString().contains("How are you?"));
    }
View Full Code Here

public class InjectStandardStylesheetCommandTest extends InternalBaseTestCase
{
    @Test
    public void no_head_element()
    {
        Document d = new Document();
        Environment env = mockEnvironment();
        Asset asset = mockAsset();

        d.newRootElement("foo");
        String initial = d.toString();

        train_peek(env, Document.class, d);

        replay();

        new InjectStandardStylesheetCommand(asset).cleanup(env);

        assertEquals(d.toString(), initial, "Document structure should not change.");

        verify();
    }
View Full Code Here

    }

    @Test
    public void head_element_found()
    {
        Document d = new Document();
        Environment env = mockEnvironment();
        Asset asset = mockAsset();

        d.newRootElement("html").element("head");

        train_peek(env, Document.class, d);

        train_toClientURL(asset, "{clientURL}");

        replay();

        new InjectStandardStylesheetCommand(asset).cleanup(env);

        verify();

        assertEquals(
                d.toString(),
                "<html><head><link href=\"{clientURL}\" rel=\"stylesheet\" type=\"text/css\"></head></html>");
    }
View Full Code Here

    {
        // REFACTOR this happens in a bunch of places
        String appPackage = "org.apache.tapestry.integration.app2";
        String appName = "";
        _tester = new PageTester(appPackage, appName, PageTester.DEFAULT_CONTEXT_PATH, LocaleAppModule.class);
        Document doc = _tester.renderPage("TestPrefixMethod");
       
        assertEquals(doc.getElementById("value").getChildText(), "42");

        // should override the method in the superclass
        doc = _tester.renderPage("TestPrefixMethod2");
        assertEquals(doc.getElementById("value").getChildText(), "42");
    }
View Full Code Here

    private PageTester _tester;

    @Test
    public void no_preferred_language()
    {
        Document doc = _tester.renderPage("TestPageForLocale");
        assertEquals(doc.getElementById("id1").getChildText(), "English page");
    }
View Full Code Here

    @Test
    public void prefer_canada_french()
    {
        _tester.setPreferedLanguage(Locale.CANADA_FRENCH);
        Document doc = _tester.renderPage("TestPageForLocale");
        assertEquals(doc.getElementById("id1").getChildText(), "French page");
    }
View Full Code Here

    }

    @Test
    public void change_language_in_browser()
    {
        Document doc = _tester.renderPage("TestPageForLocale");
        assertEquals(doc.getElementById("id1").getChildText(), "English page");
        _tester.setPreferedLanguage(Locale.CANADA_FRENCH);
        doc = _tester.renderPage("TestPageForLocale");
        assertEquals(doc.getElementById("id1").getChildText(), "French page");
    }
View Full Code Here

    }

    @Test
    public void persist_locale()
    {
        Document doc = _tester.renderPage("TestPageForLocale");
        doc = _tester.clickLink(doc.getElementById("changeLocale"));
        assertEquals(doc.getElementById("id1").getChildText(), "French page");
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.dom.Document

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.