diff options
author | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-02 15:39:59 +0000 |
---|---|---|
committer | mcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-02 15:39:59 +0000 |
commit | e401b8734ddffc65b0319e7727f0bf7334dbb6d4 (patch) | |
tree | 5b5ea6e24e0bdff48f686c620cfcb6b98e275133 /java/sca/modules/databinding | |
parent | 09d417d754c70f2c267abd7675ef2f962129c671 (diff) |
Converted unit tests from JUnit 3 to JUnit 4
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@722501 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/databinding')
14 files changed, 82 insertions, 120 deletions
diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java index 8c710062ad..5e57f64b5f 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java @@ -19,12 +19,14 @@ package org.apache.tuscany.sca.databinding.extension; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; -import junit.framework.TestCase; - import org.apache.tuscany.sca.databinding.impl.DOMHelper; +import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -32,17 +34,10 @@ import org.w3c.dom.Element; * * @version $Rev$ $Date$ */ -public class DOMHelperTestCase extends TestCase { +public class DOMHelperTestCase { private static final QName FOO_NAME = new QName("http://foo", "foo"); - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } - + @Test public void testDOM() throws Exception { DocumentBuilder builder = DOMHelper.newDocumentBuilder(); assertNotNull(builder); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java index b31f17d5ed..7d14cd9dd1 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java @@ -19,13 +19,18 @@ package org.apache.tuscany.sca.databinding.extension; -import junit.framework.TestCase; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; +import org.junit.Test; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -33,16 +38,9 @@ import org.w3c.dom.Node; * * @version $Rev$ $Date$ */ -public class DataBindingExtensionTestCase extends TestCase { - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } +public class DataBindingExtensionTestCase { + @Test @SuppressWarnings("unchecked") public void testExtension() { DataBinding1 binding1 = new DataBinding1(Node.class); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java index 07ee0b0ca4..a337dc113c 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java @@ -19,35 +19,29 @@ package org.apache.tuscany.sca.databinding.extension; +import static org.junit.Assert.assertEquals; + import java.math.BigInteger; import java.util.Calendar; import java.util.GregorianCalendar; -import junit.framework.TestCase; - import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter; +import org.junit.Test; /** * * @version $Rev$ $Date$ */ -public class XSDDataTypeConverterTestCase extends TestCase { - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } +public class XSDDataTypeConverterTestCase { + @Test public void testConvert() throws Exception { XSDDataTypeConverter c = new XSDDataTypeConverter(); assertEquals("123", c.parseAnySimpleType(c.printAnySimpleType("123"))); assertEquals(true, c.parseBoolean(c.printBoolean(true))); assertEquals(false, c.parseBoolean(c.printBoolean(false))); - assertEquals(123.0, c.parseDouble(c.printDouble(123.0))); - assertEquals(123.0f, c.parseFloat(c.printFloat(123.0f))); + assertEquals(123.0, c.parseDouble(c.printDouble(123.0)), 0); + assertEquals(123.0f, c.parseFloat(c.printFloat(123.0f)), 0); assertEquals(64, c.parseByte(c.printByte((byte)64))); assertEquals(123, c.parseInt(c.printInt(123))); assertEquals(new BigInteger("123456"), c.parseInteger(c.printInteger(new BigInteger("123456")))); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java index 9172187828..9f5ead2ea5 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java @@ -20,24 +20,23 @@ package org.apache.tuscany.sca.databinding.impl; import java.lang.reflect.Method; -import junit.framework.Assert; -import junit.framework.TestCase; - import org.apache.tuscany.sca.databinding.annotation.DataBinding; +import static org.junit.Assert.assertEquals; /** * * @version $Rev$ $Date$ */ -public class DataBindingTestCase extends TestCase { +public class DataBindingTestCase { + @org.junit.Test public void testDataType() throws Exception { Class<Test> testClass = Test.class; DataBinding d = testClass.getAnnotation(DataBinding.class); - Assert.assertEquals(d.value(), "sdo"); + assertEquals(d.value(), "sdo"); Method method = testClass.getMethod("test", new Class[] {Object.class}); DataBinding d2 = method.getAnnotation(DataBinding.class); - Assert.assertEquals(d2.value(), "jaxb"); + assertEquals(d2.value(), "jaxb"); } @DataBinding("sdo") diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java index 053e4f2a59..f9118939d8 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java @@ -18,28 +18,32 @@ */ package org.apache.tuscany.sca.databinding.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.util.Arrays; import java.util.List; import junit.framework.Assert; -import junit.framework.TestCase; import org.apache.tuscany.sca.databinding.impl.DirectedGraph.Edge; import org.apache.tuscany.sca.databinding.impl.DirectedGraph.Vertex; +import org.junit.Before; +import org.junit.Test; /** * * @version $Rev$ $Date$ */ -public class DirectedGraphTestCase extends TestCase { +public class DirectedGraphTestCase { private DirectedGraph<String, Object> graph; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { graph = new DirectedGraph<String, Object>(); } + @Test public void testGraph() { graph.addEdge("a", "b", null, 3, true); graph.addEdge("b", "c", null, 1, true); @@ -94,6 +98,7 @@ public class DirectedGraphTestCase extends TestCase { } + @Test public void testSort() { graph.addEdge("a", "b"); graph.addEdge("a", "c"); @@ -116,10 +121,4 @@ public class DirectedGraphTestCase extends TestCase { assertEquals(Arrays.asList("a", "b", "c", "d"), order); assertTrue(graph.getVertices().isEmpty()); } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - } diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java index 6cc8868397..d281c13fe6 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java @@ -35,6 +35,8 @@ import org.apache.tuscany.sca.databinding.xml.SAX2DOMPipe; import org.apache.tuscany.sca.databinding.xml.String2SAX; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; +import org.junit.Before; +import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -44,7 +46,7 @@ import org.w3c.dom.Node; * * @version $Rev$ $Date$ */ -public class MediatorImplTestCase extends TestCase { +public class MediatorImplTestCase { private static final String IPO_XML = "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" @@ -77,10 +79,8 @@ public class MediatorImplTestCase extends TestCase { private MediatorImpl mediator; - @Override - protected void setUp() throws Exception { - super.setUp(); - + @Before + public void setUp() throws Exception { DataBindingExtensionPoint dataBindingRegistry = new DefaultDataBindingExtensionPoint(); TransformerExtensionPoint registry = new DefaultTransformerExtensionPoint(); @@ -101,6 +101,7 @@ public class MediatorImplTestCase extends TestCase { return context; } + @Test public void testTransform1() { TransformationContext context = createTransformationContext(String.class, Node.class); Object node = @@ -111,6 +112,7 @@ public class MediatorImplTestCase extends TestCase { Assert.assertEquals(root.getLocalName(), "purchaseOrder"); } + @Test public void testTransform2() { TransformationContext context = createTransformationContext(String.class, Writer.class); Writer writer = new StringWriter(); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java index bdc9690285..f396d4e016 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/BeanXMLStreamReaderTestCase.java @@ -18,6 +18,8 @@ */ package org.apache.tuscany.sca.databinding.xml; +import static org.junit.Assert.assertTrue; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,15 +27,14 @@ import java.util.Map; import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; - import org.custommonkey.xmlunit.Diff; +import org.junit.Test; /** * * @version $Rev$ $Date$ */ -public class BeanXMLStreamReaderTestCase extends TestCase { +public class BeanXMLStreamReaderTestCase { private static final String XML_RESULT = "<?xml version='1.0' encoding='UTF-8'?>" + "<MyBean xmlns=\"http://xml.databinding.sca.tuscany.apache.org/\">" + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean><i>1</i>" @@ -53,14 +54,8 @@ public class BeanXMLStreamReaderTestCase extends TestCase { + "<nil xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\" />" + "<str>ABC</str></MyBean>"; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } + @Test public void testTransformation() throws Exception { MyBean bean = new MyBean(); bean.str = "ABC"; diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java index 9e9dabcea7..7665eaa8ec 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java @@ -18,18 +18,19 @@ */ package org.apache.tuscany.sca.databinding.xml; -import javax.xml.stream.XMLStreamReader; +import static org.junit.Assert.assertTrue; -import junit.framework.TestCase; +import javax.xml.stream.XMLStreamReader; import org.custommonkey.xmlunit.XMLAssert; +import org.junit.Test; import org.w3c.dom.Node; /** * * @version $Rev$ $Date$ */ -public class DOM2StAXTestCase extends TestCase { +public class DOM2StAXTestCase { private static final String IPO_XML = "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" @@ -63,14 +64,7 @@ public class DOM2StAXTestCase extends TestCase { private static final String CRAZY_XML = "<p:e1 xmlns=\"http://ns0\" xmlns:p=\"http://p1\">" + "<p:e2 xmlns:p=\"http://p2\"/><e3/><e4 xmlns=\"\">E4</e4></p:e1>"; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } - + @Test public void testTransformation() throws Exception { String2Node t1 = new String2Node(); Node node = t1.transform(IPO_XML, null); @@ -82,6 +76,7 @@ public class DOM2StAXTestCase extends TestCase { // assertTrue(xml != null && xml.indexOf("<shipDate>1999-12-05</shipDate>") != -1); } + @Test public void testTransformation2() throws Exception { String2Node t1 = new String2Node(); Node node = t1.transform(CRAZY_XML, null); @@ -94,6 +89,7 @@ public class DOM2StAXTestCase extends TestCase { assertTrue(xml.contains("<p:e2 xmlns:p=\"http://p2\"")); } + @Test public void testTransformation3() throws Exception { String2Node t1 = new String2Node(); Node node = t1.transform(IPO_XML, null); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java index f3b37c86db..48c65f8999 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java @@ -26,12 +26,12 @@ import java.io.Reader; import java.io.Writer; import junit.framework.Assert; -import junit.framework.TestCase; import org.apache.tuscany.sca.databinding.DataPipe; import org.apache.tuscany.sca.databinding.DataPipeTransformer; import org.apache.tuscany.sca.databinding.impl.DOMHelper; import org.apache.tuscany.sca.databinding.impl.PipedTransformer; +import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -41,8 +41,9 @@ import org.w3c.dom.Node; * * @version $Rev$ $Date$ */ -public class DataPipeTestCase extends TestCase { +public class DataPipeTestCase { + @Test public final void testStreamPipe() throws IOException { byte[] bytes = new byte[] {1, 2, 3}; DataPipeTransformer<OutputStream, InputStream> pipe = new StreamDataPipe(); @@ -57,6 +58,7 @@ public class DataPipeTestCase extends TestCase { } } + @Test public final void testWriter2ReaderPipe() throws IOException { String str = "ABC"; Writer2ReaderDataPipe pipe = new Writer2ReaderDataPipe(); @@ -72,6 +74,7 @@ public class DataPipeTestCase extends TestCase { } } + @Test public final void testPiped() throws Exception { Node2Writer node2Writer = new Node2Writer(); Writer2ReaderDataPipe pipe = new Writer2ReaderDataPipe(); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java index 3a287a5bb7..66cb12c19b 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java @@ -20,30 +20,22 @@ package org.apache.tuscany.sca.databinding.xml; import javax.xml.stream.XMLStreamReader; -import junit.framework.TestCase; - import org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReaderTransformer; import org.custommonkey.xmlunit.XMLAssert; +import org.junit.Test; /** * * @version $Rev$ $Date$ */ -public class JavaBean2XMLStreamReaderTestCase extends TestCase { +public class JavaBean2XMLStreamReaderTestCase { private static final String XML_RESULT = "<?xml version='1.0' encoding='UTF-8'?>" + "<MyBean xmlns=\"http://xml.databinding.sca.tuscany.apache.org/\">" + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean><i>1</i><str>ABC</str>" + "</MyBean>"; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } - + @Test public void testTransformation() throws Exception { JavaBean2XMLStreamReaderTransformer t2 = new JavaBean2XMLStreamReaderTransformer(); MyBean bean = new MyBean(); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java index cc1f9375c8..1ca420a18a 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java @@ -18,9 +18,8 @@ */ package org.apache.tuscany.sca.databinding.xml; -import junit.framework.TestCase; - import org.apache.tuscany.sca.databinding.impl.DOMHelper; +import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -28,7 +27,9 @@ import org.w3c.dom.Element; * * @version $Rev$ $Date$ */ -public class Node2StringTestCase extends TestCase { +public class Node2StringTestCase { + + @Test public void testTransformation() throws Exception { Document document = DOMHelper.newDocument(); Element element = document.createElementNS("http://ns1", "test"); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java index 5ae0616577..2a41482158 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java @@ -24,6 +24,7 @@ import junit.framework.Assert; import junit.framework.TestCase; import org.apache.tuscany.sca.databinding.impl.PipedTransformer; +import org.junit.Test; import org.w3c.dom.Node; import org.xml.sax.ContentHandler; @@ -31,7 +32,7 @@ import org.xml.sax.ContentHandler; * * @version $Rev$ $Date$ */ -public class PushTransformationTestCase extends TestCase { +public class PushTransformationTestCase { private static final String IPO_XML = "<?xml version=\"1.0\"?>" + "<ipo:purchaseOrder" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" @@ -62,14 +63,7 @@ public class PushTransformationTestCase extends TestCase { + " </items>" + "</ipo:purchaseOrder>"; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } - + @Test public void testTransformation() { String2XMLStreamReader t1 = new String2XMLStreamReader(); XMLStreamReader reader = t1.transform(IPO_XML, null); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java index 9ca490f2d8..264eb1a228 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java @@ -19,31 +19,25 @@ package org.apache.tuscany.sca.databinding.xml; -import javax.xml.stream.XMLStreamReader; +import static org.junit.Assert.assertNotNull; -import junit.framework.TestCase; +import javax.xml.stream.XMLStreamReader; import org.custommonkey.xmlunit.XMLAssert; +import org.junit.Test; /** * Test Case for StAXHelper * * @version $Rev$ $Date$ */ -public class StAXHelperTestCase extends TestCase { +public class StAXHelperTestCase { private static final String XML = "<a:foo xmlns:a='http://a' name='foo'><bar name='bar'>" + "<doo a:name='doo' xmlns:a='http://doo'/>" + "</bar></a:foo>"; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - } - + @Test public void testHelper() throws Exception { XMLStreamReader reader = StAXHelper.createXMLStreamReader(XML); String xml = StAXHelper.save(reader); diff --git a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java index ff6f8c1406..5ea55bae24 100644 --- a/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java +++ b/java/sca/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java @@ -30,6 +30,8 @@ import java.net.URL; import junit.framework.TestCase; +import org.junit.Before; +import org.junit.Test; import org.w3c.dom.Node; import org.xml.sax.Attributes; import org.xml.sax.InputSource; @@ -40,18 +42,15 @@ import org.xml.sax.helpers.DefaultHandler; * * @version $Rev$ $Date$ */ -public class TraxTransformerTestCase extends TestCase { +public class TraxTransformerTestCase { private URL url; - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { url = getClass().getResource("foo.xml"); } + @Test public void testTransformDOM() throws IOException { InputStream is = url.openStream(); InputStream2Node t1 = new InputStream2Node(); @@ -72,6 +71,7 @@ public class TraxTransformerTestCase extends TestCase { node = t5.transform(inputSource, null); } + @Test public void testTransformSAX() throws IOException { MyContentHandler handler = new MyContentHandler(); InputStream is = url.openStream(); |