Commit 8cd22458 authored by bow's avatar bow
Browse files

Add test for Gentrap initialization with minimum config

parent a0b22bd9
......@@ -44,5 +44,17 @@
<artifactId>Mapping</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>2.2.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
/**
* Copyright (c) 2015 Leiden University Medical Center - Sequencing Analysis Support Core <sasc@lumc.nl>
* @author Wibowo Arindrarto <w.arindrarto@lumc.nl>
*/
package nl.lumc.sasc.biopet.pipelines.gentrap
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
import nl.lumc.sasc.biopet.core.config.Config
class GentrapTest extends TestNGSuite with Matchers {
/** Method to set test config */
// since the pipeline Config is a global value, we first store the
// initial config into a value, store the supplied value, then return
// the initial config for restoring later
private def setConfig(map: Map[String, Any]): Map[String, Any] = {
val oldMap: Map[String, Any] = Config.global.map.toMap
Config.global.map = map
oldMap
}
/** Method to set the global config */
private def restoreConfig(initConfig: Map[String, Any]): Unit = Config.global.map = initConfig
/** Minimum config required for Gentrap */
private val minimumConfig = Map(
"output_dir" -> "/tmp",
"aligner" -> "gsnap",
"reference" -> "mock",
"gsnap" -> Map("db" -> "fixt_gentrap_hg19"),
"samples" -> Map(
"sample_1" -> Map(
"libraries" -> Map(
"lib_1" -> Map(
"R1" -> "/tmp/mock.fq"
)
)
)
)
)
// Test pipeline initialization with minimum config -- there should be no exceptions raised
@Test def testInitMinimumConfig() = {
val initialConfig = setConfig(minimumConfig)
val gentrap = new Gentrap()
restoreConfig(initialConfig)
}
}
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