From 33270526aac57fecec2bbbcb167cd895e1b9d39d Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 11 Dec 2010 08:53:51 +0000 Subject: Fix testcase to close the writer git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1044590 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/implementation/jaxrs/xml/WriteTestCase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sca-java-2.x/trunk') diff --git a/sca-java-2.x/trunk/modules/implementation-jaxrs/src/test/java/org/apache/tuscany/sca/implementation/jaxrs/xml/WriteTestCase.java b/sca-java-2.x/trunk/modules/implementation-jaxrs/src/test/java/org/apache/tuscany/sca/implementation/jaxrs/xml/WriteTestCase.java index 7dcf70c711..4957f39c92 100644 --- a/sca-java-2.x/trunk/modules/implementation-jaxrs/src/test/java/org/apache/tuscany/sca/implementation/jaxrs/xml/WriteTestCase.java +++ b/sca-java-2.x/trunk/modules/implementation-jaxrs/src/test/java/org/apache/tuscany/sca/implementation/jaxrs/xml/WriteTestCase.java @@ -24,6 +24,7 @@ import java.io.InputStream; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamWriter; import junit.framework.TestCase; @@ -60,8 +61,9 @@ public class WriteTestCase extends TestCase { Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is), context); assertNotNull(composite); ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), context); - + XMLStreamWriter writer = outputFactory.createXMLStreamWriter(bos); + staxProcessor.write(composite, writer, context); + writer.close(); assertTrue(bos.toString().contains("application=\"test.MyJAXRSapp\"")); } -- cgit v1.2.3