// 1.3:OneOfEach
OneOfEach Level3OneOfEach = Fixtures.oneOfEach;
TestUnion Level2TestUnion = new TestUnion(TestUnion._Fields.STRUCT_FIELD, Level3OneOfEach);
StructWithAUnion Level1SWU = new StructWithAUnion(Level2TestUnion);
Backwards bw = new Backwards(2, 1);
PrimitiveThenStruct pts = new PrimitiveThenStruct(12345, 67890, bw);
for (TProtocolFactory factory : PROTOCOLS) {
//Full deserialization test
testPartialDeserialize(factory, Level1SWU, new StructWithAUnion(), Level1SWU);
//Level 2 test
testPartialDeserialize(factory, Level1SWU, new TestUnion(), Level2TestUnion, StructWithAUnion._Fields.TEST_UNION);
//Level 3 on 3rd field test
testPartialDeserialize(factory, Level1SWU, new OneOfEach(), Level3OneOfEach, StructWithAUnion._Fields.TEST_UNION, TestUnion._Fields.STRUCT_FIELD);
//Test early termination when traversed path Field.id exceeds the one being searched for
testPartialDeserialize(factory, Level1SWU, new OneOfEach(), new OneOfEach(), StructWithAUnion._Fields.TEST_UNION, TestUnion._Fields.I32_FIELD);
//Test that readStructBegin isn't called on primitive
testPartialDeserialize(factory, pts, new Backwards(), bw, PrimitiveThenStruct._Fields.BW);
}
}