Package org.apache.tuscany.spi.databinding

Examples of org.apache.tuscany.spi.databinding.TransformerRegistry


    private MediatorImpl mediator;

    protected void setUp() throws Exception {
        super.setUp();

        TransformerRegistry registry = new TransformerRegistryImpl();
        registry.registerTransformer(new String2SAX());
        registry.registerTransformer(new SAX2DOMPipe());
        registry.registerTransformer(new Node2String());
        registry.registerTransformer(new Node2Writer());

        mediator = new MediatorImpl();
        mediator.setTransformerRegistry(registry);

        DataBindingRegistry dataBindingRegistry = new DataBindingRegistryImpl();
View Full Code Here


    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()));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.databinding.TransformerRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.