}
public void testRegistryLookupWithProperties() throws Exception
{
MuleMessage message = new DefaultMuleMessage(new Apple(), muleContext);
RegistryExpressionEvaluator eval = new RegistryExpressionEvaluator();
eval.setMuleContext(muleContext);
Object o = eval.evaluate("bowlToBasket.returnClass", message);
assertNotNull(o);
assertTrue(o instanceof Class);
assertEquals(FruitBasket.class, o);
o = eval.evaluate("XXbowlToBasket*.returnClass", message);
assertNull(o);
o = eval.evaluate("bowlToBasket.returnClass.name", message);
assertNotNull(o);
assertEquals(FruitBasket.class.getName(), o);
o = eval.evaluate("bowlToBasket.returnClass.xname*", message);
assertNull(o);
try
{
o = eval.evaluate("bowlToBasket.returnClass.xname", message);
fail("property xname is not valid and is not optional");
}
catch (Exception e)
{
//Expected