Examples of TextScript


Examples of org.apache.commons.jelly.impl.TextScript

        assertEquals( "foo", script.getText() );
    }

    public void testTrimEnd() throws Exception {
        TextScript script = new TextScript( "   foo    " );
        script.trimEndWhitespace();

        assertEquals( "   foo", script.getText() );

        script = new TextScript( " foo " );
        script.trimEndWhitespace();

        assertEquals( " foo", script.getText() );

        script = new TextScript( "foo" );
        script.trimEndWhitespace();

        assertEquals( "foo", script.getText() );
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        }
        assertEquals("Produces the correct output", "one two three", text);
    }

    public void testTrimEndWhitespace() throws Exception {
        TextScript textScript = new TextScript(" ");
        textScript.trimEndWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript("");
        textScript.trimEndWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript(" foo ");
        textScript.trimEndWhitespace();
        assertEquals(" foo", textScript.getText());

        textScript = new TextScript("foo");
        textScript.trimEndWhitespace();
        assertEquals("foo", textScript.getText());
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        textScript.trimEndWhitespace();
        assertEquals("foo", textScript.getText());
    }

    public void testTrimStartWhitespace() throws Exception {
        TextScript textScript = new TextScript(" ");
        textScript.trimStartWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript("");
        textScript.trimStartWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript(" foo ");
        textScript.trimStartWhitespace();
        assertEquals("foo ", textScript.getText());

        textScript = new TextScript("foo");
        textScript.trimStartWhitespace();
        assertEquals("foo", textScript.getText());
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        }
        assertEquals("Produces the correct output", "one two three", text);
    }

    public void testTrimEndWhitespace() throws Exception {
        TextScript textScript = new TextScript(" ");
        textScript.trimEndWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript("");
        textScript.trimEndWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript(" foo ");
        textScript.trimEndWhitespace();
        assertEquals(" foo", textScript.getText());

        textScript = new TextScript("foo");
        textScript.trimEndWhitespace();
        assertEquals("foo", textScript.getText());
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        textScript.trimEndWhitespace();
        assertEquals("foo", textScript.getText());
    }

    public void testTrimStartWhitespace() throws Exception {
        TextScript textScript = new TextScript(" ");
        textScript.trimStartWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript("");
        textScript.trimStartWhitespace();
        assertEquals("", textScript.getText());

        textScript = new TextScript(" foo ");
        textScript.trimStartWhitespace();
        assertEquals("foo ", textScript.getText());

        textScript = new TextScript("foo");
        textScript.trimStartWhitespace();
        assertEquals("foo", textScript.getText());
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

    public TestTrim(String testName) {
        super(testName);
    }

    public void testTrim() throws Exception {
        TextScript script = new TextScript( "   foo    " );
        script.trimWhitespace();

        assertEquals( "foo", script.getText() );

        script = new TextScript( " foo " );
        script.trimWhitespace();

        assertEquals( "foo", script.getText() );

        script = new TextScript( "foo" );
        script.trimWhitespace();

        assertEquals( "foo", script.getText() );
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        assertEquals( "foo", script.getText() );
    }

    public void testTrimStart() throws Exception {
        TextScript script = new TextScript( "   foo    " );
        script.trimStartWhitespace();

        assertEquals( "foo    ", script.getText() );

        script = new TextScript( " foo " );
        script.trimStartWhitespace();

        assertEquals( "foo ", script.getText() );

        script = new TextScript( "foo" );
        script.trimStartWhitespace();

        assertEquals( "foo", script.getText() );
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        assertEquals( "foo", script.getText() );
    }

    public void testTrimEnd() throws Exception {
        TextScript script = new TextScript( "   foo    " );
        script.trimEndWhitespace();

        assertEquals( "   foo", script.getText() );

        script = new TextScript( " foo " );
        script.trimEndWhitespace();

        assertEquals( " foo", script.getText() );

        script = new TextScript( "foo" );
        script.trimEndWhitespace();

        assertEquals( "foo", script.getText() );
    }
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

        if ( expression instanceof ConstantExpression ) {
            ConstantExpression constantExpression
                = (ConstantExpression) expression;
            Object value = constantExpression.getValue();
            if ( value != null ) {
                script.addScript(new TextScript( value.toString() ));
            }
        }
        else
        if ( expression instanceof CompositeExpression ) {
            CompositeTextScriptBlock newBlock = new CompositeTextScriptBlock();
View Full Code Here

Examples of org.apache.commons.jelly.impl.TextScript

            if ( body instanceof ScriptBlock ) {
                ScriptBlock block = (ScriptBlock) body;
                block.trimWhitespace();
            }
            else if ( body instanceof TextScript ) {
                TextScript textScript = (TextScript) body;
                textScript.trimWhitespace();
            }
        }
    }
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.