[BUGFIX] Added throwable to method, instead of catching

This commit is contained in:
JKetelaar
2017-02-03 21:22:19 +01:00
parent 0badb2f094
commit 3198b3aff9
@@ -13,22 +13,18 @@ import java.io.IOException;
public class CacheValidationTest { public class CacheValidationTest {
@Test @Test
public void test(){ public void test() throws IOException {
try { File fileOne = new File(Directories.getCachePath(), "should-exist.tmp");
File fileOne = new File(Directories.getCachePath(), "should-exist.tmp"); File fileTwo = new File(Directories.getCachePath(), "should-not-exist.tmp");
File fileTwo = new File(Directories.getCachePath(), "should-not-exist.tmp");
fileOne.createNewFile(); fileOne.createNewFile();
fileTwo.createNewFile(); fileTwo.createNewFile();
fileTwo.setLastModified(System.currentTimeMillis() / 1000 - 350000); fileTwo.setLastModified(System.currentTimeMillis() / 1000 - 350000);
Directories.clearCache(259200, false); Directories.clearCache(259200, false);
Assert.assertTrue(fileOne.exists()); Assert.assertTrue(fileOne.exists());
Assert.assertTrue(!fileTwo.exists()); Assert.assertTrue(!fileTwo.exists());
} catch (IOException e) {
e.printStackTrace();
}
} }
} }