public class TransformerCachingTestCase extends AbstractMuleTestCase
{
public void testCacheUpdate() throws Exception
{
SimpleDataType<?> sourceType = new SimpleDataType<FilterInputStream>(FilterInputStream.class);
Transformer trans = muleContext.getRegistry().lookupTransformer(sourceType, DataTypeFactory.BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof ObjectToByteArray);
Transformer trans2 = new FilterInputStreamToByteArray();
muleContext.getRegistry().registerTransformer(trans2);
trans = muleContext.getRegistry().lookupTransformer(sourceType, DataTypeFactory.BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof FilterInputStreamToByteArray);
trans = muleContext.getRegistry().lookupTransformer(DataTypeFactory.INPUT_STREAM, DataTypeFactory.BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof ObjectToByteArray);
muleContext.getRegistry().unregisterTransformer(trans2.getName());
trans = muleContext.getRegistry().lookupTransformer(sourceType, DataTypeFactory.BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof ObjectToByteArray);