use of htsjdk.tribble.readers.LineReader in project gatk by broadinstitute.
the class TableCodecUnitTest method testDecodeFailsNoHeader.
@Test(expectedExceptions = UserException.MalformedFile.class)
public void testDecodeFailsNoHeader() {
TableCodec tc = new TableCodec();
LineReader reader = makeReader(asList("1:1 1 2 3"));
LineIterator li = new LineIteratorImpl(reader);
tc.readActualHeader(li);
}
use of htsjdk.tribble.readers.LineReader in project gatk by broadinstitute.
the class TableCodecUnitTest method testDecodeOnlyComments.
@Test
public void testDecodeOnlyComments() {
TableCodec tc = new TableCodec();
LineReader reader = makeReader(asList("#HEADER a b c", "#HEADER d e f"));
LineIterator li = new LineIteratorImpl(reader);
final List<String> strings = tc.readActualHeader(li);
Assert.assertEquals(strings, emptyList());
}
use of htsjdk.tribble.readers.LineReader in project gatk by broadinstitute.
the class TableCodecUnitTest method testTwoHeaders.
@Test
public void testTwoHeaders() {
TableCodec tc = new TableCodec();
LineReader reader = makeReader(asList("HEADER a b c", "HEADER d e f"));
LineIterator li = new LineIteratorImpl(reader);
final List<String> strings = tc.readActualHeader(li);
Assert.assertEquals(strings, asList("HEADER", "a", "b", "c"));
}
use of htsjdk.tribble.readers.LineReader in project gatk by broadinstitute.
the class TableCodecUnitTest method testDecodeHeader.
@Test
public void testDecodeHeader() {
TableCodec tc = new TableCodec();
LineReader reader = makeReader(asList("HEADER a b c"));
LineIterator li = new LineIteratorImpl(reader);
List<String> hd = tc.readActualHeader(li);
Assert.assertEquals(hd, asList("HEADER", "a", "b", "c"));
}
use of htsjdk.tribble.readers.LineReader in project gatk by broadinstitute.
the class TableCodecUnitTest method testDecodeHeader2.
@Test
public void testDecodeHeader2() {
TableCodec tc = new TableCodec();
final String str2 = "1:1 1 2 3";
LineReader reader = makeReader(asList("HEADER a b c", str2));
LineIterator li = new LineIteratorImpl(reader);
List<String> hd = tc.readActualHeader(li);
Assert.assertEquals(hd, asList("HEADER", "a", "b", "c"));
final TableFeature decode = tc.decode(str2);
Assert.assertEquals(decode.get("a"), "1");
Assert.assertEquals(decode.get("b"), "2");
Assert.assertEquals(decode.get("c"), "3");
Assert.assertEquals(decode.getLocation().getContig(), "1");
Assert.assertEquals(decode.getContig(), "1");
Assert.assertEquals(decode.getLocation().getStart(), 1);
Assert.assertEquals(decode.getLocation().getEnd(), 1);
}
Aggregations