t2.setName("--t2");
t2.registerSourceType(DataTypeFactory.OBJECT);
t2.setReturnDataType(DataTypeFactory.create(Fruit.class));
muleContext.getRegistry().registerTransformer(t2);
List trans = muleContext.getRegistry().lookupTransformers(new SimpleDataType(BloodOrange.class), new SimpleDataType(Fruit.class));
assertEquals(2, trans.size());
for (Iterator iterator = trans.iterator(); iterator.hasNext();)
{
Transformer transformer = (Transformer) iterator.next();
assertTrue(transformer.getName().startsWith("--"));
}
Transformer result = muleContext.getRegistry().lookupTransformer(new SimpleDataType(BloodOrange.class), new SimpleDataType(Fruit.class));
assertNotNull(result);
assertEquals("--t1", result.getName());
}