CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72)

This commit is contained in:
Chris Rankin 2019-09-19 22:04:24 +01:00 committed by GitHub
parent 8718433be6
commit d604308563
2 changed files with 12 additions and 3 deletions

View File

@ -23,6 +23,9 @@ allprojects {
maven {
url "$artifactory_contextUrl/corda-dev"
}
maven {
url "$artifactory_contextUrl/corda-dependencies"
}
}
configurations {

View File

@ -81,16 +81,21 @@ abstract class TestBase(type: SandboxType) {
}
fun sandbox(action: SandboxRuntimeContext.() -> Unit) {
return sandbox(WARNING, emptySet(), false, action)
return sandbox(WARNING, emptySet(), emptySet(), false, action)
}
fun sandbox(visibleAnnotations: Set<Class<out Annotation>>, action: SandboxRuntimeContext.() -> Unit) {
return sandbox(WARNING, visibleAnnotations, false, action)
return sandbox(WARNING, visibleAnnotations, emptySet(), false, action)
}
fun sandbox(visibleAnnotations: Set<Class<out Annotation>>, sandboxOnlyAnnotations: Set<String>, action: SandboxRuntimeContext.() -> Unit) {
return sandbox(WARNING, visibleAnnotations, sandboxOnlyAnnotations, false, action)
}
fun sandbox(
minimumSeverityLevel: Severity,
visibleAnnotations: Set<Class<out Annotation>>,
sandboxOnlyAnnotations: Set<String>,
enableTracing: Boolean,
action: SandboxRuntimeContext.() -> Unit
) {
@ -101,7 +106,8 @@ abstract class TestBase(type: SandboxType) {
val analysisConfiguration = configuration.analysisConfiguration.createChild(
userSource = userSource,
newMinimumSeverityLevel = minimumSeverityLevel,
visibleAnnotations = visibleAnnotations
visibleAnnotations = visibleAnnotations,
sandboxOnlyAnnotations = sandboxOnlyAnnotations
)
SandboxRuntimeContext(SandboxConfiguration.of(
configuration.executionProfile,