mirror of
https://github.com/corda/corda.git
synced 2025-05-09 20:12:56 +00:00
CORDA-553 - Review comments
This commit is contained in:
parent
3350605536
commit
ecbb4330da
@ -10,7 +10,7 @@ import org.apache.qpid.proton.amqp.UnsignedLong
|
|||||||
* Repeated here for brevity:
|
* Repeated here for brevity:
|
||||||
* 50530 - R3 - Mike Hearn - mike&r3.com
|
* 50530 - R3 - Mike Hearn - mike&r3.com
|
||||||
*/
|
*/
|
||||||
const val DESCRIPTOR_TOP_32BITS: Long = 0xc562 shl(32 + 16)
|
const val DESCRIPTOR_TOP_32BITS: Long = 0xc562L shl(32 + 16)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AMQP desriptor ID's for our custom types.
|
* AMQP desriptor ID's for our custom types.
|
||||||
|
@ -35,14 +35,15 @@ enum class TransformTypes(val build: (Annotation) -> Transform) : DescribedType
|
|||||||
Rename({ a -> RenameSchemaTransform((a as CordaSerializationTransformRename).from, a.to) }) {
|
Rename({ a -> RenameSchemaTransform((a as CordaSerializationTransformRename).from, a.to) }) {
|
||||||
override fun getDescriptor(): Any = DESCRIPTOR
|
override fun getDescriptor(): Any = DESCRIPTOR
|
||||||
override fun getDescribed(): Any = ordinal
|
override fun getDescribed(): Any = ordinal
|
||||||
};
|
}
|
||||||
// Transform used to test the unknown handler, leave this at as the final constant, uncomment
|
// Transform used to test the unknown handler, leave this at as the final constant, uncomment
|
||||||
// when regenerating test cases - if Java had a pre-processor this would be much neater
|
// when regenerating test cases - if Java had a pre-processor this would be much neater
|
||||||
//
|
//
|
||||||
//UnknownTest({ a -> UnknownTestTransform((a as UnknownTransformAnnotation).a, a.b, a.c)}) {
|
//,UnknownTest({ a -> UnknownTestTransform((a as UnknownTransformAnnotation).a, a.b, a.c)}) {
|
||||||
// override fun getDescriptor(): Any = DESCRIPTOR
|
// override fun getDescriptor(): Any = DESCRIPTOR
|
||||||
// override fun getDescribed(): Any = ordinal
|
// override fun getDescribed(): Any = ordinal
|
||||||
//};
|
//}
|
||||||
|
;
|
||||||
|
|
||||||
companion object : DescribedTypeConstructor<TransformTypes> {
|
companion object : DescribedTypeConstructor<TransformTypes> {
|
||||||
val DESCRIPTOR = AMQPDescriptorRegistry.TRANSFORM_ELEMENT_KEY.amqpDescriptor
|
val DESCRIPTOR = AMQPDescriptorRegistry.TRANSFORM_ELEMENT_KEY.amqpDescriptor
|
||||||
|
@ -10,7 +10,6 @@ import kotlin.test.assertEquals
|
|||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
class EnumEvolvabilityTests {
|
class EnumEvolvabilityTests {
|
||||||
// var localPath = "file:///Users/katelynbaker/srcs-ide/corda/node-api/src/test/resources/net/corda/nodeapi/internal/serialization/amqp"
|
|
||||||
var localPath = "file:///home/katelyn/srcs/corda/node-api/src/test/resources/net/corda/nodeapi/internal/serialization/amqp"
|
var localPath = "file:///home/katelyn/srcs/corda/node-api/src/test/resources/net/corda/nodeapi/internal/serialization/amqp"
|
||||||
|
|
||||||
|
|
||||||
@ -417,6 +416,7 @@ class EnumEvolvabilityTests {
|
|||||||
|
|
||||||
// To regenerate the types for this test uncomment the UnknownTransformAnnotation from
|
// To regenerate the types for this test uncomment the UnknownTransformAnnotation from
|
||||||
// TransformTypes.kt and SupportedTransforms.kt
|
// TransformTypes.kt and SupportedTransforms.kt
|
||||||
|
// ALSO: remember to re-annotate the enum WithUnkownTest above
|
||||||
@Test
|
@Test
|
||||||
fun testUnknownTransform() {
|
fun testUnknownTransform() {
|
||||||
val resource = "EnumEvolvabilityTests.testUnknownTransform"
|
val resource = "EnumEvolvabilityTests.testUnknownTransform"
|
||||||
|
@ -30,8 +30,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class for the serialised version of this class
|
// Original version of the class for the serialised version of this class
|
||||||
// data class C (val a: Int, val b: Int)
|
// data class C (val a: Int, val b: Int)
|
||||||
// val sc = SerializationOutput(sf).serialize(C(A, B))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A, B)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(sc.bytes)
|
|
||||||
|
|
||||||
// new version of the class, in this case the order of the parameters has been swapped
|
// new version of the class, in this case the order of the parameters has been swapped
|
||||||
data class C(val b: Int, val a: Int)
|
data class C(val b: Int, val a: Int)
|
||||||
@ -55,8 +54,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class C (val a: Int, val b: String)
|
// data class C (val a: Int, val b: String)
|
||||||
// val sc = SerializationOutput(sf).serialize(C(A, B))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A, B)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(sc.bytes)
|
|
||||||
|
|
||||||
// new version of the class, in this case the order of the parameters has been swapped
|
// new version of the class, in this case the order of the parameters has been swapped
|
||||||
data class C(val b: String, val a: Int)
|
data class C(val b: String, val a: Int)
|
||||||
@ -78,8 +76,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class C(val a: Int)
|
// data class C(val a: Int)
|
||||||
// val sc = SerializationOutput(sf).serialize(C(A))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(C(A)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(sc.bytes)
|
|
||||||
|
|
||||||
data class C(val a: Int, val b: Int?)
|
data class C(val a: Int, val b: Int?)
|
||||||
|
|
||||||
@ -130,8 +127,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class CC(val a: Int, val b: String, val c: String, val d: Int)
|
// data class CC(val a: Int, val b: String, val c: String, val d: Int)
|
||||||
// val scc = SerializationOutput(sf).serialize(CC(A, B, C, D))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(CC(A, B, C, D)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(scc.bytes)
|
|
||||||
|
|
||||||
data class CC(val b: String, val d: Int)
|
data class CC(val b: String, val d: Int)
|
||||||
|
|
||||||
@ -158,8 +154,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class CC(val a: Int, val b: String, val c: String, val d: Int)
|
// data class CC(val a: Int, val b: String, val c: String, val d: Int)
|
||||||
// val scc = SerializationOutput(sf).serialize(CC(A, B, C, D))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(CC(A, B, C, D)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(scc.bytes)
|
|
||||||
|
|
||||||
data class CC(val a: Int, val e: Boolean?, val d: Int)
|
data class CC(val a: Int, val e: Boolean?, val d: Int)
|
||||||
|
|
||||||
@ -181,8 +176,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class CC(val a: Int)
|
// data class CC(val a: Int)
|
||||||
// val scc = SerializationOutput(sf).serialize(CC(A))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(CC(A)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(scc.bytes)
|
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
@Suppress("UNUSED")
|
||||||
data class CC(val a: Int, val b: String) {
|
data class CC(val a: Int, val b: String) {
|
||||||
@ -236,8 +230,7 @@ class EvolvabilityTests {
|
|||||||
|
|
||||||
// Original version of the class as it was serialised
|
// Original version of the class as it was serialised
|
||||||
// data class CC(val a: Int, val b: Int, val c: String)
|
// data class CC(val a: Int, val b: Int, val c: String)
|
||||||
// val scc = SerializationOutput(sf).serialize(CC(A, B, C))
|
// File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(CC(A, B, C)).bytes)
|
||||||
// File(URI("$localPath/$resource")).writeBytes(scc.bytes)
|
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
@Suppress("UNUSED")
|
||||||
data class CC(val a: Int, val b: Int, val c: String, val d: String) {
|
data class CC(val a: Int, val b: Int, val c: String, val d: String) {
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user