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());
assertEquals("",customer.getName());
}
{
assertNotNull(getJellyContext().getVariable("bar"));
assertTrue(getJellyContext().getVariable("bar") instanceof Customer);
Customer customer = (Customer)(getJellyContext().getVariable("bar"));
assertEquals("Jane Doe",customer.getName());
assertEquals("Chicago",customer.getCity());
assertNotNull(customer.getOrders());
assertEquals(1,customer.getOrders().size());
assertNotNull(customer.getOrders().get(0));
}
{
assertNotNull(getJellyContext().getVariable("qux"));
assertTrue(getJellyContext().getVariable("qux") instanceof Customer);
Customer customer = (Customer)(getJellyContext().getVariable("qux"));
assertEquals("Jane Doe",customer.getName());
assertEquals("Chicago",customer.getCity());
assertNotNull(customer.getOrders());
assertEquals(1,customer.getOrders().size());
assertNotNull(customer.getOrders().get(0));
}
}