mirror of
https://github.com/corda/corda.git
synced 2025-04-11 21:31:44 +00:00
Introduced a property to be able to enable AMQP mode from command line for Gradle run (#1316)
This can be useful if we decide to create a custom TeamCity configuration that will enable us to independently run *all* tests in AMQP mode to know where we stand.
This commit is contained in:
parent
e1547073ce
commit
4995b7a1bd
@ -127,6 +127,13 @@ allprojects {
|
||||
tasks.withType(Test) {
|
||||
// Prevent the project from creating temporary files outside of the build directory.
|
||||
systemProperties['java.io.tmpdir'] = buildDir
|
||||
|
||||
// Ensures that "net.corda.testing.amqp.enable" is passed correctly from Gradle command line
|
||||
// down to JVM executing unit test. It looks like we are running unit tests in the forked mode
|
||||
// and all the "-D" parameters passed to Gradle not making it to unit test level
|
||||
// TODO: Remove once we fully switched to AMQP
|
||||
final AMQP_ENABLE_PROP_NAME = "net.corda.testing.amqp.enable"
|
||||
systemProperty(AMQP_ENABLE_PROP_NAME, System.getProperty(AMQP_ENABLE_PROP_NAME))
|
||||
}
|
||||
|
||||
group 'net.corda'
|
||||
|
@ -66,7 +66,14 @@ fun initialiseTestSerialization() {
|
||||
registerScheme(AMQPClientSerializationScheme())
|
||||
registerScheme(AMQPServerSerializationScheme())
|
||||
}
|
||||
(SerializationDefaults.P2P_CONTEXT as TestSerializationContext).delegate = KRYO_P2P_CONTEXT
|
||||
|
||||
val AMQP_ENABLE_PROP_NAME = "net.corda.testing.amqp.enable"
|
||||
// TODO: Remove these "if" conditions once we fully switched to AMQP
|
||||
(SerializationDefaults.P2P_CONTEXT as TestSerializationContext).delegate = if (java.lang.Boolean.getBoolean(AMQP_ENABLE_PROP_NAME)) {
|
||||
AMQP_P2P_CONTEXT
|
||||
} else {
|
||||
KRYO_P2P_CONTEXT
|
||||
}
|
||||
(SerializationDefaults.RPC_SERVER_CONTEXT as TestSerializationContext).delegate = KRYO_RPC_SERVER_CONTEXT
|
||||
(SerializationDefaults.RPC_CLIENT_CONTEXT as TestSerializationContext).delegate = KRYO_RPC_CLIENT_CONTEXT
|
||||
(SerializationDefaults.STORAGE_CONTEXT as TestSerializationContext).delegate = KRYO_STORAGE_CONTEXT
|
||||
|
Loading…
x
Reference in New Issue
Block a user