BaseTest now has a global variable to turn off network connection requirement

This commit is contained in:
Mark DePristo 2012-03-30 08:34:35 -04:00
parent 097ed4ecc4
commit 976bac0452
1 changed files with 14 additions and 8 deletions

View File

@ -84,6 +84,7 @@ public abstract class BaseTest {
public static final String hg19Intervals = intervalsLocation + "whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.interval_list";
public static final String hg19Chr20Intervals = intervalsLocation + "whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.chr20.interval_list";
public static final boolean REQUIRE_NETWORK_CONNECTION = false;
public static final String networkTempDir;
public static final File networkTempDirFile;
@ -108,15 +109,20 @@ public abstract class BaseTest {
// Set the Root logger to only output warnings.
logger.setLevel(Level.WARN);
networkTempDirFile = IOUtils.tempDir("temp.", ".dir", new File("/broad/shptmp/" + System.getProperty("user.name")));
networkTempDirFile.deleteOnExit();
networkTempDir = networkTempDirFile.getAbsolutePath() + "/";
if ( REQUIRE_NETWORK_CONNECTION ) {
networkTempDirFile = IOUtils.tempDir("temp.", ".dir", new File("/broad/shptmp/" + System.getProperty("user.name")));
networkTempDirFile.deleteOnExit();
networkTempDir = networkTempDirFile.getAbsolutePath() + "/";
// find our file sources
// if (!fileExist(hg18Reference) || !fileExist(hg19Reference) || !fileExist(b36KGReference)) {
// logger.fatal("We can't locate the reference directories. Aborting!");
// throw new RuntimeException("BaseTest setup failed: unable to locate the reference directories");
// }
// find our file sources
if (!fileExist(hg18Reference) || !fileExist(hg19Reference) || !fileExist(b36KGReference)) {
logger.fatal("We can't locate the reference directories. Aborting!");
throw new RuntimeException("BaseTest setup failed: unable to locate the reference directories");
}
} else {
networkTempDir = null;
networkTempDirFile = null;
}
}
/**