Author: fmui
Date: Sat Mar 29 17:18:36 2014
New Revision: 1583030
URL: http://svn.apache.org/r1583030
Log:
close streams in unit test to remove temp files
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.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/AtomEntryParserTest.java?rev=1583030&r1=1583029&r2=1583030&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java
Sat Mar 29 17:18:36 2014
@@ -224,8 +224,9 @@ public class AtomEntryParserTest {
+
"<cmis:properties></cmis:properties></cmisra:object><title>some.file</title></entry>");
int contenSize = 50 * 1024 * 1024;
+ int base64Size = 4 * (contenSize + 2 - ((contenSize + 2) % 3)) / 3;
- byte[] entry = new byte[begin.length + contenSize + end.length];
+ byte[] entry = new byte[begin.length + base64Size + end.length];
System.arraycopy(begin, 0, entry, 0, begin.length);
System.arraycopy(end, 0, entry, entry.length - end.length, end.length);
@@ -238,6 +239,8 @@ public class AtomEntryParserTest {
assertNotNull(contentStream);
assertNotNull(contentStream.getStream());
+
+ contentStream.getStream().close();
}
private static byte[] parse(byte[] entry) throws Exception {
@@ -253,6 +256,8 @@ public class AtomEntryParserTest {
IOUtils.copy(contentStream.getStream(), baos);
+ contentStream.getStream().close();
+
return baos.toByteArray();
}
}