From 7f6826123cfcda3ff0ba21188a0e5fb48e56380e Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Sat, 1 Aug 2015 15:24:27 +0200
Subject: [PATCH] Improved unit test

---
 .../lumc/sasc/biopet/tools/VcfWithVcfTest.scala | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfWithVcfTest.scala b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfWithVcfTest.scala
index 75ba6c3ab..9996dfed3 100644
--- a/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfWithVcfTest.scala
+++ b/public/biopet-framework/src/test/scala/nl/lumc/sasc/biopet/tools/VcfWithVcfTest.scala
@@ -15,6 +15,7 @@
  */
 package nl.lumc.sasc.biopet.tools
 
+import java.io.File
 import java.nio.file.Paths
 
 import org.scalatest.Matchers
@@ -36,25 +37,25 @@ class VcfWithVcfTest extends TestNGSuite with MockitoSugar with Matchers {
     Paths.get(getClass.getResource(p).toURI).toString
   }
 
-  val vepped_path = resourcePath("/VEP_oneline.vcf.gz")
-  val unvepped_path = resourcePath("/unvepped.vcf.gz")
+  val veppedPath = resourcePath("/VEP_oneline.vcf.gz")
+  val unveppedPath = resourcePath("/unvepped.vcf.gz")
   val rand = new Random()
 
   @Test def testOutputTypeVcf() = {
-    val tmp_path = "/tmp/VcfWithVcf_" + rand.nextString(10) + ".vcf"
-    val arguments = Array("-I", unvepped_path, "-s", vepped_path, "-o", tmp_path, "-f", "CSQ")
+    val tmpPath = File.createTempFile("VcfWithVcf_", ".vcf").getAbsolutePath
+    val arguments = Array("-I", unveppedPath, "-s", veppedPath, "-o", tmpPath, "-f", "CSQ")
     main(arguments)
   }
 
   @Test def testOutputTypeVcfGz() = {
-    val tmp_path = "/tmp/VcfWithVcf_" + rand.nextString(10) + ".vcf.gz"
-    val arguments = Array("-I", unvepped_path, "-s", vepped_path, "-o", tmp_path, "-f", "CSQ")
+    val tmpPath = File.createTempFile("VcfWithVcf_", ".vcf").getAbsolutePath
+    val arguments = Array("-I", unveppedPath, "-s", veppedPath, "-o", tmpPath, "-f", "CSQ")
     main(arguments)
   }
 
   @Test def testOutputTypeBcf() = {
-    val tmp_path = "/tmp/VcfWithVcf_" + rand.nextString(10) + ".bcf"
-    val arguments = Array("-I", unvepped_path, "-s", vepped_path, "-o", tmp_path, "-f", "CSQ")
+    val tmpPath = File.createTempFile("VcfWithVcf_", ".vcf").getAbsolutePath
+    val arguments = Array("-I", unveppedPath, "-s", veppedPath, "-o", tmpPath, "-f", "CSQ")
     main(arguments)
   }
 
-- 
GitLab