cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1415207 - in /cxf/trunk: api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java
Date Thu, 29 Nov 2012 15:14:35 GMT
Author: ay
Date: Thu Nov 29 15:14:34 2012
New Revision: 1415207

URL: http://svn.apache.org/viewvc?rev=1415207&view=rev
Log:
fix those tests having problem when cos.threshold system prop is set low

Modified:
    cxf/trunk/api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java

Modified: cxf/trunk/api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java?rev=1415207&r1=1415206&r2=1415207&view=diff
==============================================================================
--- cxf/trunk/api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java (original)
+++ cxf/trunk/api/src/test/java/org/apache/cxf/io/CachedOutputStreamTest.java Thu Nov 29 15:14:34
2012
@@ -123,7 +123,7 @@ public class CachedOutputStreamTest exte
     public void testUseBusProps() throws Exception {
         Bus oldbus = BusFactory.getThreadDefaultBus(false); 
         try {
-            CachedOutputStream cos = new CachedOutputStream();
+            CachedOutputStream cos = new CachedOutputStream(64);
             cos.write("Hello World!".getBytes());
             cos.flush();
             assertNull("expects no tmp file", cos.getTempFile());

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java?rev=1415207&r1=1415206&r2=1415207&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java
(original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java
Thu Nov 29 15:14:34 2012
@@ -106,11 +106,13 @@ public class XSLTInterceptorsTest {
     @Test
     public void outStreamTest() throws SAXException, IOException, ParserConfigurationException
{
         CachedOutputStream cos = new CachedOutputStream();
+        cos.holdTempFile();
         message.setContent(OutputStream.class, cos);
         outInterceptor.handleMessage(message);
         OutputStream os = message.getContent(OutputStream.class);
         IOUtils.copy(messageIS, os);
         os.close();
+        cos.releaseTempFileHold();
         Document doc = DOMUtils.readXml(cos.getInputStream());
         Assert.assertTrue("Message was not transformed", checkTransformedXML(doc));
     }
@@ -118,12 +120,14 @@ public class XSLTInterceptorsTest {
     @Test
     public void outXMLStreamTest() throws XMLStreamException, SAXException, IOException,
ParserConfigurationException {
         CachedWriter cWriter = new CachedWriter();
+        cWriter.holdTempFile();
         XMLStreamWriter xWriter = StaxUtils.createXMLStreamWriter(cWriter);
         message.setContent(XMLStreamWriter.class, xWriter);
         outInterceptor.handleMessage(message);
         XMLStreamWriter tXWriter = message.getContent(XMLStreamWriter.class);
         StaxUtils.copy(new StreamSource(messageIS), tXWriter);
         tXWriter.close();
+        cWriter.releaseTempFileHold();
         Document doc = DOMUtils.readXml(cWriter.getReader());
         Assert.assertTrue("Message was not transformed", checkTransformedXML(doc));
     }



Mime
View raw message