mirror of
https://github.com/corda/corda.git
synced 2025-03-11 06:54:04 +00:00
Merge pull request #1269 from corda/bugfix/kat/missingFactory
Re-re-move Java test to the correct location, fix compile issue
This commit is contained in:
commit
4b8d6e32c3
@ -168,8 +168,9 @@ public class JavaSerializationOutputTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Object serdes(Object obj) throws NotSerializableException {
|
private Object serdes(Object obj) throws NotSerializableException {
|
||||||
SerializerFactory factory = new SerializerFactory(AllWhitelist.INSTANCE, ClassLoader.getSystemClassLoader());
|
SerializerFactory factory1 = new SerializerFactory(AllWhitelist.INSTANCE, ClassLoader.getSystemClassLoader());
|
||||||
SerializationOutput ser = new SerializationOutput(factory);
|
SerializerFactory factory2 = new SerializerFactory(AllWhitelist.INSTANCE, ClassLoader.getSystemClassLoader());
|
||||||
|
SerializationOutput ser = new SerializationOutput(factory1);
|
||||||
SerializedBytes<Object> bytes = ser.serialize(obj);
|
SerializedBytes<Object> bytes = ser.serialize(obj);
|
||||||
|
|
||||||
DecoderImpl decoder = new DecoderImpl();
|
DecoderImpl decoder = new DecoderImpl();
|
||||||
@ -187,13 +188,13 @@ public class JavaSerializationOutputTests {
|
|||||||
Envelope result = (Envelope) decoder.readObject();
|
Envelope result = (Envelope) decoder.readObject();
|
||||||
assertTrue(result != null);
|
assertTrue(result != null);
|
||||||
|
|
||||||
DeserializationInput des = new DeserializationInput();
|
DeserializationInput des = new DeserializationInput(factory2);
|
||||||
Object desObj = des.deserialize(bytes, Object.class);
|
Object desObj = des.deserialize(bytes, Object.class);
|
||||||
assertTrue(Objects.deepEquals(obj, desObj));
|
assertTrue(Objects.deepEquals(obj, desObj));
|
||||||
|
|
||||||
// Now repeat with a re-used factory
|
// Now repeat with a re-used factory
|
||||||
SerializationOutput ser2 = new SerializationOutput(factory);
|
SerializationOutput ser2 = new SerializationOutput(factory1);
|
||||||
DeserializationInput des2 = new DeserializationInput(factory);
|
DeserializationInput des2 = new DeserializationInput(factory1);
|
||||||
Object desObj2 = des2.deserialize(ser2.serialize(obj), Object.class);
|
Object desObj2 = des2.deserialize(ser2.serialize(obj), Object.class);
|
||||||
assertTrue(Objects.deepEquals(obj, desObj2));
|
assertTrue(Objects.deepEquals(obj, desObj2));
|
||||||
// TODO: check schema is as expected
|
// TODO: check schema is as expected
|
Loading…
x
Reference in New Issue
Block a user