Package org.apache.tapestry.test.assertions

Examples of org.apache.tapestry.test.assertions.AssertRegexp


    {
        validateAttributes();

        int subgroup = getIntAttribute("subgroup", 0);

        AssertRegexp ar = new AssertRegexp();
        ar.setSubgroup(subgroup);

        RequestDescriptor rd = (RequestDescriptor) peekObject();

        rd.addAssertion(ar);
View Full Code Here


    private void enterMatch()
    {
        validateAttributes();

        RegexpMatch m = new RegexpMatch();
        AssertRegexp ar = (AssertRegexp) peekObject();

        ar.addMatch(m);

        push(_elementName, m, STATE_MATCH, false);
    }
View Full Code Here

    private void endAssertRegexp()
    {
        String content = peekContent();

        AssertRegexp ar = (AssertRegexp) peekObject();

        ar.setRegexp(content);
    }
View Full Code Here

{
    public void testSuccess() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<title>.*</title>");

        ar.execute(ss);
    }
View Full Code Here

    public void testFailure() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<body>.*</body>");

        try
        {
            ar.execute(ss);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertRegexp(
View Full Code Here

    public void testMatchesSuccess() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<.*?>");

        addMatch(ar, "<title>");
        addMatch(ar, "</title>");

        ar.execute(ss);
    }
View Full Code Here

    public void testMatchesWrongCount() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<.*?>");

        addMatch(ar, "<title>");

        try
        {
            ar.execute(ss);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertRegexp(
View Full Code Here

    public void testMatchesSubgroupSuccess() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<(.*?)>");
        ar.setSubgroup(1);

        addMatch(ar, "title");
        addMatch(ar, "/title");

        ar.execute(ss);
    }
View Full Code Here

    public void testMatchesFailure() throws Exception
    {
        ScriptedTestSession ss = TestScriptParser.createSession();

        AssertRegexp ar = new AssertRegexp();
        ar.setRegexp("<.*?>");

        addMatch(ar, "<little>");
        addMatch(ar, "</title>");

        try
        {
            ar.execute(ss);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertRegexp(
View Full Code Here

    {
        validateAttributes();

        int subgroup = getIntAttribute("subgroup", 0);

        AssertRegexp ar = new AssertRegexp();
        ar.setSubgroup(subgroup);

        RequestDescriptor rd = (RequestDescriptor) peekObject();

        rd.addAssertion(ar);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.test.assertions.AssertRegexp

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.