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:
Katelyn Baker 2017-08-17 14:17:59 +01:00
parent 6076d39ee4
commit e6e6644fc9
2 changed files with 4 additions and 16 deletions

View File

@ -1,7 +1,6 @@
package net.corda.nodeapi.internal.serialization
import net.corda.core.serialization.ClassWhitelist
import sun.jvm.hotspot.memory.Dictionary
import sun.misc.Unsafe
import sun.security.util.Password
import java.io.*

View File

@ -2,19 +2,8 @@ package net.corda.nodeapi.internal.serialization.amqp
import org.junit.Test
import java.util.*
import org.apache.qpid.proton.codec.Data
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 {
/**
* 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
}
val sf = SerializerFactory()
val sf = testDefaultFactory()
@Test
fun mapTest() {
@ -68,10 +57,10 @@ class DeserializeCollectionTests {
DeserializationInput(sf).deserialize(serialisedBytes)
}
@Test(expected=java.lang.IllegalArgumentException::class)
@Test(expected=java.io.NotSerializableException::class)
fun dictionaryTest() {
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 ("b", 2)
val c = C(v)
@ -83,7 +72,7 @@ class DeserializeCollectionTests {
@Test(expected=java.lang.IllegalArgumentException::class)
fun hashtableTest() {
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 ("b", 2)
val c = C(v)