mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-08 02:40:09 +00:00
java: changes Template interface: unpack(Unpacker, Object to = null), convert(MessagePackObject from, Object to = null)
This commit is contained in:
parent
e9d44b90bc
commit
76679d33df
36 changed files with 473 additions and 313 deletions
|
|
@ -102,6 +102,14 @@ public class TestMessagePackStaticMethods extends TestCase {
|
|||
assertEquals(eobj, createProvidedClass());
|
||||
assertEquals(fobj, createUserDefinedClass());
|
||||
}
|
||||
|
||||
{
|
||||
ProvidedClass eobj = MessagePack.unpack(e, createProvidedClass());
|
||||
UserDefinedClass fobj = MessagePack.unpack(f, createUserDefinedClass());
|
||||
|
||||
assertEquals(eobj, createProvidedClass());
|
||||
assertEquals(fobj, createUserDefinedClass());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -164,6 +172,17 @@ public class TestMessagePackStaticMethods extends TestCase {
|
|||
assertEquals(eobj, createProvidedClass());
|
||||
assertEquals(fobj, createUserDefinedClass());
|
||||
}
|
||||
|
||||
{
|
||||
InputStream ein = new ByteArrayInputStream(eout.toByteArray());
|
||||
InputStream fin = new ByteArrayInputStream(fout.toByteArray());
|
||||
|
||||
ProvidedClass eobj = MessagePack.unpack(ein, createProvidedClass());
|
||||
UserDefinedClass fobj = MessagePack.unpack(fin, createUserDefinedClass());
|
||||
|
||||
assertEquals(eobj, createProvidedClass());
|
||||
assertEquals(fobj, createUserDefinedClass());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -58,14 +58,14 @@ public class TestPackConvert extends TestCase {
|
|||
Byte dst = null;
|
||||
try {
|
||||
tmpl = ByteTemplate.getInstance();
|
||||
dst = (Byte) tmpl.convert(obj);
|
||||
dst = (Byte) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(ByteTemplate.getInstance());
|
||||
dst = (Byte) tmpl.convert(obj);
|
||||
dst = (Byte) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -101,14 +101,14 @@ public class TestPackConvert extends TestCase {
|
|||
Short dst = null;
|
||||
try {
|
||||
tmpl = ShortTemplate.getInstance();
|
||||
dst = (Short) tmpl.convert(obj);
|
||||
dst = (Short) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(ShortTemplate.getInstance());
|
||||
dst = (Short) tmpl.convert(obj);
|
||||
dst = (Short) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -144,14 +144,14 @@ public class TestPackConvert extends TestCase {
|
|||
Integer dst = null;
|
||||
try {
|
||||
tmpl = IntegerTemplate.getInstance();
|
||||
dst = (Integer) tmpl.convert(obj);
|
||||
dst = (Integer) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(IntegerTemplate.getInstance());
|
||||
dst = (Integer) tmpl.convert(obj);
|
||||
dst = (Integer) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -189,14 +189,14 @@ public class TestPackConvert extends TestCase {
|
|||
Long dst = null;
|
||||
try {
|
||||
tmpl = LongTemplate.getInstance();
|
||||
dst = (Long) tmpl.convert(obj);
|
||||
dst = (Long) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(LongTemplate.getInstance());
|
||||
dst = (Long) tmpl.convert(obj);
|
||||
dst = (Long) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -238,14 +238,14 @@ public class TestPackConvert extends TestCase {
|
|||
BigInteger dst = null;
|
||||
try {
|
||||
tmpl = BigIntegerTemplate.getInstance();
|
||||
dst = (BigInteger) tmpl.convert(obj);
|
||||
dst = (BigInteger) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(BigIntegerTemplate.getInstance());
|
||||
dst = (BigInteger) tmpl.convert(obj);
|
||||
dst = (BigInteger) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -285,14 +285,14 @@ public class TestPackConvert extends TestCase {
|
|||
Float dst = null;
|
||||
try {
|
||||
tmpl = FloatTemplate.getInstance();
|
||||
dst = (Float) tmpl.convert(obj);
|
||||
dst = (Float) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(FloatTemplate.getInstance());
|
||||
dst = (Float) tmpl.convert(obj);
|
||||
dst = (Float) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -331,14 +331,14 @@ public class TestPackConvert extends TestCase {
|
|||
Double dst = null;
|
||||
try {
|
||||
tmpl = DoubleTemplate.getInstance();
|
||||
dst = (Double) tmpl.convert(obj);
|
||||
dst = (Double) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(DoubleTemplate.getInstance());
|
||||
dst = (Double) tmpl.convert(obj);
|
||||
dst = (Double) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -367,14 +367,14 @@ public class TestPackConvert extends TestCase {
|
|||
Boolean dst = null;
|
||||
try {
|
||||
tmpl = BooleanTemplate.getInstance();
|
||||
dst = (Boolean) tmpl.convert(obj);
|
||||
dst = (Boolean) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(BooleanTemplate.getInstance());
|
||||
dst = (Boolean) tmpl.convert(obj);
|
||||
dst = (Boolean) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -435,14 +435,14 @@ public class TestPackConvert extends TestCase {
|
|||
String dst = null;
|
||||
try {
|
||||
tmpl = StringTemplate.getInstance();
|
||||
dst = (String) tmpl.convert(obj);
|
||||
dst = (String) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(StringTemplate.getInstance());
|
||||
dst = (String) tmpl.convert(obj);
|
||||
dst = (String) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,14 +61,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = ByteTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Byte) tmpl.unpack(unpacker);
|
||||
dst = (Byte) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(ByteTemplate.getInstance());
|
||||
dst = (Byte) tmpl.unpack(unpacker);
|
||||
dst = (Byte) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -107,14 +107,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = ShortTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Short) tmpl.unpack(unpacker);
|
||||
dst = (Short) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(ShortTemplate.getInstance());
|
||||
dst = (Short) tmpl.unpack(unpacker);
|
||||
dst = (Short) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -153,14 +153,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = IntegerTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Integer) tmpl.unpack(unpacker);
|
||||
dst = (Integer) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(IntegerTemplate.getInstance());
|
||||
dst = (Integer) tmpl.unpack(unpacker);
|
||||
dst = (Integer) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -201,14 +201,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = LongTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Long) tmpl.unpack(unpacker);
|
||||
dst = (Long) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(LongTemplate.getInstance());
|
||||
dst = (Long) tmpl.unpack(unpacker);
|
||||
dst = (Long) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -253,14 +253,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = BigIntegerTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(BigIntegerTemplate.getInstance());
|
||||
dst = (BigInteger) tmpl.unpack(unpacker);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -303,14 +303,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = FloatTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Float) tmpl.unpack(unpacker);
|
||||
dst = (Float) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(FloatTemplate.getInstance());
|
||||
dst = (Float) tmpl.unpack(unpacker);
|
||||
dst = (Float) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -352,14 +352,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = DoubleTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Double) tmpl.unpack(unpacker);
|
||||
dst = (Double) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(DoubleTemplate.getInstance());
|
||||
dst = (Double) tmpl.unpack(unpacker);
|
||||
dst = (Double) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -391,14 +391,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = BooleanTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Boolean) tmpl.unpack(unpacker);
|
||||
dst = (Boolean) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(BooleanTemplate.getInstance());
|
||||
dst = (Boolean) tmpl.unpack(unpacker);
|
||||
dst = (Boolean) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -462,14 +462,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = StringTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (String) tmpl.unpack(unpacker);
|
||||
dst = (String) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(StringTemplate.getInstance());
|
||||
dst = (String) tmpl.unpack(unpacker);
|
||||
dst = (String) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = IntegerTemplate.getInstance();
|
||||
Integer dst = (Integer) tmpl.convert(obj);
|
||||
Integer dst = (Integer) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -50,14 +50,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = IntegerTemplate.getInstance();
|
||||
Integer dst = null;
|
||||
try {
|
||||
dst = (Integer) tmpl.convert(obj);
|
||||
dst = (Integer) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(IntegerTemplate.getInstance());
|
||||
dst = (Integer) tmpl.convert(obj);
|
||||
dst = (Integer) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = LongTemplate.getInstance();
|
||||
Long dst = (Long) tmpl.convert(obj);
|
||||
Long dst = (Long) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -94,14 +94,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = LongTemplate.getInstance();
|
||||
Long dst = null;
|
||||
try {
|
||||
dst = (Long) tmpl.convert(obj);
|
||||
dst = (Long) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(LongTemplate.getInstance());
|
||||
dst = (Long) tmpl.convert(obj);
|
||||
dst = (Long) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = BigIntegerTemplate.getInstance();
|
||||
BigInteger dst = (BigInteger) tmpl.convert(obj);
|
||||
BigInteger dst = (BigInteger) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -141,14 +141,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = BigIntegerTemplate.getInstance();
|
||||
BigInteger dst = null;
|
||||
try {
|
||||
dst = (BigInteger) tmpl.convert(obj);
|
||||
dst = (BigInteger) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(BigIntegerTemplate.getInstance());
|
||||
dst = (BigInteger) tmpl.convert(obj);
|
||||
dst = (BigInteger) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = FloatTemplate.getInstance();
|
||||
Float dst = (Float) tmpl.convert(obj);
|
||||
Float dst = (Float) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst, 10e-10);
|
||||
}
|
||||
|
||||
|
|
@ -187,14 +187,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = FloatTemplate.getInstance();
|
||||
Float dst = null;
|
||||
try {
|
||||
dst = (Float) tmpl.convert(obj);
|
||||
dst = (Float) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(FloatTemplate.getInstance());
|
||||
dst = (Float) tmpl.convert(obj);
|
||||
dst = (Float) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = DoubleTemplate.getInstance();
|
||||
Double dst = (Double) tmpl.convert(obj);
|
||||
Double dst = (Double) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst, 10e-10);
|
||||
}
|
||||
|
||||
|
|
@ -233,14 +233,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = DoubleTemplate.getInstance();
|
||||
Double dst = null;
|
||||
try {
|
||||
dst = (Double) tmpl.convert(obj);
|
||||
dst = (Double) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(DoubleTemplate.getInstance());
|
||||
dst = (Double) tmpl.convert(obj);
|
||||
dst = (Double) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = BooleanTemplate.getInstance();
|
||||
Boolean dst = (Boolean) tmpl.convert(obj);
|
||||
Boolean dst = (Boolean) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -268,14 +268,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = BooleanTemplate.getInstance();
|
||||
Boolean dst = null;
|
||||
try {
|
||||
dst = (Boolean) tmpl.convert(obj);
|
||||
dst = (Boolean) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(BooleanTemplate.getInstance());
|
||||
dst = (Boolean) tmpl.convert(obj);
|
||||
dst = (Boolean) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = StringTemplate.getInstance();
|
||||
String dst = (String) tmpl.convert(obj);
|
||||
String dst = (String) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -335,14 +335,14 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = StringTemplate.getInstance();
|
||||
String dst = null;
|
||||
try {
|
||||
dst = (String) tmpl.convert(obj);
|
||||
dst = (String) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(StringTemplate.getInstance());
|
||||
dst = (String) tmpl.convert(obj);
|
||||
dst = (String) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -355,7 +355,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(emptyList);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = new ListTemplate(IntegerTemplate.getInstance());
|
||||
List<Integer> dst = (List<Integer>) tmpl.convert(obj);
|
||||
List<Integer> dst = (List<Integer>) tmpl.convert(obj, null);
|
||||
assertEquals(emptyList, dst);
|
||||
}
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(l);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = new ListTemplate(IntegerTemplate.getInstance());
|
||||
List<Integer> dst = (List<Integer>) tmpl.convert(obj);
|
||||
List<Integer> dst = (List<Integer>) tmpl.convert(obj, null);
|
||||
assertEquals(l.size(), dst.size());
|
||||
for (int j = 0; j < len; j++) {
|
||||
assertEquals(l.get(j), dst.get(j));
|
||||
|
|
@ -386,7 +386,7 @@ public class TestPackConvert extends TestCase {
|
|||
new Packer(out).pack(l);
|
||||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = new ListTemplate(StringTemplate.getInstance());
|
||||
List<String> dst = (List<String>) tmpl.convert(obj);
|
||||
List<String> dst = (List<String>) tmpl.convert(obj, null);
|
||||
assertEquals(l.size(), dst.size());
|
||||
for (int j = 0; j < len; j++) {
|
||||
assertEquals(l.get(j), dst.get(j));
|
||||
|
|
@ -404,7 +404,7 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = new ListTemplate(StringTemplate.getInstance());
|
||||
List<String> dst = null;
|
||||
try {
|
||||
dst = (List<String>) tmpl.convert(obj);
|
||||
dst = (List<String>) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
|
|
@ -412,7 +412,7 @@ public class TestPackConvert extends TestCase {
|
|||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(new ListTemplate(StringTemplate
|
||||
.getInstance()));
|
||||
dst = (List<String>) tmpl.convert(obj);
|
||||
dst = (List<String>) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -427,7 +427,7 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = new MapTemplate(IntegerTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<Integer, Integer> dst = (Map<Integer, Integer>) tmpl
|
||||
.convert(obj);
|
||||
.convert(obj, null);
|
||||
assertEquals(emptyMap, dst);
|
||||
}
|
||||
|
||||
|
|
@ -443,7 +443,7 @@ public class TestPackConvert extends TestCase {
|
|||
Template tmpl = new MapTemplate(IntegerTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<Integer, Integer> map = (Map<Integer, Integer>) tmpl
|
||||
.convert(obj);
|
||||
.convert(obj, null);
|
||||
assertEquals(m.size(), map.size());
|
||||
for (Map.Entry<Integer, Integer> pair : map.entrySet()) {
|
||||
Integer val = m.get(pair.getKey());
|
||||
|
|
@ -462,7 +462,7 @@ public class TestPackConvert extends TestCase {
|
|||
MessagePackObject obj = Util.unpackOne(out.toByteArray());
|
||||
Template tmpl = new MapTemplate(StringTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<String, Integer> map = (Map<String, Integer>) tmpl.convert(obj);
|
||||
Map<String, Integer> map = (Map<String, Integer>) tmpl.convert(obj, null);
|
||||
assertEquals(m.size(), map.size());
|
||||
for (Map.Entry<String, Integer> pair : map.entrySet()) {
|
||||
Integer val = m.get(pair.getKey());
|
||||
|
|
@ -483,7 +483,7 @@ public class TestPackConvert extends TestCase {
|
|||
StringTemplate.getInstance());
|
||||
Map<String, String> dst = null;
|
||||
try {
|
||||
dst = (Map<String, String>) tmpl.convert(obj);
|
||||
dst = (Map<String, String>) tmpl.convert(obj, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
|
|
@ -491,7 +491,7 @@ public class TestPackConvert extends TestCase {
|
|||
obj = Util.unpackOne(out.toByteArray());
|
||||
tmpl = new NullableTemplate(new MapTemplate(StringTemplate
|
||||
.getInstance(), StringTemplate.getInstance()));
|
||||
dst = (Map<String, String>) tmpl.convert(obj);
|
||||
dst = (Map<String, String>) tmpl.convert(obj, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = IntegerTemplate.getInstance();
|
||||
Integer dst = (Integer) tmpl.unpack(new Unpacker(in));
|
||||
Integer dst = (Integer) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -52,14 +52,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = IntegerTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Integer) tmpl.unpack(unpacker);
|
||||
dst = (Integer) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(IntegerTemplate.getInstance());
|
||||
dst = (Integer) tmpl.unpack(unpacker);
|
||||
dst = (Integer) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = LongTemplate.getInstance();
|
||||
Long dst = (Long) tmpl.unpack(new Unpacker(in));
|
||||
Long dst = (Long) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -99,14 +99,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = LongTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Long) tmpl.unpack(unpacker);
|
||||
dst = (Long) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(LongTemplate.getInstance());
|
||||
dst = (Long) tmpl.unpack(unpacker);
|
||||
dst = (Long) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack((Object) src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = BigIntegerTemplate.getInstance();
|
||||
BigInteger dst = (BigInteger) tmpl.unpack(new Unpacker(in));
|
||||
BigInteger dst = (BigInteger) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -149,14 +149,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = BigIntegerTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(BigIntegerTemplate.getInstance());
|
||||
dst = (BigInteger) tmpl.unpack(unpacker);
|
||||
dst = (BigInteger) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = FloatTemplate.getInstance();
|
||||
Float dst = (Float) tmpl.unpack(new Unpacker(in));
|
||||
Float dst = (Float) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst, 10e-10);
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DoubleTemplate.getInstance();
|
||||
Double dst = (Double) tmpl.unpack(new Unpacker(in));
|
||||
Double dst = (Double) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst, 10e-10);
|
||||
}
|
||||
|
||||
|
|
@ -224,14 +224,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = DoubleTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Double) tmpl.unpack(unpacker);
|
||||
dst = (Double) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(DoubleTemplate.getInstance());
|
||||
dst = (Double) tmpl.unpack(unpacker);
|
||||
dst = (Double) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = BooleanTemplate.getInstance();
|
||||
Boolean dst = (Boolean) tmpl.unpack(new Unpacker(in));
|
||||
Boolean dst = (Boolean) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -262,14 +262,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = BooleanTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Boolean) tmpl.unpack(unpacker);
|
||||
dst = (Boolean) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(BooleanTemplate.getInstance());
|
||||
dst = (Boolean) tmpl.unpack(unpacker);
|
||||
dst = (Boolean) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ public class TestPackUnpack extends TestCase {
|
|||
new Packer(out).pack(src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = StringTemplate.getInstance();
|
||||
String dst = (String) tmpl.unpack(new Unpacker(in));
|
||||
String dst = (String) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -332,14 +332,14 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = StringTemplate.getInstance();
|
||||
unpacker.wrap(bytes);
|
||||
dst = (String) tmpl.unpack(unpacker);
|
||||
dst = (String) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
}
|
||||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(StringTemplate.getInstance());
|
||||
dst = (String) tmpl.unpack(unpacker);
|
||||
dst = (String) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out
|
||||
.toByteArray());
|
||||
Template tmpl = new ListTemplate(IntegerTemplate.getInstance());
|
||||
List<Integer> dst = (List<Integer>) tmpl.unpack(new Unpacker(in));
|
||||
List<Integer> dst = (List<Integer>) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(emptyList, dst);
|
||||
}
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out
|
||||
.toByteArray());
|
||||
Template tmpl = new ListTemplate(IntegerTemplate.getInstance());
|
||||
List<Integer> dst = (List<Integer>) tmpl.unpack(new Unpacker(in));
|
||||
List<Integer> dst = (List<Integer>) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(len, dst.size());
|
||||
for (int j = 0; j < len; j++) {
|
||||
assertEquals(l.get(j), dst.get(j));
|
||||
|
|
@ -385,7 +385,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out
|
||||
.toByteArray());
|
||||
Template tmpl = new ListTemplate(StringTemplate.getInstance());
|
||||
List<String> dst = (List<String>) tmpl.unpack(new Unpacker(in));
|
||||
List<String> dst = (List<String>) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(len, dst.size());
|
||||
for (int j = 0; j < len; j++) {
|
||||
assertEquals(l.get(j), dst.get(j));
|
||||
|
|
@ -406,7 +406,7 @@ public class TestPackUnpack extends TestCase {
|
|||
try {
|
||||
tmpl = new ListTemplate(StringTemplate.getInstance());
|
||||
unpacker.wrap(bytes);
|
||||
dst = (List<String>) tmpl.unpack(unpacker);
|
||||
dst = (List<String>) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
|
|
@ -414,7 +414,7 @@ public class TestPackUnpack extends TestCase {
|
|||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(new ListTemplate(StringTemplate
|
||||
.getInstance()));
|
||||
dst = (List<String>) tmpl.unpack(unpacker);
|
||||
dst = (List<String>) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -430,7 +430,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new MapTemplate(IntegerTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<Integer, Integer> dst = (Map<Integer, Integer>) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(emptyMap, dst);
|
||||
}
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new MapTemplate(IntegerTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<Integer, Integer> map = (Map<Integer, Integer>) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(len, map.size());
|
||||
for (Map.Entry<Integer, Integer> pair : map.entrySet()) {
|
||||
Integer val = m.get(pair.getKey());
|
||||
|
|
@ -469,7 +469,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new MapTemplate(StringTemplate.getInstance(),
|
||||
IntegerTemplate.getInstance());
|
||||
Map<String, Integer> map = (Map<String, Integer>) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(m.size(), map.size());
|
||||
for (Map.Entry<String, Integer> pair : map.entrySet()) {
|
||||
Integer val = m.get(pair.getKey());
|
||||
|
|
@ -493,7 +493,7 @@ public class TestPackUnpack extends TestCase {
|
|||
tmpl = new MapTemplate(StringTemplate.getInstance(), StringTemplate
|
||||
.getInstance());
|
||||
unpacker.wrap(bytes);
|
||||
dst = (Map<String, String>) tmpl.unpack(unpacker);
|
||||
dst = (Map<String, String>) tmpl.unpack(unpacker, null);
|
||||
fail();
|
||||
} catch (Exception e) {
|
||||
assertTrue(e instanceof MessageTypeException);
|
||||
|
|
@ -501,7 +501,7 @@ public class TestPackUnpack extends TestCase {
|
|||
unpacker.wrap(bytes);
|
||||
tmpl = new NullableTemplate(new MapTemplate(StringTemplate
|
||||
.getInstance(), StringTemplate.getInstance()));
|
||||
dst = (Map<String, String>) tmpl.unpack(unpacker);
|
||||
dst = (Map<String, String>) tmpl.unpack(unpacker, null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -81,7 +81,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -147,7 +147,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -173,7 +173,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -255,7 +255,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalGeneralReferenceTypeFieldsClass dst = (OptionalGeneralReferenceTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -347,7 +347,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalGeneralReferenceTypeFieldsClass dst = (OptionalGeneralReferenceTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -378,7 +378,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalGeneralReferenceTypeFieldsClass dst = (OptionalGeneralReferenceTypeFieldsClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -443,7 +443,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -493,7 +493,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -553,7 +553,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalListTypes dst = (SampleOptionalListTypes) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -609,7 +609,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalListTypes dst = (SampleOptionalListTypes) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -634,7 +634,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalListTypes dst = (SampleOptionalListTypes) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -689,7 +689,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -726,7 +726,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -762,7 +762,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo);
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -801,7 +801,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo);
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -822,7 +822,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo);
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1072,7 +1072,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl.convert(mpo);
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1092,7 +1092,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl.convert(mpo);
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1127,7 +1127,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalEnumFieldClass dst = (SampleOptionalEnumFieldClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1149,7 +1149,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalEnumFieldClass dst = (SampleOptionalEnumFieldClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1170,7 +1170,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalEnumFieldClass dst = (SampleOptionalEnumFieldClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1206,7 +1206,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
FieldModifiersClass dst = (FieldModifiersClass) tmpl.convert(mpo);
|
||||
FieldModifiersClass dst = (FieldModifiersClass) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1245,7 +1245,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalFieldModifiersClass dst = (OptionalFieldModifiersClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1429,7 +1429,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
Template tmpl = DynamicTemplate.create(BaseClass2.class);
|
||||
BaseClass2 dst = (BaseClass2) tmpl.convert(mpo);
|
||||
BaseClass2 dst = (BaseClass2) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1449,7 +1449,7 @@ public class TestPackConvert extends TestCase {
|
|||
MessagePackObject mpo = it.next();
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(BaseClass2.class));
|
||||
BaseClass2 dst = (BaseClass2) tmpl.convert(mpo);
|
||||
BaseClass2 dst = (BaseClass2) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1486,7 +1486,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
Template tmpl = DynamicTemplate.create(OptionalBaseClass2.class);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1504,7 +1504,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
Template tmpl = DynamicTemplate.create(OptionalBaseClass2.class);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertFalse(it.hasNext());
|
||||
|
|
@ -1524,7 +1524,7 @@ public class TestPackConvert extends TestCase {
|
|||
MessagePackObject mpo = it.next();
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(OptionalBaseClass2.class));
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1567,7 +1567,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.convert(mpo);
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1594,7 +1594,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.convert(mpo);
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1642,7 +1642,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl.convert(mpo);
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl.convert(mpo, null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1669,7 +1669,7 @@ public class TestPackConvert extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl.convert(mpo);
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1722,7 +1722,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
BaseMessagePackableConvertableClass dst = (BaseMessagePackableConvertableClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0.f0, dst.f0.f0);
|
||||
assertEquals(src.f0.f1, dst.f0.f1);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
|
|
@ -1747,7 +1747,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
BaseMessagePackableConvertableClass dst = (BaseMessagePackableConvertableClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -1811,7 +1811,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalBaseMessagePackableConvertableClass dst = (OptionalBaseMessagePackableConvertableClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0.f0, dst.f0.f0);
|
||||
assertEquals(src.f0.f1, dst.f0.f1);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
|
|
@ -1839,7 +1839,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalBaseMessagePackableConvertableClass dst = (OptionalBaseMessagePackableConvertableClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -1861,7 +1861,7 @@ public class TestPackConvert extends TestCase {
|
|||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
OptionalBaseMessagePackableConvertableClass dst = (OptionalBaseMessagePackableConvertableClass) tmpl
|
||||
.convert(mpo);
|
||||
.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -98,7 +98,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -131,7 +131,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -184,7 +184,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -234,7 +234,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -275,7 +275,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -387,7 +387,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -417,7 +417,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
@ -469,7 +469,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -513,7 +513,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -538,7 +538,7 @@ public class TestPackConvertWithFieldOption extends TestCase {
|
|||
Iterator<MessagePackObject> it = pac.iterator();
|
||||
assertTrue(it.hasNext());
|
||||
MessagePackObject mpo = it.next();
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.convert(mpo, null);
|
||||
assertEquals(src, dst);
|
||||
assertFalse(it.hasNext());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(PrimitiveTypeFieldsClass.class);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -67,7 +67,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(PrimitiveTypeFieldsClass.class);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -88,7 +88,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(PrimitiveTypeFieldsClass.class));
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(OptionalPrimitiveTypeFieldsClass.class);
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -144,7 +144,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(OptionalPrimitiveTypeFieldsClass.class);
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -165,7 +165,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(OptionalPrimitiveTypeFieldsClass.class));
|
||||
OptionalPrimitiveTypeFieldsClass dst = (OptionalPrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(GeneralReferenceTypeFieldsClass.class);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -237,7 +237,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(GeneralReferenceTypeFieldsClass.class));
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(GeneralOptionalReferenceTypeFieldsClass.class);
|
||||
GeneralOptionalReferenceTypeFieldsClass dst = (GeneralOptionalReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -319,7 +319,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(GeneralOptionalReferenceTypeFieldsClass.class);
|
||||
GeneralOptionalReferenceTypeFieldsClass dst = (GeneralOptionalReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -345,7 +345,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(GeneralOptionalReferenceTypeFieldsClass.class));
|
||||
GeneralOptionalReferenceTypeFieldsClass dst = (GeneralOptionalReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleListTypes.class);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -450,7 +450,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleListTypes.class));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleOptionalListTypes.class);
|
||||
SampleOptionalListTypes dst = (SampleOptionalListTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -556,7 +556,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleOptionalListTypes.class);
|
||||
SampleOptionalListTypes dst = (SampleOptionalListTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -575,7 +575,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleOptionalListTypes.class));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -625,7 +625,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleMapTypes.class);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -657,7 +657,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleMapTypes.class));
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -689,7 +689,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleOptionalMapTypes.class);
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -724,7 +724,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleOptionalMapTypes.class);
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -741,7 +741,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleOptionalMapTypes.class));
|
||||
SampleOptionalMapTypes dst = (SampleOptionalMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -980,7 +980,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleEnumFieldClass.class);
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
}
|
||||
|
|
@ -996,7 +996,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleEnumFieldClass.class));
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1027,7 +1027,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(SampleOptionalEnumFieldClass.class);
|
||||
SampleOptionalEnumFieldClass dst = (SampleOptionalEnumFieldClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
}
|
||||
|
|
@ -1044,7 +1044,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(SampleOptionalEnumFieldClass.class);
|
||||
SampleOptionalEnumFieldClass dst = (SampleOptionalEnumFieldClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
}
|
||||
|
|
@ -1060,7 +1060,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleEnumFieldClass.class));
|
||||
SampleEnumFieldClass dst = (SampleEnumFieldClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1093,7 +1093,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(FieldModifiersClass.class);
|
||||
FieldModifiersClass dst = (FieldModifiersClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1127,7 +1127,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(OptionalFieldModifiersClass.class);
|
||||
OptionalFieldModifiersClass dst = (OptionalFieldModifiersClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1162,7 +1162,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
tmpl.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
BaseClass dst = (BaseClass) tmpl.unpack(new Unpacker(in));
|
||||
BaseClass dst = (BaseClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
}
|
||||
|
|
@ -1176,7 +1176,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
tmpl.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
BaseClass dst = (BaseClass) tmpl.unpack(new Unpacker(in));
|
||||
BaseClass dst = (BaseClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1208,7 +1208,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
tmpl.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
OptionalBaseClass dst = (OptionalBaseClass) tmpl.unpack(new Unpacker(in));
|
||||
OptionalBaseClass dst = (OptionalBaseClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
}
|
||||
|
|
@ -1224,7 +1224,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
tmpl.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
OptionalBaseClass dst = (OptionalBaseClass) tmpl.unpack(new Unpacker(in));
|
||||
OptionalBaseClass dst = (OptionalBaseClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
}
|
||||
|
|
@ -1240,7 +1240,7 @@ public class TestPackUnpack extends TestCase {
|
|||
tmpl.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
OptionalBaseClass dst = (OptionalBaseClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1274,7 +1274,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(BaseClass2.class);
|
||||
BaseClass2 dst = (BaseClass2) tmpl.unpack(new Unpacker(in));
|
||||
BaseClass2 dst = (BaseClass2) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
}
|
||||
|
|
@ -1289,7 +1289,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(BaseClass2.class));
|
||||
BaseClass2 dst = (BaseClass2) tmpl.unpack(new Unpacker(in));
|
||||
BaseClass2 dst = (BaseClass2) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1321,8 +1321,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(OptionalBaseClass2.class);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(
|
||||
in));
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1.f2 == dst.f1.f2);
|
||||
}
|
||||
|
|
@ -1336,8 +1335,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(OptionalBaseClass2.class);
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(
|
||||
in));
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
}
|
||||
|
|
@ -1352,8 +1350,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(OptionalBaseClass2.class));
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(
|
||||
in));
|
||||
OptionalBaseClass2 dst = (OptionalBaseClass2) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1391,7 +1388,7 @@ public class TestPackUnpack extends TestCase {
|
|||
packer.pack(new Packer(out), src);
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleSubClass.class);
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.unpack(new Unpacker(in));
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1413,7 +1410,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleSubClass.class));
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.unpack(new Unpacker(in));
|
||||
SampleSubClass dst = (SampleSubClass) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1457,7 +1454,7 @@ public class TestPackUnpack extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleOptionalSubClass.class);
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertTrue(src.f0 == dst.f0);
|
||||
assertTrue(src.f1 == dst.f1);
|
||||
assertTrue(src.f2 != dst.f2);
|
||||
|
|
@ -1480,7 +1477,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleOptionalSubClass.class));
|
||||
SampleOptionalSubClass dst = (SampleOptionalSubClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1528,7 +1525,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(BaseMessagePackableUnpackableClass.class);
|
||||
BaseMessagePackableUnpackableClass dst = (BaseMessagePackableUnpackableClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.f0, dst.f0.f0);
|
||||
assertEquals(src.f0.f1, dst.f0.f1);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
|
|
@ -1548,7 +1545,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(BaseMessagePackableUnpackableClass.class));
|
||||
BaseMessagePackableUnpackableClass dst = (BaseMessagePackableUnpackableClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -1607,7 +1604,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(OptionalBaseMessagePackableUnpackableClass.class);
|
||||
OptionalBaseMessagePackableUnpackableClass dst = (OptionalBaseMessagePackableUnpackableClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.f0, dst.f0.f0);
|
||||
assertEquals(src.f0.f1, dst.f0.f1);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
|
|
@ -1630,7 +1627,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(OptionalBaseMessagePackableUnpackableClass.class);
|
||||
OptionalBaseMessagePackableUnpackableClass dst = (OptionalBaseMessagePackableUnpackableClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -1647,7 +1644,7 @@ public class TestPackUnpack extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(OptionalBaseMessagePackableUnpackableClass.class));
|
||||
OptionalBaseMessagePackableUnpackableClass dst = (OptionalBaseMessagePackableUnpackableClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = DynamicTemplate.create(PrimitiveTypeFieldsClass.class,
|
||||
opts);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -92,7 +92,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = DynamicTemplate.create(PrimitiveTypeFieldsClass.class,
|
||||
opts);
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -122,7 +122,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate.create(
|
||||
PrimitiveTypeFieldsClass.class, opts));
|
||||
PrimitiveTypeFieldsClass dst = (PrimitiveTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(GeneralReferenceTypeFieldsClass.class, opts);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -219,7 +219,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = DynamicTemplate
|
||||
.create(GeneralReferenceTypeFieldsClass.class, opts);
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0, dst.f0);
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2, dst.f2);
|
||||
|
|
@ -256,7 +256,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(GeneralReferenceTypeFieldsClass.class, opts));
|
||||
GeneralReferenceTypeFieldsClass dst = (GeneralReferenceTypeFieldsClass) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleListTypes.class, opts);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
for (int i = 0; i < src.f1.size(); ++i) {
|
||||
|
|
@ -360,7 +360,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleListTypes.class, opts);
|
||||
SampleListTypes dst = (SampleListTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -385,7 +385,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleListTypes.class));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in));
|
||||
SampleListTypes dst = (SampleListTypes) tmpl.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleMapTypes.class, opts);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1.size(), dst.f1.size());
|
||||
Iterator<Integer> srcf1 = src.f1.keySet().iterator();
|
||||
|
|
@ -473,7 +473,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||
Template tmpl = DynamicTemplate.create(SampleMapTypes.class, opts);
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src.f0.size(), dst.f0.size());
|
||||
assertEquals(src.f1, dst.f1);
|
||||
assertEquals(src.f2.size(), dst.f2.size());
|
||||
|
|
@ -495,7 +495,7 @@ public class TestPackUnpackWithFieldOption extends TestCase {
|
|||
Template tmpl = new NullableTemplate(DynamicTemplate
|
||||
.create(SampleMapTypes.class, opts));
|
||||
SampleMapTypes dst = (SampleMapTypes) tmpl
|
||||
.unpack(new Unpacker(in));
|
||||
.unpack(new Unpacker(in), null);
|
||||
assertEquals(src, dst);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue