From bdd80767815c50e04688b5aaf16249ae77ca9d08 Mon Sep 17 00:00:00 2001 From: Sander Bollen <a.h.b.bollen@lumc.nl> Date: Thu, 27 Aug 2015 14:36:02 +0200 Subject: [PATCH] FastqSplitterTest --- .../sasc/biopet/tools/FastqSplitterTest.scala | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSplitterTest.scala diff --git a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSplitterTest.scala b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSplitterTest.scala new file mode 100644 index 000000000..8f78acba7 --- /dev/null +++ b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/FastqSplitterTest.scala @@ -0,0 +1,41 @@ +package nl.lumc.sasc.biopet.tools + +import java.io.File +import java.nio.file.Paths + +import org.scalatest.Matchers +import org.scalatest.mock.MockitoSugar +import org.scalatest.testng.TestNGSuite +import org.testng.annotations.Test + +/** + * Created by ahbbollen on 27-8-15. + */ +class FastqSplitterTest extends TestNGSuite with MockitoSugar with Matchers { + + import FastqSplitter._ + private def resourcePath(p: String): String = { + Paths.get(getClass.getResource(p).toURI).toString + } + + val fq = resourcePath("/paired01a.fq") + + @Test + def testMain() = { + val temp = File.createTempFile("out", ".fastq") + + val args = Array("-I", fq, "-o", temp.getAbsolutePath) + main(args) + } + + @Test + def testManyOutMain() = { + val files = (0 until 10).map(_ => File.createTempFile("out", ".fastq")) + var args = Array("-I", fq) + files.foreach(x => args ++= Array("-o", x.getAbsolutePath)) + main(args) + } + + + +} -- GitLab