From 324ef9cbd1b11e762190b72ede150e5ce8e7ea9e Mon Sep 17 00:00:00 2001 From: kiran Date: Thu, 21 May 2009 19:31:22 +0000 Subject: [PATCH] Test class for PathUtils. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@773 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/utils/PathUtilsTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 java/test/org/broadinstitute/sting/utils/PathUtilsTest.java diff --git a/java/test/org/broadinstitute/sting/utils/PathUtilsTest.java b/java/test/org/broadinstitute/sting/utils/PathUtilsTest.java new file mode 100755 index 000000000..1853c1da0 --- /dev/null +++ b/java/test/org/broadinstitute/sting/utils/PathUtilsTest.java @@ -0,0 +1,38 @@ +package org.broadinstitute.sting.utils; + +import org.broadinstitute.sting.BaseTest; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.Assert; + +import java.io.File; + +public class PathUtilsTest extends BaseTest { + @BeforeClass + public static void init() { } + + /** + * Tests that we can successfully refresh a volume + */ + @Test + public void testRefreshVolume() { + logger.warn("Executing testRefreshVolume"); + + Assert.assertTrue(successfullyRefreshedVolume(System.getProperty("java.io.tmpdir"))); + Assert.assertFalse(successfullyRefreshedVolume("/a/made/up/file.txt")); + } + + private boolean successfullyRefreshedVolume(String filename) { + boolean result = true; + + try { + PathUtils.refreshVolume(new File(filename)); + } catch (StingException e) { + result = false; + } + + logger.warn(filename + " is accessible : " + result); + + return result; + } +}