You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/12/11 09:54:24 UTC
svn commit: r1044591 -
/tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
Author: antelder
Date: Sat Dec 11 08:54:23 2010
New Revision: 1044591
URL: http://svn.apache.org/viewvc?rev=1044591&view=rev
Log:
Fix testcase to close the writer
Modified:
tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java?rev=1044591&r1=1044590&r2=1044591&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java Sat Dec 11 08:54:23 2010
@@ -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 TestC
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\""));