-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
124 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package exceptions; | ||
|
||
public class InvalidTrackTypeException extends Exception { | ||
public InvalidTrackTypeException() { | ||
|
||
} | ||
public InvalidTrackTypeException(String message) | ||
{ | ||
super(message); | ||
} | ||
/** */ | ||
private static final long serialVersionUID = 1L; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package exceptions; | ||
|
||
public class SessionException extends Exception { | ||
public SessionException() { | ||
|
||
} | ||
public SessionException(String message) | ||
{ | ||
super(message); | ||
} | ||
private static final long serialVersionUID = 1L; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
package session; | ||
|
||
import coloring.Config; | ||
import com.esotericsoftware.yamlbeans.YamlException; | ||
import exceptions.InvalidConfigException; | ||
import exceptions.InvalidGenomicCoordsException; | ||
import exceptions.InvalidRecordException; | ||
import exceptions.SessionException; | ||
import org.junit.Test; | ||
import samTextViewer.GenomicCoords; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class SessionTest { | ||
/** TESTS: | ||
* genome.file not found | ||
* genome.file not valid | ||
* genome.file empty or not present (session doesn't have a genome) | ||
* genome.region Invalid (malformed, extending beyond contig, contig not found in genome.file) | ||
* genome.region empty or not present | ||
*/ | ||
@Test | ||
public void canReadSession() throws Exception { | ||
public void canReadValidGenome() throws IOException, InvalidConfigException, SessionException, InvalidGenomicCoordsException { | ||
new Config(null); | ||
Session session = new Session("test_data/session.yaml", "last", 80); | ||
System.err.println(session.getTrackSet().getTrackList()); | ||
Session session = new Session("test_data/session.yaml", "S2"); | ||
GenomicCoords gc = session.getGenome(); | ||
assertEquals((long)gc.getFrom(), 1); | ||
assertEquals((long)gc.getTo(), 10000); | ||
assertEquals(gc.getSamSeqDict().getSequence("chr7").getSequenceName(), "chr7"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters