From 723cb3e481ea08875759040ec945ef590d4ef17f Mon Sep 17 00:00:00 2001
From: Sander Bollen <a.h.b.bollen@lumc.nl>
Date: Thu, 9 Apr 2015 18:00:44 +0200
Subject: [PATCH] AnnotateVcfWithBedTest stub and improve argument descriptions
 in AnnotateVcfWithBed

---
 .../biopet/tools/AnnotateVcfWithBed.scala     |  4 +-
 .../biopet/tools/AnnotateVcfWithBedTest.scala | 42 +++++++++++++++++++
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBedTest.scala

diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
index da0ae72f8..b75ae9905 100644
--- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
+++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
@@ -56,10 +56,10 @@ object AnnotateVcfWithBed extends ToolCommand {
   class OptParser extends AbstractOptParser {
     opt[File]('I', "inputFile") required () unbounded () valueName ("<vcf file>") action { (x, c) =>
       c.copy(inputFile = x)
-    } text ("out is a required file property")
+    } text ("Input is a required file property")
     opt[File]('B', "bedFile") required () unbounded () valueName ("<bed file>") action { (x, c) =>
       c.copy(bedFile = x)
-    } text ("out is a required file property")
+    } text ("Bedfile is a required file property")
     opt[File]('o', "output") required () unbounded () valueName ("<vcf file>") action { (x, c) =>
       c.copy(outputFile = x)
     } text ("out is a required file property")
diff --git a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBedTest.scala b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBedTest.scala
new file mode 100644
index 000000000..b35f24e08
--- /dev/null
+++ b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBedTest.scala
@@ -0,0 +1,42 @@
+package nl.lumc.sasc.biopet.tools
+import java.nio.file.Paths
+
+import org.testng.annotations.Test
+import org.scalatest.Matchers
+import org.scalatest.mock.MockitoSugar
+import org.scalatest.testng.TestNGSuite
+
+import scala.util.Random
+/**
+ * Created by ahbbollen on 9-4-15.
+ */
+class AnnotateVcfWithBedTest extends TestNGSuite with MockitoSugar with Matchers {
+  import AnnotateVcfWithBed._
+
+  private def resourcePath(p: String): String = {
+    Paths.get(getClass.getResource(p).toURI).toString
+  }
+
+  val vepped_path = resourcePath("/VEP_oneline.vcf")
+  val bed = resourcePath("/rrna01.bed")
+  val rand = new Random()
+
+  @Test def testOutputTypeVcf() = {
+    val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf"
+    val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path, "-B", bed, "-f", "testing")
+    main(arguments)
+  }
+
+  @Test def testOutputTypeBcf() = {
+    val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".bcf"
+    val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path, "-B", bed, "-f", "testing")
+    main(arguments)
+  }
+
+  @Test def testOutputTypeVcfGz() = {
+    val tmp_path = "/tmp/VcfFilter_" + rand.nextString(10) + ".vcf.gz"
+    val arguments: Array[String] = Array("-I", vepped_path, "-o", tmp_path, "-B", bed, "-f", "testing")
+    main(arguments)
+  }
+
+}
-- 
GitLab