CORDA-540: Introduce mandatory reason for "kryoSpecific" (#1386)

* CORDA-540: Introduce mandatory reason for "kryoSpecific"

... before we forget why they are ignored in such a way

* CORDA-540: Write a test that exposes list serialization problem in AMQP mode

* Revert "Remove CompositeSignaturesWithKeys"

This reverts commit 9b3cad3
This commit is contained in:
Viktor Kolomeyko
2017-09-01 14:45:14 +01:00
committed by GitHub
parent 6bc44b96f1
commit 954ed69102
6 changed files with 58 additions and 16 deletions

View File

@ -331,8 +331,7 @@ class AttachmentClassLoaderTests : TestDependencyInjectionBase() {
}
@Test
// Kryo verifies/loads attachments on deserialization, whereas AMQP currently does not
fun `test deserialize of WireTransaction where contract cannot be found`() = kryoSpecific<AttachmentClassLoaderTests> {
fun `test deserialize of WireTransaction where contract cannot be found`() = kryoSpecific<AttachmentClassLoaderTests>("Kryo verifies/loads attachments on deserialization, whereas AMQP currently does not") {
val child = ClassLoaderForTests()
val contractClass = Class.forName("net.corda.contracts.isolated.AnotherDummyContract", true, child)
val contract = contractClass.newInstance() as DummyContractBackdoor

View File

@ -0,0 +1,26 @@
package net.corda.nodeapi.internal.serialization
import net.corda.core.serialization.SerializedBytes
import net.corda.core.serialization.deserialize
import net.corda.core.serialization.serialize
import net.corda.testing.TestDependencyInjectionBase
import net.corda.testing.kryoSpecific
import org.junit.Test
import kotlin.test.assertEquals
class ListsSerializationTest : TestDependencyInjectionBase() {
@Test
fun `check list can be serialized as root of serialization graph`() = kryoSpecific<ListsSerializationTest>("AMQP doesn't support lists as the root of serialization graph"){
assertEqualAfterRoundTripSerialization(listOf(1))
assertEqualAfterRoundTripSerialization(listOf(1, 2))
}
private inline fun<reified T : Any> assertEqualAfterRoundTripSerialization(obj: T) {
val serializedForm: SerializedBytes<T> = obj.serialize()
val deserializedInstance = serializedForm.deserialize()
assertEquals(obj, deserializedInstance)
}
}