Remove dependencies from classpath in SIMM valuation integ test (#4603)

This commit is contained in:
Dimos Raptis 2019-01-18 13:02:17 +00:00 committed by GitHub
parent 26cfea202b
commit 22f960fb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 13 deletions

View File

@ -38,21 +38,12 @@ class SimmValuationTest {
const val testTradeId = "trade1" const val testTradeId = "trade1"
} }
@Before
fun setup() {
System.setProperty(AbstractAMQPSerializationScheme.SCAN_SPEC_PROP_NAME, CurrencyParameterSensitivitiesSerializer::class.packageName)
}
@After
fun tearDown() {
System.clearProperty(AbstractAMQPSerializationScheme.SCAN_SPEC_PROP_NAME)
}
@Test @Test
fun `runs SIMM valuation demo`() { fun `runs SIMM valuation demo`() {
val logConfigFile = projectRootDir / "samples" / "simm-valuation-demo" / "src" / "main" / "resources" / "log4j2.xml" val logConfigFile = projectRootDir / "samples" / "simm-valuation-demo" / "src" / "main" / "resources" / "log4j2.xml"
assertThat(logConfigFile).isRegularFile() assertThat(logConfigFile).isRegularFile()
driver(DriverParameters(isDebug = true, driver(DriverParameters(isDebug = true,
startNodesInProcess = false, // starting nodes in separate processes to ensure system class path does not contain 3rd party libraries (masking serialization issues)
cordappsForAllNodes = listOf(findCordapp("net.corda.vega.flows"), findCordapp("net.corda.vega.contracts"), findCordapp("net.corda.confidential")) + FINANCE_CORDAPPS, cordappsForAllNodes = listOf(findCordapp("net.corda.vega.flows"), findCordapp("net.corda.vega.contracts"), findCordapp("net.corda.confidential")) + FINANCE_CORDAPPS,
systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString())) systemProperties = mapOf("log4j.configurationFile" to logConfigFile.toString()))
) { ) {

View File

@ -768,9 +768,10 @@ class DriverDSLImpl(
it += extraCmdLineFlag it += extraCmdLineFlag
}.toList() }.toList()
// This excludes the samples and the finance module from the system classpath of the out of process nodes // The following dependencies are excluded from the classpath of the created JVM, so that the environment resembles a real one as close as possible.
// as they will be added to the cordapps folder. // These are either classes that will be added as attachments to the node (i.e. samples, finance, opengamma etc.) or irrelevant testing libraries (test, corda-mock etc.).
val exclude = listOf("samples", "finance", "integrationTest", "test", "corda-mock") // TODO: There is pending work to fix this issue without custom blacklisting. See: https://r3-cev.atlassian.net/browse/CORDA-2164.
val exclude = listOf("samples", "finance", "integrationTest", "test", "corda-mock", "com.opengamma.strata")
val cp = ProcessUtilities.defaultClassPath.filterNot { cpEntry -> val cp = ProcessUtilities.defaultClassPath.filterNot { cpEntry ->
exclude.any { token -> cpEntry.contains("${File.separatorChar}$token") } || cpEntry.endsWith("-tests.jar") exclude.any { token -> cpEntry.contains("${File.separatorChar}$token") } || cpEntry.endsWith("-tests.jar")
} }