Fixing two minor issues: 1) adding a new error message if the user adds a fasta file in a directory that doesn't exist; 2) renaming my sample unit tests so they actually run.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4299 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
bthomas 2010-09-16 20:45:51 +00:00
parent 3a400e3dc0
commit f66ef4626e
3 changed files with 13 additions and 3 deletions

View File

@ -51,6 +51,16 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener
* @param fastaFile Fasta file to be used as reference
*/
public ReferenceDataSource(File fastaFile) {
// does the fasta file exist? check that first...
if (!fastaFile.exists()) {
if (!fastaFile.getParentFile().exists())
throw new UserException("The fasta file path you provided is invalid. The directory " +
fastaFile.getParentFile().getAbsolutePath() + " does not exist." );
else
throw new UserException("The fasta file you provided does not exist.");
}
File indexFile = new File(fastaFile.getAbsolutePath() + ".fai");
File dictFile;
if (fastaFile.getAbsolutePath().endsWith("fa")) {

View File

@ -17,13 +17,13 @@ import java.util.Set;
* Date: Sep 9, 2010
* Time: 8:21:00 AM
*/
public class SampleDataSourceTest extends BaseTest {
public class SampleDataSourceUnitTest extends BaseTest {
// this empty header used to instantiate sampledatasource objects
private static SAMFileHeader header = new SAMFileHeader();
// all the test sample files are located here
private String sampleFilesDir = validationDataLocation + "sample/";
private String sampleFilesDir = validationDataLocation + "samples/";
// make sure samples are created from the SAM file correctly
@Test()

View File

@ -11,7 +11,7 @@ import org.junit.Test;
* Date: Sep 9, 2010
* Time: 8:21:00 AM
*/
public class SampleTest extends BaseTest {
public class SampleUnitTest extends BaseTest {
static Sample sampleA;
static Sample sampleA1;