Test class for PathUtils.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@773 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2009-05-21 19:31:22 +00:00
parent 8515247575
commit 324ef9cbd1
1 changed files with 38 additions and 0 deletions

View File

@ -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;
}
}