Skip to content

Commit

Permalink
optimistic test fix attempt: load file within jar
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams committed Nov 4, 2014
1 parent e560f30 commit 6370b6c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions adam-cli/src/test/scala/org/bdgenomics/adam/cli/ViewSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package org.bdgenomics.adam.cli

import java.io.File
import java.io.{ FileNotFoundException, File }

import org.apache.commons.io.FileUtils
import org.apache.hadoop.mapreduce.Job
Expand All @@ -26,7 +26,14 @@ import org.bdgenomics.adam.rdd.ADAMContext._

class ViewSuite extends SparkFunSuite {

val inputSamPath = ClassLoader.getSystemClassLoader.getResource("flag-values.sam").getFile
val loader = Thread.currentThread().getContextClassLoader
val inputSamPath =
try {
loader.getResource("flag-values.sam").getFile
} catch {
case e: FileNotFoundException =>
loader.getResource("src/test/resources/flag-values.sam").getFile
}
val testDirectory = new File(inputSamPath).getParent
val intermediateAdamPath = "%s/flag-values.adam".format(testDirectory)
val unmappedAdamPath = "%s/flag-values-unmapped.adam".format(testDirectory)
Expand Down

0 comments on commit 6370b6c

Please sign in to comment.