From a8bad0539ccc6f7c6799785510e77c058fe444ef Mon Sep 17 00:00:00 2001 From: Winston Li Date: Mon, 19 Sep 2016 10:07:46 +0100 Subject: [PATCH] Create/delete larger files in df test --- .../wlgitbridge/bridge/repo/FSGitRepoStoreTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java index 8c13f8c199..8d03201516 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest.java @@ -60,18 +60,19 @@ public class FSGitRepoStoreTest { public void totalSizeShouldChangeWhenFilesAreCreatedAndDeleted() throws IOException { long old = repoStore.totalSize(); - repoStore.remove("proj1"); - long new_ = repoStore.totalSize(); - assertTrue(new_ < old); + File temp = new File(repoStore.getRootDirectory(), "__temp.txt"); try ( OutputStream out = new FileOutputStream( - new File(repoStore.getRootDirectory(), "__temp.txt") + temp ) ) { - out.write(new byte[1 * 1024 * 1024]); + out.write(new byte[16 * 1024 * 1024]); } + long new_ = repoStore.totalSize(); + assertTrue(new_ > old); + assertTrue(temp.delete()); long new__ = repoStore.totalSize(); - assertTrue(new__ > new_); + assertTrue(new__ < new_); } @Test