From d7eaeda0e69a81759abb2fc855a8ebc120653fee Mon Sep 17 00:00:00 2001 From: mcombellack Date: Tue, 2 Dec 2008 15:08:26 +0000 Subject: Converted unit tests from JUnit 3 to JUnit 4 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@722491 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/assembly/xml/AnyElementReadWriteTestCase.java | 12 +++++++----- .../assembly/xml/ReadWriteLocalCompositeTestCase.java | 18 +++++++++++++----- .../assembly/xml/ReadWriteUnknownElementTestCase.java | 13 ++++++++----- 3 files changed, 28 insertions(+), 15 deletions(-) (limited to 'java/sca/modules/assembly-xml') diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/AnyElementReadWriteTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/AnyElementReadWriteTestCase.java index 95a3b86235..fdafff07bd 100644 --- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/AnyElementReadWriteTestCase.java +++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/AnyElementReadWriteTestCase.java @@ -18,6 +18,8 @@ */ package org.apache.tuscany.sca.assembly.xml; +import static org.junit.Assert.assertNotNull; + import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -25,22 +27,22 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; - import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; 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.After; +import org.junit.Before; import org.junit.Test; -public class AnyElementReadWriteTestCase extends TestCase { +public class AnyElementReadWriteTestCase { private XMLInputFactory inputFactory; String XML = ""; private ExtensibleStAXArtifactProcessor staxProcessor; - @Override + @Before public void setUp() throws Exception { ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); inputFactory = XMLInputFactory.newInstance(); @@ -51,7 +53,7 @@ public class AnyElementReadWriteTestCase extends TestCase { inputFactory, XMLOutputFactory.newInstance(), null); } - @Override + @After public void tearDown() throws Exception { } diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java index 1bd356b939..6127e6cc91 100644 --- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java +++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java @@ -19,6 +19,10 @@ package org.apache.tuscany.sca.assembly.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -26,21 +30,23 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; - import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + /** * Test reading SCA XML assemblies. * * @version $Rev: 711584 $ $Date: 2008-11-05 15:07:03 +0000 (Wed, 05 Nov 2008) $ */ -public class ReadWriteLocalCompositeTestCase extends TestCase { +public class ReadWriteLocalCompositeTestCase { private XMLInputFactory inputFactory; private ExtensibleStAXArtifactProcessor staxProcessor; @@ -49,7 +55,7 @@ public class ReadWriteLocalCompositeTestCase extends TestCase { ""+ ""; - @Override + @Before public void setUp() throws Exception { ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); inputFactory = XMLInputFactory.newInstance(); @@ -61,11 +67,12 @@ public class ReadWriteLocalCompositeTestCase extends TestCase { staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null); } - @Override + @After public void tearDown() throws Exception { } + @Test public void testReadComposite() throws Exception { InputStream is = getClass().getResourceAsStream("local.composite"); XMLStreamReader reader = inputFactory.createXMLStreamReader(is); @@ -75,6 +82,7 @@ public class ReadWriteLocalCompositeTestCase extends TestCase { is.close(); } + @Test public void testWriteComposite() throws Exception { InputStream is = getClass().getResourceAsStream("local.composite"); XMLStreamReader reader = inputFactory.createXMLStreamReader(is); diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteUnknownElementTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteUnknownElementTestCase.java index b4762dbad1..07070b5bed 100644 --- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteUnknownElementTestCase.java +++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteUnknownElementTestCase.java @@ -1,5 +1,8 @@ package org.apache.tuscany.sca.assembly.xml; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -7,23 +10,23 @@ import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; - import org.apache.tuscany.sca.assembly.Composite; import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; 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.After; +import org.junit.Before; import org.junit.Test; -public class ReadWriteUnknownElementTestCase extends TestCase { +public class ReadWriteUnknownElementTestCase { private XMLInputFactory inputFactory; //String XML = ""; String XML = ""; private ExtensibleStAXArtifactProcessor staxProcessor; - @Override + @Before public void setUp() throws Exception { ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry(); inputFactory = XMLInputFactory.newInstance(); @@ -31,7 +34,7 @@ public class ReadWriteUnknownElementTestCase extends TestCase { staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null); } - @Override + @After public void tearDown() throws Exception { } -- cgit v1.2.3