From deeadccac0b55b5d3a1950601d913d66a8e8620b Mon Sep 17 00:00:00 2001 From: bow <bow@bow.web.id> Date: Fri, 31 Oct 2014 16:22:28 +0100 Subject: [PATCH] Add test for unexpected interval file --- .../main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala | 2 +- .../nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala index 599d12f5b..3b921db8f 100644 --- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala +++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/WipeReads.scala @@ -450,4 +450,4 @@ object WipeReads extends ToolCommand { commandArgs.filteredOutBam.map(x => prepOutBam(x, commandArgs.inputBam, writeIndex = !commandArgs.noMakeIndex)) ) } -} +} \ No newline at end of file diff --git a/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala b/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala index 8b7cb2ac8..3929f13f8 100644 --- a/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala +++ b/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/WipeReadsUnitTest.scala @@ -125,6 +125,13 @@ class WipeReadsUnitTest extends TestNGSuite with MockitoSugar with Matchers { val RefFlatFile1 = new File(resourcePath("/rrna01.refFlat")) val GtfFile1 = new File(resourcePath("/rrna01.gtf")) + @Test def testMakeIntervalFromUnknown() = { + val thrown = intercept[IllegalArgumentException] { + makeIntervalFromFile(new File("false.bam")) + } + thrown.getMessage should ===("Unexpected interval file type: false.bam") + } + @Test def testMakeIntervalFromBed() = { val intervals: List[Interval] = makeIntervalFromFile(BedFile1) intervals.length shouldBe 3 -- GitLab