chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1652177 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
Date Thu, 15 Jan 2015 17:24:28 GMT
Author: fmui
Date: Thu Jan 15 17:24:28 2015
New Revision: 1652177

URL: http://svn.apache.org/r1652177
Log:
fixed and improved unit test

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java?rev=1652177&r1=1652176&r2=1652177&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/ThresholdOutputStreamTest.java
Thu Jan 15 17:24:28 2015
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.se
 import static org.junit.Assert.assertArrayEquals;
 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 static org.junit.Assert.fail;
@@ -180,7 +181,17 @@ public class ThresholdOutputStreamTest {
                 assertTrue(tis.isInMemory());
             }
 
-            tos.close();
+            File tempFile = tis.getTemporaryFile();
+
+            tis.close();
+
+            assertEquals(-1, tis.read());
+            if (tis.isInMemory()) {
+                assertNull(tempFile);
+            } else {
+                assertNotNull(tempFile);
+                assertFalse(tempFile.exists());
+            }
         }
     }
 



Mime
View raw message