@Override public void testFoo() throws Exception { RuntimeSchema<Foo> schema = getSchema(Foo.class); Foo foo = SerializableObjects.foo; roundTrip(foo, schema, schema.getPipeSchema()); }
@Override public void testBar() throws Exception { RuntimeSchema<Bar> schema = getSchema(Bar.class); Bar bar = SerializableObjects.bar; roundTrip(bar, schema, schema.getPipeSchema()); }
@Override public void testBaz() throws Exception { RuntimeSchema<Baz> schema = getSchema(Baz.class); Baz baz = SerializableObjects.baz; roundTrip(baz, schema, schema.getPipeSchema()); }
public void testTask() throws Exception { RuntimeSchema<Task> schema = getSchema(Task.class); Task task = CollectionTest.filledTask(); roundTrip(task, schema, schema.getPipeSchema()); }
public void testPojoWithArrayAndSet() throws Exception { RuntimeSchema<PojoWithArrayAndSet> schema = getSchema(PojoWithArrayAndSet.class); PojoWithArrayAndSet p = SerDeserTest.filledPojoWithArrayAndSet(); roundTrip(p, schema, schema.getPipeSchema()); }
public void testPipe() throws Exception { Schema<Zoo> schema = RuntimeSchema.getSchema(Zoo.class); Pipe.Schema<Zoo> pipeSchema = ((RuntimeSchema<Zoo>) schema).getPipeSchema(); Zoo p = filledZoo(); ProtostuffPipeTest.roundTrip(p, schema, pipeSchema); }
public void testEmployee() throws Exception { RuntimeSchema<Employee> schema = getSchema(Employee.class); Employee emp = CollectionTest.filledEmployee(); roundTrip(emp, schema, schema.getPipeSchema()); }
public void testPayment() throws Exception { RuntimeSchema<Payment> schema = getSchema(Payment.class); Payment payment = MathObjectsTest.filledPayment(); roundTrip(payment, schema, schema.getPipeSchema()); }
public void testPolymorphic() throws Exception { Schema<Zoo> schema = RuntimeSchema.getSchema(Zoo.class); Pipe.Schema<Zoo> pipeSchema = ((RuntimeSchema<Zoo>) schema).getPipeSchema(); Zoo zoo = PolymorphicSerializationTest.filledZoo(); // numeric only protobufRoundTrip(zoo, schema, pipeSchema, true); protostuffRoundTrip(zoo, schema, pipeSchema, true); }
public void testBaz() throws Exception { Schema<Baz> schema = RuntimeSchema.getSchema(Baz.class); Pipe.Schema<Baz> pipeSchema = ((RuntimeSchema<Baz>) schema).getPipeSchema(); Baz baz = SerializableObjects.baz; protobufRoundTrip(baz, schema, pipeSchema, false); protostuffRoundTrip(baz, schema, pipeSchema, false); // numeric protobufRoundTrip(baz, schema, pipeSchema, true); protostuffRoundTrip(baz, schema, pipeSchema, true); }
public void testFoo() throws Exception { Schema<Foo> schema = RuntimeSchema.getSchema(Foo.class); Pipe.Schema<Foo> pipeSchema = ((RuntimeSchema<Foo>) schema).getPipeSchema(); Foo foo = SerializableObjects.foo; protobufRoundTrip(foo, schema, pipeSchema, false); protostuffRoundTrip(foo, schema, pipeSchema, false); // numeric protobufRoundTrip(foo, schema, pipeSchema, true); protostuffRoundTrip(foo, schema, pipeSchema, true); }
public void testBar() throws Exception { Schema<Bar> schema = RuntimeSchema.getSchema(Bar.class); Pipe.Schema<Bar> pipeSchema = ((RuntimeSchema<Bar>) schema).getPipeSchema(); Bar bar = SerializableObjects.bar; protobufRoundTrip(bar, schema, pipeSchema, false); protostuffRoundTrip(bar, schema, pipeSchema, false); // numeric protobufRoundTrip(bar, schema, pipeSchema, true); protostuffRoundTrip(bar, schema, pipeSchema, true); }
public void testInlineKInlineV() throws Exception { Schema<HasMapInlineKInlineV> schema = RuntimeSchema .getSchema(HasMapInlineKInlineV.class); Pipe.Schema<HasMapInlineKInlineV> pipeSchema = ((RuntimeSchema<HasMapInlineKInlineV>) schema).getPipeSchema(); HasMapInlineKInlineV p = new HasMapInlineKInlineV().fill(); byte[] data = toByteArray(p, schema); HasMapInlineKInlineV pFromByteArray = new HasMapInlineKInlineV(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); HasMapInlineKInlineV pFromStream = new HasMapInlineKInlineV(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromByteArray); roundTrip(p, schema, pipeSchema); }
public void testInlineKPojoV() throws Exception { Schema<HasMapInlineKPojoV> schema = RuntimeSchema .getSchema(HasMapInlineKPojoV.class); Pipe.Schema<HasMapInlineKPojoV> pipeSchema = ((RuntimeSchema<HasMapInlineKPojoV>) schema).getPipeSchema(); HasMapInlineKPojoV p = new HasMapInlineKPojoV().fill(); byte[] data = toByteArray(p, schema); HasMapInlineKPojoV pFromByteArray = new HasMapInlineKPojoV(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); HasMapInlineKPojoV pFromStream = new HasMapInlineKPojoV(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromByteArray); roundTrip(p, schema, pipeSchema); }
public void testPojoKEnumV() throws Exception { Schema<HasMapPojoKEnumV> schema = RuntimeSchema .getSchema(HasMapPojoKEnumV.class); Pipe.Schema<HasMapPojoKEnumV> pipeSchema = ((RuntimeSchema<HasMapPojoKEnumV>) schema).getPipeSchema(); HasMapPojoKEnumV p = new HasMapPojoKEnumV().fill(); byte[] data = toByteArray(p, schema); HasMapPojoKEnumV pFromByteArray = new HasMapPojoKEnumV(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); HasMapPojoKEnumV pFromStream = new HasMapPojoKEnumV(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromByteArray); roundTrip(p, schema, pipeSchema); }
public void testPojoWithArray2D() throws Exception { Schema<PojoWithArray2D> schema = RuntimeSchema .getSchema(PojoWithArray2D.class); Pipe.Schema<PojoWithArray2D> pipeSchema = ((RuntimeSchema<PojoWithArray2D>) schema).getPipeSchema(); PojoWithArray2D p = new PojoWithArray2D().fill(); byte[] data = toByteArray(p, schema); PojoWithArray2D pFromByteArray = new PojoWithArray2D(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); PojoWithArray2D pFromStream = new PojoWithArray2D(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromStream); roundTrip(p, schema, pipeSchema); }
public void testPojo() throws Exception { Schema<Pojo> schema = RuntimeSchema.getSchema(Pojo.class); Pipe.Schema<Pojo> pipeSchema = ((RuntimeSchema<Pojo>) schema).getPipeSchema(); Pojo p = new Pojo().fill(); byte[] data = toByteArray(p, schema); Pojo pFromByteArray = new Pojo(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); Pojo pFromStream = new Pojo(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromStream); roundTrip(p, schema, pipeSchema); }
public void testEnumKPojoV() throws Exception { Schema<HasMapEnumKPojoV> schema = RuntimeSchema .getSchema(HasMapEnumKPojoV.class); Pipe.Schema<HasMapEnumKPojoV> pipeSchema = ((RuntimeSchema<HasMapEnumKPojoV>) schema).getPipeSchema(); HasMapEnumKPojoV p = new HasMapEnumKPojoV().fill(); byte[] data = toByteArray(p, schema); HasMapEnumKPojoV pFromByteArray = new HasMapEnumKPojoV(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); HasMapEnumKPojoV pFromStream = new HasMapEnumKPojoV(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromByteArray); roundTrip(p, schema, pipeSchema); }
public void testPojoWithArray() throws Exception { Schema<PojoWithArray> schema = RuntimeSchema .getSchema(PojoWithArray.class); Pipe.Schema<PojoWithArray> pipeSchema = ((RuntimeSchema<PojoWithArray>) schema).getPipeSchema(); PojoWithArray p = new PojoWithArray().fill(); byte[] data = toByteArray(p, schema); PojoWithArray pFromByteArray = new PojoWithArray(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); PojoWithArray pFromStream = new PojoWithArray(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromStream); roundTrip(p, schema, pipeSchema); }
public void testPojoWithClassFields() throws Exception { Schema<PojoWithClassFields> schema = RuntimeSchema .getSchema(PojoWithClassFields.class); Pipe.Schema<PojoWithClassFields> pipeSchema = ((RuntimeSchema<PojoWithClassFields>) schema).getPipeSchema(); PojoWithClassFields p = new PojoWithClassFields().fill(); byte[] data = toByteArray(p, schema); PojoWithClassFields pFromByteArray = new PojoWithClassFields(); mergeFrom(data, 0, data.length, pFromByteArray, schema); assertEquals(p, pFromByteArray); PojoWithClassFields pFromStream = new PojoWithClassFields(); ByteArrayInputStream in = new ByteArrayInputStream(data); mergeFrom(in, pFromStream, schema); assertEquals(p, pFromStream); roundTrip(p, schema, pipeSchema); }