diff options
Diffstat (limited to 'branches/sca-equinox/modules')
2 files changed, 25 insertions, 15 deletions
diff --git a/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java b/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java index c6b846aa45..d89e26214b 100644 --- a/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java +++ b/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java @@ -19,13 +19,14 @@ package org.apace.tuscany.sca.binding.sca.xml; +import static org.junit.Assert.assertNotNull; + import java.io.InputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamReader; import junit.framework.Assert; -import junit.framework.TestCase; import org.apache.tuscany.sca.assembly.ComponentType; import org.apache.tuscany.sca.assembly.Composite; @@ -37,20 +38,22 @@ 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.junit.BeforeClass; +import org.junit.Test; /** * Test reading WSDL interfaces. * * @version $Rev$ $Date$ */ -public class ReadTestCase extends TestCase { +public class ReadTestCase { - private XMLInputFactory inputFactory; - private StAXArtifactProcessor<Object> staxProcessor; - private CompositeBuilder compositeBuilder; + private static XMLInputFactory inputFactory; + private static StAXArtifactProcessor<Object> staxProcessor; + private static CompositeBuilder compositeBuilder; - @Override - public void setUp() throws Exception { + @BeforeClass + public static void setUp() throws Exception { ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); inputFactory = XMLInputFactory.newInstance(); @@ -60,6 +63,7 @@ public class ReadTestCase extends TestCase { compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder"); } + @Test public void testReadComponentType() throws Exception { InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType"); XMLStreamReader reader = inputFactory.createXMLStreamReader(is); @@ -75,6 +79,7 @@ public class ReadTestCase extends TestCase { //new PrintUtil(System.out).print(componentType); } + @Test public void testReadComposite() throws Exception { InputStream is = getClass().getResourceAsStream("/Calculator.composite"); XMLStreamReader reader = inputFactory.createXMLStreamReader(is); diff --git a/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java b/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java index 8ceaecc9c7..110b789193 100644 --- a/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java +++ b/branches/sca-equinox/modules/binding-sca-xml/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java @@ -19,34 +19,37 @@ package org.apace.tuscany.sca.binding.sca.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + import java.io.ByteArrayOutputStream; import java.io.InputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; -import junit.framework.TestCase; - import org.apache.tuscany.sca.assembly.ComponentType; import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; 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.junit.BeforeClass; +import org.junit.Test; /** * Test reading/write WSDL interfaces. * * @version $Rev$ $Date$ */ -public class WriteTestCase extends TestCase { +public class WriteTestCase { - private StAXArtifactProcessor<Object> staxProcessor; - private XMLInputFactory inputFactory; - private XMLOutputFactory outputFactory; + private static StAXArtifactProcessor<Object> staxProcessor; + private static XMLInputFactory inputFactory; + private static XMLOutputFactory outputFactory; - @Override - public void setUp() throws Exception { + @BeforeClass + public static void setUp() throws Exception { DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); inputFactory = XMLInputFactory.newInstance(); @@ -54,6 +57,7 @@ public class WriteTestCase extends TestCase { staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null); } + @Test public void testReadWriteComponentType() throws Exception { InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType"); ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is)); @@ -64,6 +68,7 @@ public class WriteTestCase extends TestCase { bos.toString()); } + @Test public void testReadWriteComposite() throws Exception { InputStream is = getClass().getResourceAsStream("/Calculator.composite"); Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is)); |