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:
parent
3a400e3dc0
commit
f66ef4626e
|
|
@ -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")) {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
@ -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;
|
||||
Loading…
Reference in New Issue