public void testExtension() {
MyTransformer transformer = new MyTransformer();
assertEquals(Node.class.getName(), transformer.getSourceDataBinding());
assertEquals(XMLStreamReader.class.getName(), transformer.getTargetDataBinding());
assertEquals(50, transformer.getWeight());
TransformerRegistry registry = EasyMock.createMock(TransformerRegistry.class);
registry.registerTransformer(EasyMock.isA(Transformer.class));
EasyMock
.expect(registry.getTransformer(transformer.getSourceDataBinding(), transformer.getTargetDataBinding()))
.andReturn(transformer);
EasyMock.replay(registry);
transformer.setTransformerRegistry(registry);
transformer.init();
assertSame(transformer, registry.getTransformer(transformer.getSourceDataBinding(), transformer
.getTargetDataBinding()));
}