mirror of
https://github.com/corda/corda.git
synced 2024-12-29 17:28:56 +00:00
CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76)
This commit is contained in:
parent
ed23c4b998
commit
3d0a4aa614
@ -20,6 +20,7 @@ import java.nio.file.Files.exists
|
||||
import java.nio.file.Files.isDirectory
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import java.util.function.Consumer
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
@Suppress("unused", "MemberVisibilityCanBePrivate")
|
||||
@ -93,12 +94,11 @@ abstract class TestBase(type: SandboxType) {
|
||||
thread {
|
||||
try {
|
||||
UserPathSource(classPaths).use { userSource ->
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(
|
||||
userSource = userSource,
|
||||
newMinimumSeverityLevel = minimumSeverityLevel,
|
||||
visibleAnnotations = visibleAnnotations,
|
||||
sandboxOnlyAnnotations = sandboxOnlyAnnotations
|
||||
)).use {
|
||||
SandboxRuntimeContext(parentConfiguration.createChild(userSource, Consumer {
|
||||
it.withNewMinimumSeverityLevel(minimumSeverityLevel)
|
||||
.withSandboxOnlyAnnotations(sandboxOnlyAnnotations)
|
||||
.withVisibleAnnotations(visibleAnnotations)
|
||||
})).use {
|
||||
action(this)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user