public void testExtension() {
MyTransformer transformer = new MyTransformer();
assertEquals(Node.class.getName(), transformer.getSourceDataBinding());
assertEquals(XMLStreamReader.class.getName(), transformer.getTargetDataBinding());
assertEquals(50, transformer.getWeight());
TransformerExtensionPoint registry = EasyMock.createMock(TransformerExtensionPoint.class);
registry.addTransformer(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()));
}