diff options
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/contrib/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sca-java-2.x/contrib/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java b/sca-java-2.x/contrib/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java index 8ba43dd635..d3b7300e4c 100644 --- a/sca-java-2.x/contrib/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java +++ b/sca-java-2.x/contrib/modules/implementation-ejb/src/test/java/org/apache/tuscany/sca/implementation/ejb/xml/WriteTestCase.java @@ -28,11 +28,12 @@ import javax.xml.stream.XMLOutputFactory; import junit.framework.TestCase; import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.processor.ProcessorContext; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; /** * Test reading/write WSDL interfaces. @@ -40,26 +41,27 @@ import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; * @version $Rev$ $Date$ */ public class WriteTestCase extends TestCase { - + private ExtensionPointRegistry registry; private XMLInputFactory inputFactory; private XMLOutputFactory outputFactory; private StAXArtifactProcessor<Object> staxProcessor; @Override public void setUp() throws Exception { - DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); - inputFactory = XMLInputFactory.newInstance(); - outputFactory = XMLOutputFactory.newInstance(); - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null); + registry = new DefaultExtensionPointRegistry(); + FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class); + inputFactory = factories.getFactory(XMLInputFactory.class); + outputFactory = factories.getFactory(XMLOutputFactory.class); + staxProcessor = new ExtensibleStAXArtifactProcessor(registry); } public void testReadWriteComposite() throws Exception { + ProcessorContext context = new ProcessorContext(registry); InputStream is = getClass().getResourceAsStream("TestEJB.composite"); - Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is)); + Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is), context); assertNotNull(composite); ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos)); + staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), context); assertTrue(bos.toString().contains("module.jar#TestEJB")); |