Commit 8469a4d0 authored by Peter van 't Hof's avatar Peter van 't Hof

Added more testing to gears

parent bc065254
...@@ -24,7 +24,7 @@ import org.testng.annotations.Test ...@@ -24,7 +24,7 @@ import org.testng.annotations.Test
/** /**
* Created by pjvan_thof on 2/5/16. * Created by pjvan_thof on 2/5/16.
*/ */
class GearsKrakenTest extends TestNGSuite with Matchers { class KrakenToKronaTest extends TestNGSuite with Matchers {
private def resourcePath(p: String): String = { private def resourcePath(p: String): String = {
Paths.get(getClass.getResource(p).toURI).toString Paths.get(getClass.getResource(p).toURI).toString
} }
......
...@@ -24,7 +24,7 @@ import org.testng.annotations.Test ...@@ -24,7 +24,7 @@ import org.testng.annotations.Test
/** /**
* Created by pjvan_thof on 2/5/16. * Created by pjvan_thof on 2/5/16.
*/ */
class GearsQiimeClosedTest extends TestNGSuite with Matchers { class BiomToKronaTest extends TestNGSuite with Matchers {
private def resourcePath(p: String): String = { private def resourcePath(p: String): String = {
Paths.get(getClass.getResource(p).toURI).toString Paths.get(getClass.getResource(p).toURI).toString
} }
......
...@@ -28,7 +28,7 @@ import org.testng.annotations.{ DataProvider, Test, AfterClass } ...@@ -28,7 +28,7 @@ import org.testng.annotations.{ DataProvider, Test, AfterClass }
/** /**
* Created by pjvanthof on 04/02/16. * Created by pjvanthof on 04/02/16.
*/ */
class GearsTest extends TestNGSuite with Matchers { abstract class GearsTest extends TestNGSuite with Matchers {
def initPipeline(map: Map[String, Any]): Gears = { def initPipeline(map: Map[String, Any]): Gears = {
new Gears { new Gears {
override def configNamespace = "gears" override def configNamespace = "gears"
...@@ -40,22 +40,36 @@ class GearsTest extends TestNGSuite with Matchers { ...@@ -40,22 +40,36 @@ class GearsTest extends TestNGSuite with Matchers {
} }
} }
def kraken: Option[Boolean] = None
def qiimeClosed: Boolean = false
def qiimeOpen: Boolean = false
def qiimeRtax: Boolean = false
def seqCount: Boolean = false
def libraryGears: Boolean = false
@DataProvider(name = "gearsOptions") @DataProvider(name = "gearsOptions")
def gearsOptions = { def gearsOptions = {
val bool = Array(true, false) val bool = Array(true, false)
for ( for (
s1 <- bool; s2 <- bool; qiimeClosed <- bool s1 <- bool; s2 <- bool
) yield Array("", s1, s2, qiimeClosed) ) yield Array("", s1, s2)
} }
@Test(dataProvider = "gearsOptions") @Test(dataProvider = "gearsOptions")
def testGears(dummy: String, sample1: Boolean, sample2: Boolean, qiimeCLosed: Boolean): Unit = { def testGears(dummy: String, sample1: Boolean, sample2: Boolean): Unit = {
val map = { val map = {
var m: Map[String, Any] = GearsTest.config var m: Map[String, Any] = GearsTest.config
if (sample1) m = ConfigUtils.mergeMaps(GearsTest.sample1, m) if (sample1) m = ConfigUtils.mergeMaps(GearsTest.sample1, m)
if (sample2) m = ConfigUtils.mergeMaps(GearsTest.sample2, m) if (sample2) m = ConfigUtils.mergeMaps(GearsTest.sample2, m)
ConfigUtils.mergeMaps(Map("gear_use_qiime_closed" -> qiimeCLosed), m) ConfigUtils.mergeMaps(Map(
"gears_use_qiime_rtax" -> qiimeRtax,
"gears_use_qiime_closed" -> qiimeClosed,
"gears_use_qiime_open" -> qiimeOpen,
"gears_use_seq_count" -> seqCount,
"library_gears" -> libraryGears,
"output_dir" -> TestGearsSingle.outputDir
) ++ kraken.map("gears_use_kraken" -> _), m)
} }
if (!sample1 && !sample2) { // When no samples if (!sample1 && !sample2) { // When no samples
...@@ -76,6 +90,22 @@ class GearsTest extends TestNGSuite with Matchers { ...@@ -76,6 +90,22 @@ class GearsTest extends TestNGSuite with Matchers {
} }
class GearsDefaultTest extends GearsTest
class GearsKrakenTest extends GearsTest {
override def kraken = Some(true)
}
class GearsQiimeClosedTest extends GearsTest {
override def kraken = Some(false)
override def qiimeClosed = true
}
class GearsQiimeOpenTest extends GearsTest {
override def kraken = Some(false)
override def qiimeOpen = true
}
class GearsLibraryTest extends GearsTest {
override def libraryGears = true
}
object GearsTest { object GearsTest {
val outputDir = Files.createTempDir() val outputDir = Files.createTempDir()
new File(outputDir, "input").mkdirs() new File(outputDir, "input").mkdirs()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment