You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2015/01/15 18:24:28 UTC

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

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());
+            }
         }
     }