-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/2018-2-fileassetmanagertest'
- Loading branch information
Showing
2 changed files
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
val tapascoVersion = "2018.1-SNAPSHOT" | ||
val tapascoVersion = "2018.2" | ||
|
||
organization := "de.tu_darmstadt.esa.cs" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,12 @@ | |
* @authors J. Korinth, TU Darmstadt ([email protected]) | ||
**/ | ||
package de.tu_darmstadt.cs.esa.tapasco.filemgmt | ||
import de.tu_darmstadt.cs.esa.tapasco.base._ | ||
import de.tu_darmstadt.cs.esa.tapasco.base.json._ | ||
import org.scalatest._ | ||
import java.nio.file._ | ||
import de.tu_darmstadt.cs.esa.tapasco.base._ | ||
import de.tu_darmstadt.cs.esa.tapasco.base.json._ | ||
import org.scalatest._ | ||
import java.nio.file._ | ||
|
||
import de.tu_darmstadt.cs.esa.tapasco.util.Listener | ||
|
||
class FileAssetManagerSpec extends FlatSpec with Matchers { | ||
private final val TAPASCO_HOME = Paths.get(sys.env("TAPASCO_HOME")).toAbsolutePath.normalize | ||
|
@@ -69,12 +71,19 @@ class FileAssetManagerSpec extends FlatSpec with Matchers { | |
Files.createFile(zip) | ||
val t = Target(FileAssetManager.entities.architectures.toSeq.head, FileAssetManager.entities.platforms.toSeq.head) | ||
val core = Core(cf, zip, "Test", 42, "0.0.1", t, None, None) | ||
var updated : Boolean = false | ||
val listener = new Listener[FileAssetManager.Event] { | ||
override def update(e: FileAssetManager.Event): Unit = updated.synchronized{updated=true} | ||
} | ||
FileAssetManager.addListener(listener) | ||
Core.to(core, cf) | ||
|
||
while(!updated){ | ||
Thread.sleep(FS_SLEEP) | ||
} | ||
assert(FileAssetManager.entities.cores.size == 1) | ||
val c = FileAssetManager.entities.cores.toSeq.head | ||
assert(c equals core) | ||
|
||
FileAssetManager.remListener(listener) | ||
cf.toFile().deleteOnExit() | ||
zip.toFile().deleteOnExit() | ||
p.toFile().deleteOnExit() | ||
|