Commit 11114bd8 authored by Ihrig, Arvid Conrad (ari)'s avatar Ihrig, Arvid Conrad (ari)
Browse files

Integrated Pipeline: renamed FileTree test data builder

parent 9050799d
......@@ -36,11 +36,11 @@ class ArchiveCleanUpFlowSpec extends WordSpec with MockitoSugar with TestDataBui
}
class DirectoryTreeFixture extends Fixture {
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Directory).build()
val treeTask = aFileTree().withTreeType(TreeType.Directory).build()
}
class ZipArchiveTreeFixture extends Fixture {
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Zip)
val treeTask = aFileTree().withTreeType(TreeType.Zip)
}
"An ArchiveCleanUpFlow" when {
......
......@@ -37,11 +37,11 @@ class ArchiveUnpackingFlowSpec extends WordSpec with MockitoSugar with TestDataB
}
class DirectoryTreeFixture extends Fixture {
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Directory).build()
val treeTask = aFileTree().withTreeType(TreeType.Directory).build()
}
class ZipArchiveTreeFixture extends Fixture {
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Zip).build()
val treeTask = aFileTree().withTreeType(TreeType.Zip).build()
when(archiveHandler.extractZipArchive(any())).thenReturn(Paths.get("/magic"))
}
......@@ -69,7 +69,7 @@ class ArchiveUnpackingFlowSpec extends WordSpec with MockitoSugar with TestDataB
"receiving signals from zip file trees" should {
"temporarily unpack archive when receiving the first task from a file tree" in {
val f = new ZipArchiveTreeFixture()
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Zip).withBasePath("/foo")
val treeTask = aFileTree().withTreeType(TreeType.Zip).withBasePath("/foo")
val task = aFileParsingTask().withTreeTask(treeTask)
f.source.sendNext(task)
f.drainStream()
......
......@@ -14,7 +14,7 @@ import eu.nomad_lab.parsers._
trait TestDataBuilders {
import scala.language.implicitConversions
def aFileTreeScanTask() = BuilderFileTreeScanTask()
def aFileTree() = BuilderFileTree()
def aFileParsingTask() = BuilderFileParsingTask()
def aFileParsingSignalEndTree() = BuilderFileParsingSignalEndTree()
......@@ -34,7 +34,7 @@ trait TestDataBuilders {
def aTreeParserEventScanError() = BuilderTreeParserEventScanError()
implicit def build(x: BuilderFileTreeScanTask): FileTree = x.build()
implicit def build(x: BuilderFileTree): FileTree = x.build()
implicit def build(x: BuilderFileParsingTask): FileParsingTask = x.build()
implicit def build(x: BuilderFileParsingSignalEndTree): FileParsingSignalEndTree = x.build()
......@@ -66,7 +66,7 @@ private object Defaults {
object MessageBuilders {
import Defaults._
case class BuilderFileTreeScanTask(
case class BuilderFileTree(
treeBasePath: Path = defaultPath,
treeType: TreeType = defaultTreeType
) {
......@@ -82,7 +82,7 @@ object MessageBuilders {
}
case class BuilderFileParsingTask(
private val treeTask: FileTree = BuilderFileTreeScanTask().build(),
private val treeTask: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val parserName: String = defaultParser,
private val extractedPath: Option[Path] = None
......@@ -103,7 +103,7 @@ object MessageBuilders {
}
case class BuilderFileParsingSignalEndTree(
private val treeTask: FileTree = BuilderFileTreeScanTask().build(),
private val treeTask: FileTree = BuilderFileTree().build(),
private val numTasks: Long = -1
) {
......@@ -154,7 +154,7 @@ object EventBuilders {
import Defaults._
case class BuilderTreeParserEventStart(
private val fileTree: FileTree = BuilderFileTreeScanTask().build()
private val fileTree: FileTree = BuilderFileTree().build()
) {
def withFileTree(tree: FileTree) = copy(fileTree = tree)
......@@ -168,7 +168,7 @@ object EventBuilders {
}
case class BuilderTreeParserEventCandidate(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val parser: String = defaultParser
) {
......@@ -189,7 +189,7 @@ object EventBuilders {
}
case class BuilderTreeParserEventScanError(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val error: Throwable = defaultError
) {
......@@ -210,7 +210,7 @@ object EventBuilders {
}
case class BuilderTreeParserEventEnd(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val numCandidates: Long = -1
) {
......@@ -227,7 +227,7 @@ object EventBuilders {
}
case class BuilderTreeParserEventTreeFailure(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val error: Throwable = defaultError
) {
......@@ -244,7 +244,7 @@ object EventBuilders {
}
case class BuilderCalculationParserEventStart(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val parser: String = defaultParser
) {
......@@ -265,7 +265,7 @@ object EventBuilders {
}
case class BuilderCalculationParserEventEnd(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val parser: String = defaultParser,
private val result: ParseResult = defaultParseResult,
......@@ -292,7 +292,7 @@ object EventBuilders {
}
case class BuilderResultWriterEventStart(
private val fileTree: FileTree = BuilderFileTreeScanTask().build()
private val fileTree: FileTree = BuilderFileTree().build()
) {
def withFileTree(tree: FileTree) = copy(fileTree = tree)
......@@ -306,7 +306,7 @@ object EventBuilders {
}
case class BuilderResultWriterEventResult(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val relativePath: Path = defaultPath,
private val parser: String = defaultParser,
private val result: ParseResult = defaultParseResult,
......@@ -333,7 +333,7 @@ object EventBuilders {
}
case class BuilderResultWriterEventEnd(
private val fileTree: FileTree = BuilderFileTreeScanTask().build(),
private val fileTree: FileTree = BuilderFileTree().build(),
private val numCalculations: Long = -1,
private val numParsingFailures: Long = -1,
private val outputLocation: Path = defaultPath
......
......@@ -160,7 +160,7 @@ class CalculationParsingEngineSpec extends WordSpec with MockitoSugar with TestD
"parse the main file when handling directories" in {
val f = new Fixture()
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Directory).withBasePath("/dir/bla")
val treeTask = aFileTree().withTreeType(TreeType.Directory).withBasePath("/dir/bla")
val task = sampleParseRequest.withTreeTask(treeTask).withRelativePath("magic")
f.worker.processSignal(task)
val expectedPath = Paths.get("/dir/bla/magic")
......@@ -169,7 +169,7 @@ class CalculationParsingEngineSpec extends WordSpec with MockitoSugar with TestD
"parse the temporarily extracted main file when handling zip archives" in {
val f = new Fixture
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Zip)
val treeTask = aFileTree().withTreeType(TreeType.Zip)
val extractedPath = Paths.get("/tmp/extracted/magic")
val task = sampleParseRequest.withTreeTask(treeTask).withExtractedPath(Some(extractedPath))
f.worker.processSignal(task)
......@@ -179,7 +179,7 @@ class CalculationParsingEngineSpec extends WordSpec with MockitoSugar with TestD
"gracefully fail parsing tasks from zip archives without extracted file path" in {
import FileParsingResultMatchers._
val f = new Fixture
val treeTask = aFileTreeScanTask().withTreeType(TreeType.Zip)
val treeTask = aFileTree().withTreeType(TreeType.Zip)
val task = sampleParseRequest.withTreeTask(treeTask)
val result = f.worker.processSignal(task).asInstanceOf[FileParsingResult]
result should have(status(ParseResult.ParseFailure), errorMessage("extracted file path", "missing"))
......@@ -189,7 +189,7 @@ class CalculationParsingEngineSpec extends WordSpec with MockitoSugar with TestD
import FileParsingResultMatchers._
val f = new Fixture
Seq(TreeType.Unknown, TreeType.File, TreeType.Tar).foreach { treeType =>
val treeTask = aFileTreeScanTask().withTreeType(treeType)
val treeTask = aFileTree().withTreeType(treeType)
val task = sampleParseRequest.withTreeTask(treeTask)
val result = f.worker.processSignal(task).asInstanceOf[FileParsingResult]
result should have(
......
......@@ -51,7 +51,7 @@ class FileTreeSpec extends WordSpec with Matchers with TestDataBuilders {
}
"throw an exception when handling non-rawdata zip archive file trees (unexpected filename)" in {
val failTree = aFileTreeScanTask().withTreeType(TreeType.Zip).withBasePath("/tmp/foo.zip")
val failTree = aFileTree().withTreeType(TreeType.Zip).withBasePath("/tmp/foo.zip")
an[UnsupportedOperationException] should be thrownBy failTree.archiveId
an[UnsupportedOperationException] should be thrownBy failTree.fileName
an[UnsupportedOperationException] should be thrownBy failTree.prefixFolder
......
......@@ -148,14 +148,14 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
Seq(anInMemoryResult(), aFileParsingSignalEndTree()),
have(
FileTreeParsingResultMatchers.numParsingTasks(2),
FileTreeParsingResultMatchers.treeTask(aFileTreeScanTask())
FileTreeParsingResultMatchers.treeTask(aFileTree())
)
)
"have called the file tree pre- and postprocessing operations in the correct order" in {
val f = createFixture()
f.orderingTest.verify(f.processingMock).startProcessingTreeResults(aFileTreeScanTask())
f.orderingTest.verify(f.processingMock).finishProcessingTreeResults(aFileTreeScanTask())
f.orderingTest.verify(f.processingMock).startProcessingTreeResults(aFileTree())
f.orderingTest.verify(f.processingMock).finishProcessingTreeResults(aFileTree())
}
"emit an end signal with the correct output location and type" in {
......@@ -179,7 +179,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
verify(f.eventMock, atLeastOnce()).processEvent(any(), args.capture())
val events = args.getAllValues.asScala.collect { case x: ResultWriterEventEnd => x }
exactly(1, events) should have(
basePath(aFileTreeScanTask().build().treeBasePath),
basePath(aFileTree().build().treeBasePath),
outputPath(s"/imaginary/foo/Rxx/R${"x" * 28}")
)
}
......@@ -211,8 +211,8 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
"have called the file tree pre- and postprocessing operations exactly once" in {
val f = createFixture()
verify(f.processingMock, times(1)).startProcessingTreeResults(aFileTreeScanTask())
verify(f.processingMock, times(1)).finishProcessingTreeResults(aFileTreeScanTask())
verify(f.processingMock, times(1)).startProcessingTreeResults(aFileTree())
verify(f.processingMock, times(1)).finishProcessingTreeResults(aFileTree())
}
"have send a single start event to the EventListener" in {
......@@ -221,7 +221,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
val args: ArgumentCaptor[ResultWriterEvent] = ArgumentCaptor.forClass(classOf[ResultWriterEvent])
verify(f.eventMock, atLeastOnce()).processEvent(any(), args.capture())
val events = args.getAllValues.asScala.collect { case x: ResultWriterEventStart => x }
exactly(1, events) should have(basePath(aFileTreeScanTask().build().treeBasePath))
exactly(1, events) should have(basePath(aFileTree().build().treeBasePath))
}
"have send a single end event to the EventListener" in {
......@@ -230,7 +230,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
val args: ArgumentCaptor[ResultWriterEvent] = ArgumentCaptor.forClass(classOf[ResultWriterEvent])
verify(f.eventMock, atLeastOnce()).processEvent(any(), args.capture())
val events = args.getAllValues.asScala.collect { case x: ResultWriterEventEnd => x }
exactly(1, events) should have(basePath(aFileTreeScanTask().build().treeBasePath))
exactly(1, events) should have(basePath(aFileTree().build().treeBasePath))
}
"be able to process the same file tree again after finishing it once" in {
......@@ -238,7 +238,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
f.manager.processSignal(anInMemoryResult())
f.manager.processSignal(anInMemoryResult())
f.manager.processSignal(aFileParsingSignalEndTree().withTaskCount(2))
verify(f.processingMock, times(2)).finishProcessingTreeResults(aFileTreeScanTask())
verify(f.processingMock, times(2)).finishProcessingTreeResults(aFileTree())
}
}
}
......@@ -269,7 +269,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
"process a file parsing result from another file tree" in {
import FileParsingResultMatchers._
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/universe/magic")
val fileTree = aFileTree().withBasePath("/universe/magic")
f.manager.processSignal(anInMemoryResult().withTreeTask(fileTree).withRelativePath("bar"))
val argument: ArgumentCaptor[FileParsingResult] = ArgumentCaptor.forClass(classOf[FileParsingResult])
verify(f.processingMock, atLeastOnce()).processFileParsingResult(argument.capture())
......@@ -282,7 +282,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
"interleave requests from another file tree" in {
import FileTreeParsingResultMatchers._
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/universe/magic")
val fileTree = aFileTree().withBasePath("/universe/magic")
f.manager.processSignal(anInMemoryResult().withTreeTask(fileTree))
f.manager.processSignal(aFileParsingSignalEndTree().withTreeTask(fileTree).withTaskCount(1))
f.manager.hasSignalToEmit() should be(true)
......@@ -293,14 +293,14 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
def startProcessingANewTree(createFixture: () => Fixture): Unit = {
"start processing a file tree when the first signal associated with it arrives (result arrives first)" in {
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/tmp/foo/random")
val fileTree = aFileTree().withBasePath("/tmp/foo/random")
f.manager.processSignal(anInMemoryResult().withTreeTask(fileTree))
verify(f.processingMock, times(1)).startProcessingTreeResults(fileTree)
}
"start processing a file tree when the first signal associated with it arrives (end signal arrives first)" in {
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/tmp/foo/random")
val fileTree = aFileTree().withBasePath("/tmp/foo/random")
f.manager.processSignal(aFileParsingSignalEndTree().withTreeTask(fileTree))
verify(f.processingMock, times(1)).startProcessingTreeResults(fileTree)
}
......@@ -308,7 +308,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
"send a start event to the EventListener when receiving a message from a new tree (result arrives first)" in {
import MatcherResultWriterEventStart._
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/tmp/foo/random")
val fileTree = aFileTree().withBasePath("/tmp/foo/random")
f.manager.processSignal(anInMemoryResult().withTreeTask(fileTree))
val args: ArgumentCaptor[ResultWriterEvent] = ArgumentCaptor.forClass(classOf[ResultWriterEvent])
verify(f.eventMock, atLeastOnce()).processEvent(any(), args.capture())
......@@ -319,7 +319,7 @@ class ParsingResultsProcessingManagerSpec extends WordSpec with MockitoSugar wit
"send a start event to the EventListener when receiving a message from a new tree (end signal arrives first)" in {
import MatcherResultWriterEventStart._
val f = createFixture()
val fileTree = aFileTreeScanTask().withBasePath("/tmp/foo/random")
val fileTree = aFileTree().withBasePath("/tmp/foo/random")
f.manager.processSignal(aFileParsingSignalEndTree().withTreeTask(fileTree))
val args: ArgumentCaptor[ResultWriterEvent] = ArgumentCaptor.forClass(classOf[ResultWriterEvent])
verify(f.eventMock, atLeastOnce()).processEvent(any(), args.capture())
......
......@@ -18,8 +18,8 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
private def argsCaptor(): ArgumentCaptor[TreeParserEvent] = ArgumentCaptor.forClass(classOf[TreeParserEvent])
private val sampleTreeTask = aFileTreeScanTask().withBasePath(".").build()
private val invalidTreeTask = aFileTreeScanTask().withBasePath("/imaginary/foo/magic").build()
private val sampleTreeTask = aFileTree().withBasePath(".").build()
private val invalidTreeTask = aFileTree().withBasePath("/imaginary/foo/magic").build()
class Fixture(sampleData: Iterator[Either[TreeParserEventScanError, FileParsingTask]]) {
val events = mock[EventListener]
......@@ -89,7 +89,7 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
"not having received a file tree scan task" should {
def createFixture = () => noTaskReceived()
behave like processorWithNoSignalReady(() => createFixture().treeParser, Seq(aFileTreeScanTask()))
behave like processorWithNoSignalReady(() => createFixture().treeParser, Seq(aFileTree()))
"register with the provided EventListener when receiving the first message" in {
val f = createFixture()
......@@ -131,7 +131,7 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
behave like processorWithOutboundSignalReady(
() => createFixture().treeParser,
Seq(aFileTreeScanTask()),
Seq(aFileTree()),
be(a[FileParsingTask]) and have(FileParsingTaskMatchers.relativePath("file1"))
)
......@@ -164,7 +164,7 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
behave like processorWithOutboundSignalReady(
() => createFixture().treeParser,
Seq(aFileTreeScanTask()),
Seq(aFileTree()),
be(a[FileParsingTask]) and have(FileParsingTaskMatchers.relativePath("file3"))
)
}
......@@ -174,7 +174,7 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
behave like processorWithOutboundSignalReady(
() => createFixture().treeParser,
Seq(aFileTreeScanTask()),
Seq(aFileTree()),
be(a[FileParsingSignalEndTree]) and have(FileParsingTaskMatchers.numParsingTasks(3))
)
......@@ -203,7 +203,7 @@ class TreeScannerSpec extends WordSpec with TestDataBuilders with MockitoSugar
behave like processorWithNoSignalReady(
() => createFixture().treeParser,
Seq(aFileTreeScanTask())
Seq(aFileTree())
)
}
......
......@@ -14,7 +14,7 @@ import scala.collection.mutable
class WriteToHDF5MergedResultsProcessorSpec extends WordSpec with Matchers with TestDataBuilders {
val sampleTree = aFileTreeScanTask().withBasePath(s"/foo/R${"x" * 28}.zip").withTreeType(TreeType.Directory).build()
val sampleTree = aFileTree().withBasePath(s"/foo/R${"x" * 28}.zip").withTreeType(TreeType.Directory).build()
val metaData = KnownMetaInfoEnvs.all
def validateHDFContent(expectedMainFileUris: mutable.Set[String])(calc: CalculationH5, mainFileUri: String): Unit = {
......@@ -59,13 +59,13 @@ class WriteToHDF5MergedResultsProcessorSpec extends WordSpec with Matchers with
"determining the output location" should {
"return the appropriate output location for a directory file tree" in {
val f = new WriteToHDF5MergedResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
val fileTree = aFileTree().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
f.outputLocation(fileTree) should be(Paths.get("/non/existing/location/bar"))
}
"return the appropriate output location for a zip archive file tree" in {
val f = new WriteToHDF5MergedResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
val fileTree = aFileTree().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
f.outputLocation(fileTree) should be(Paths.get(s"/non/existing/location/Rxx"))
}
}
......
......@@ -11,7 +11,7 @@ import org.scalatest.{ Matchers, WordSpec }
class WriteToHDF5ResultsProcessorSpec extends WordSpec with TestDataBuilders with Matchers {
val sampleTree = aFileTreeScanTask().withBasePath("/foo/bargus").withTreeType(TreeType.Directory)
val sampleTree = aFileTree().withBasePath("/foo/bargus").withTreeType(TreeType.Directory)
val metaData = KnownMetaInfoEnvs.all
def validateHDFContent(expectedMainFileUri: String)(calc: CalculationH5, mainFileUri: String): Unit = {
......@@ -45,13 +45,13 @@ class WriteToHDF5ResultsProcessorSpec extends WordSpec with TestDataBuilders wit
"determining the output location" should {
"return the appropriate output location for a directory file tree" in {
val f = new WriteToHDF5ResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
val fileTree = aFileTree().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
f.outputLocation(fileTree) should be(Paths.get("/non/existing/location/bar/bargus"))
}
"return the appropriate output location for a zip archive file tree" in {
val f = new WriteToHDF5ResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
val fileTree = aFileTree().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
f.outputLocation(fileTree) should be(Paths.get(s"/non/existing/location/Rxx/R${"x" * 28}"))
}
}
......
......@@ -13,7 +13,7 @@ import scala.io.Source
class WriteToJsonResultsProcessorSpec extends WordSpec with Matchers with TestDataBuilders {
val sampleTree = aFileTreeScanTask().withBasePath("/foo/bargus").withTreeType(TreeType.Directory)
val sampleTree = aFileTree().withBasePath("/foo/bargus").withTreeType(TreeType.Directory)
val metaData = KnownMetaInfoEnvs.all
"A WriteToJsonResultsProcessor" when {
......@@ -42,13 +42,13 @@ class WriteToJsonResultsProcessorSpec extends WordSpec with Matchers with TestDa
"determining the output location" should {
"return the appropriate output location for a directory file tree" in {
val f = new WriteToJsonResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
val fileTree = aFileTree().withTreeType(TreeType.Directory).withBasePath("foo/bargus")
f.outputLocation(fileTree) should be(Paths.get("/non/existing/location/bar/bargus"))
}
"return the appropriate output location for a zip archive file tree" in {
val f = new WriteToJsonResultsProcessor(Paths.get("/non/existing/location"), metaData)
val fileTree = aFileTreeScanTask().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
val fileTree = aFileTree().withTreeType(TreeType.Zip).withBasePath(s"foo/R${"x" * 28}.zip")
f.outputLocation(fileTree) should be(Paths.get(s"/non/existing/location/Rxx/R${"x" * 28}"))
}
}
......
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