Package org.apache.commons.jelly

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


     */
    public void testExtension() throws Exception {
        setUpScript("testUseBeanTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.extension",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        assertNotNull(getJellyContext().getVariable("foo"));
        assertTrue(getJellyContext().getVariable("foo") instanceof Customer);
        Customer customer = (Customer)(getJellyContext().getVariable("foo"));
        assertNull("name set wrongly", customer.getName());
        assertEquals("city not set", "sydney", customer.getCity());
View Full Code Here


     */
    public void testBadProperty() throws Exception {
        setUpScript("testUseBeanTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.badProperty",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        Exception e = (Exception)getJellyContext().getVariable("ex");
        assertNotNull("Should have failed to set invalid bean property", e);
    }

    /** Test set a bad property name on a bean, this should be silently ignored.
View Full Code Here

     */
    public void testIgnoredBadProperty() throws Exception {
        setUpScript("testUseBeanTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.badPropertyIgnored",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        Customer customer = (Customer)(getJellyContext().getVariable("foo"));
        assertNotNull("Should have ignored invalid bean property", customer);
    }
}
View Full Code Here

    public void testSimpleNew() throws Exception {
        setUpScript("testNewTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.simpleNew",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        assertNotNull(getJellyContext().getVariable("foo"));
        assertTrue(getJellyContext().getVariable("foo") instanceof Customer);
        Customer customer = (Customer)(getJellyContext().getVariable("foo"));
        assertNull(customer.getName());
    }
View Full Code Here

    public void testNewThenOverwrite() throws Exception {
        setUpScript("testNewTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.newThenOverwrite",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        assertNotNull(getJellyContext().getVariable("foo"));
        assertTrue(getJellyContext().getVariable("foo") instanceof Date);
    }

    public void testNewWithLiteralArg() throws Exception {
View Full Code Here

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

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

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

    public void testNewWithNullArg() throws Exception {
        setUpScript("testNewTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.newWithNullArg",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        assertNotNull(getJellyContext().getVariable("foo"));
        assertTrue(getJellyContext().getVariable("foo") instanceof Customer);
        Customer customer = (Customer)(getJellyContext().getVariable("foo"));
        assertNull(customer.getName());
    }
View Full Code Here

    public void testNewWithNewArg() throws Exception {
        setUpScript("testNewTag.jelly");
        Script script = getJelly().compileScript();
        getJellyContext().setVariable("test.newWithNewArg",Boolean.TRUE);
        script.run(getJellyContext(),getXMLOutput());
        {
            assertNotNull(getJellyContext().getVariable("foo"));
            assertTrue(getJellyContext().getVariable("foo") instanceof Customer);
            Customer customer = (Customer)(getJellyContext().getVariable("foo"));
            assertNotNull(customer.getName());
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.