mirror of
https://github.com/corda/corda.git
synced 2024-12-22 06:17:55 +00:00
Fixes to bring into line with changes API
Can't have default factories now, they need building with whitelist and classloader. Also remove completely spurious import that broke everything, have a feeling that was something IntelliJ pulled in "to be helpful"
This commit is contained in:
parent
6076d39ee4
commit
e6e6644fc9
@ -1,7 +1,6 @@
|
|||||||
package net.corda.nodeapi.internal.serialization
|
package net.corda.nodeapi.internal.serialization
|
||||||
|
|
||||||
import net.corda.core.serialization.ClassWhitelist
|
import net.corda.core.serialization.ClassWhitelist
|
||||||
import sun.jvm.hotspot.memory.Dictionary
|
|
||||||
import sun.misc.Unsafe
|
import sun.misc.Unsafe
|
||||||
import sun.security.util.Password
|
import sun.security.util.Password
|
||||||
import java.io.*
|
import java.io.*
|
||||||
|
@ -2,19 +2,8 @@ package net.corda.nodeapi.internal.serialization.amqp
|
|||||||
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.apache.qpid.proton.codec.Data
|
|
||||||
|
|
||||||
class DeserializeCollectionTests {
|
class DeserializeCollectionTests {
|
||||||
|
|
||||||
class TestSerializationOutput(
|
|
||||||
private val verbose: Boolean,
|
|
||||||
serializerFactory: SerializerFactory = SerializerFactory()) : SerializationOutput(serializerFactory) {
|
|
||||||
|
|
||||||
override fun writeSchema(schema: Schema, data: Data) {
|
|
||||||
if (verbose) println(schema)
|
|
||||||
super.writeSchema(schema, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* If you want to see the schema encoded into the envelope after serialisation change this to true
|
* If you want to see the schema encoded into the envelope after serialisation change this to true
|
||||||
@ -22,7 +11,7 @@ class DeserializeCollectionTests {
|
|||||||
private const val VERBOSE = false
|
private const val VERBOSE = false
|
||||||
}
|
}
|
||||||
|
|
||||||
val sf = SerializerFactory()
|
val sf = testDefaultFactory()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun mapTest() {
|
fun mapTest() {
|
||||||
@ -68,10 +57,10 @@ class DeserializeCollectionTests {
|
|||||||
DeserializationInput(sf).deserialize(serialisedBytes)
|
DeserializationInput(sf).deserialize(serialisedBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=java.lang.IllegalArgumentException::class)
|
@Test(expected=java.io.NotSerializableException::class)
|
||||||
fun dictionaryTest() {
|
fun dictionaryTest() {
|
||||||
data class C(val c: Dictionary<String, Int>)
|
data class C(val c: Dictionary<String, Int>)
|
||||||
var v : Hashtable<String, Int> = Hashtable()
|
val v : Hashtable<String, Int> = Hashtable()
|
||||||
v.put ("a", 1)
|
v.put ("a", 1)
|
||||||
v.put ("b", 2)
|
v.put ("b", 2)
|
||||||
val c = C(v)
|
val c = C(v)
|
||||||
@ -83,7 +72,7 @@ class DeserializeCollectionTests {
|
|||||||
@Test(expected=java.lang.IllegalArgumentException::class)
|
@Test(expected=java.lang.IllegalArgumentException::class)
|
||||||
fun hashtableTest() {
|
fun hashtableTest() {
|
||||||
data class C(val c: Hashtable<String, Int>)
|
data class C(val c: Hashtable<String, Int>)
|
||||||
var v : Hashtable<String, Int> = Hashtable()
|
val v : Hashtable<String, Int> = Hashtable()
|
||||||
v.put ("a", 1)
|
v.put ("a", 1)
|
||||||
v.put ("b", 2)
|
v.put ("b", 2)
|
||||||
val c = C(v)
|
val c = C(v)
|
||||||
|
Loading…
Reference in New Issue
Block a user