ois.close();
}
}
public static void main(String[] args) throws Exception {
TSerializer binarySerializer = new TSerializer(new TBinaryProtocol.Factory());
TDeserializer binaryDeserializer = new TDeserializer(new TBinaryProtocol.Factory());
OneOfEach ooe = Fixtures.oneOfEach;
Nesting n = new Nesting();
n.my_ooe = (OneOfEach)deepCopy(ooe);
n.my_ooe.integer16 = 16;
n.my_ooe.integer32 = 32;
n.my_ooe.integer64 = 64;
n.my_ooe.double_precision = (Math.sqrt(5)+1)/2;
n.my_ooe.some_characters = ":R (me going \"rrrr\")";
n.my_ooe.zomg_unicode = "\u04c0\u216e\u039d\u0020\u041d\u03bf\u217f"+
"\u043e\u0261\u0433\u0430\u03c1\u210e\u0020"+
"\u0391\u0074\u0074\u03b1\u217d\u03ba\u01c3"+
"\u203c";
n.my_bonk = Fixtures.nesting.my_bonk;
HolyMoley hm = Fixtures.holyMoley;
OneOfEach ooe2 = new OneOfEach();
binaryDeserializer.deserialize(
ooe2,
binarySerializer.serialize(ooe));
if (!ooe.equals(ooe2)) {
throw new RuntimeException("Failure: ooe (equals)");
}
if (ooe.hashCode() != ooe2.hashCode()) {
throw new RuntimeException("Failure: ooe (hash)");
}
Nesting n2 = new Nesting();
binaryDeserializer.deserialize(
n2,
binarySerializer.serialize(n));
if (!n.equals(n2)) {
throw new RuntimeException("Failure: n (equals)");
}
if (n.hashCode() != n2.hashCode()) {
throw new RuntimeException("Failure: n (hash)");
}
HolyMoley hm2 = new HolyMoley();
binaryDeserializer.deserialize(
hm2,
binarySerializer.serialize(hm));
if (!hm.equals(hm2)) {
throw new RuntimeException("Failure: hm (equals)");
}
if (hm.hashCode() != hm2.hashCode()) {