Skip to content

Commit 17ebcaf

Browse files
committed
update test to exactly confirm 2 bytes post flush
1 parent 3b8bf99 commit 17ebcaf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/java/org/gluster/test/TestGlusterFuseOutputStream.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ public class TestGlusterFuseOutputStream {
1515

1616
@Test
1717
public void testOutputStream() throws IOException{
18-
File out = new File("/tmp/testGlusterFuseOutputStream");
19-
18+
File out = new File("/tmp/testGlusterFuseOutputStream"+System.currentTimeMillis());
19+
out.createNewFile();
2020
//Create a 3 byte FuseOutputStream
2121
final GlusterFUSEOutputStream stream = new GlusterFUSEOutputStream(out.getAbsolutePath(), true, 3);
2222

2323
stream.write("ab".getBytes());
24-
25-
long sizeBeforeFlush = out.length();
24+
System.out.println(out.length());
25+
26+
Assert.assertEquals(0, out.length());
2627

2728
stream.flush();
2829
stream.close();
2930

31+
System.out.println(out.length());
3032
//Confirm that the buffer held 100 bytes.
31-
Assert.assertTrue(out.length() > sizeBeforeFlush);
33+
Assert.assertEquals(2, out.length());
3234
out.delete();
3335
}
3436
}

0 commit comments

Comments
 (0)