Github user Alex-Vol commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1468#discussion_r161384003
--- Diff:
lib/java/test/org/apache/thrift/transport/TestTSimpleFileTransport.java ---
@@ -27,21 +27,21 @@
public void testFresh() throws Exception {
//Test write side
Path tempFilePathName =
Files.createTempFile("TSimpleFileTransportTest", null);
- Files.delete(tempFilePathName);
+ Files.delete(tempFilePathName);
byte[] input_buf = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
TSimpleFileTransport trans_write = new
TSimpleFileTransport(tempFilePathName.toString(),false, true, false);
assert (!trans_write.isOpen());
trans_write.open();
assert(trans_write.isOpen());
trans_write.write(input_buf);
- trans_write.write(input_buf,2,2);
+ trans_write.write(input_buf,2,2);
trans_write.flush();
trans_write.close();
-
+
//Test read side
TSimpleFileTransport trans = new
TSimpleFileTransport(tempFilePathName.toString(),true, false);
- assert(trans_write.isOpen());
--- End diff --
This one line was asserting against the wrong object. The trans_write
object is quite obviously closed and the trans object was just opened.
---