Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.Script.run()


    public void testNewWithUseBeanArg() throws Exception {
        setUpScript("testNewTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.newWithUseBeanArg",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        assertNotNull(getJellyContext().getVariable("foo"));
        assertTrue(getJellyContext().getVariable("foo") instanceof Customer);
        Customer customer = (Customer)(getJellyContext().getVariable("foo"));
        assertEquals("Jane Doe",customer.getName());
        assertEquals("Chicago",customer.getCity());
View Full Code Here


    public void testDefaultWithoutSwitch() throws Exception {
        setUpScript("testSwitchTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("default.without.switch",new Boolean(true));
        try {
            script.run(getJellyContext(),getXMLOutput());
            fail("Expected JellyException");
        } catch(JellyException e) {
            // expected
        }
    }
View Full Code Here

    public void testCaseWithoutValue() throws Exception {
        setUpScript("testSwitchTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("case.without.value",new Boolean(true));
        try {
            script.run(getJellyContext(),getXMLOutput());
            fail("Expected MissingAttributeException");
        } catch(MissingAttributeException e) {
            // expected
        }
    }
View Full Code Here

    public void testMultipleDefaults() throws Exception {
        setUpScript("testSwitchTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("multiple.defaults",new Boolean(true));
        try {
            script.run(getJellyContext(),getXMLOutput());
            fail("Expected JellyException");
        } catch(JellyException e) {
            // expected
        }
    }
View Full Code Here

    public void testCaseAfterDefault() throws Exception {
        setUpScript("testSwitchTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("case.after.default",new Boolean(true));
        try {
            script.run(getJellyContext(),getXMLOutput());
            fail("Expected JellyException");
        } catch(JellyException e) {
            // expected
        }
    }
View Full Code Here

    public void testSimpleBreakTag() throws Exception
    {
        setUpScript("testBreakTag.jelly");
        Script script = getJelly().compileScript();

        script.run(getJellyContext(), getXMLOutput());

        String simpleResult = (String) getJellyContext().getVariable("simpleResult");

        assertEquals("simpleResult", "12345", simpleResult);
    }
View Full Code Here

    public void testConditionalBreakTag() throws Exception
    {
        setUpScript("testBreakTag.jelly");
        Script script = getJelly().compileScript();

        script.run(getJellyContext(), getXMLOutput());

        String simpleResult = (String) getJellyContext().getVariable("conditionalResult");

        assertEquals("conditionalResult", "12345", simpleResult);
    }
View Full Code Here

    public void testVarBreakTag() throws Exception
    {
        setUpScript("testBreakTag.jelly");
        Script script = getJelly().compileScript();

        script.run(getJellyContext(), getXMLOutput());

        String varBroken = (String) getJellyContext().getVariable("varBroken");

        assertEquals("varBroken", "true", varBroken);
    }
View Full Code Here

    public void testVarNoBreakTag() throws Exception
    {
        setUpScript("testBreakTag.jelly");
        Script script = getJelly().compileScript();

        script.run(getJellyContext(), getXMLOutput());

        String varNotBroken = (String) getJellyContext().getVariable("varNotBroken");

        assertEquals("varNotBroken", "false", varNotBroken);
    }
View Full Code Here

        Script script = getJelly().compileScript();

        getJellyContext().setVariable( "test.simpleSystemInvoke",Boolean.TRUE );

        getJellyContext().setVariable( "propertyName", "java.runtime.version" );
        script.run( getJellyContext(),getXMLOutput() );

        assertTrue( System.getProperty( "java.runtime.version" ).equals( getJellyContext().getVariable("propertyName" ) ) );
    }

     /**
 
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.