From 7b7cac8c46748b7b4b28d09a6bbe1995b0392269 Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 11 Dec 2010 08:54:23 +0000 Subject: Fix testcase to close the writer git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1044591 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation') diff --git a/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java b/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java index ebad994033..57bfdbe822 100644 --- a/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java +++ b/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/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,7 +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("web-uri=\"MyWebapp\"")); -- cgit v1.2.3