use of com.linkedin.pegasus.generator.test.idl.arrays.WithPrimitivesArray in project rest.li by linkedin.
the class ArrayGeneratorTest method testWithPrimitivesArray.
@Test
public void testWithPrimitivesArray() throws Throwable {
String json = load("WithPrimitivesArray.json");
WithPrimitivesArray original = new WithPrimitivesArray();
IntegerArray ints = new IntegerArray();
ints.add(1);
ints.add(2);
ints.add(3);
original.setInts(ints);
LongArray longs = new LongArray();
longs.add(10L);
longs.add(20L);
longs.add(30L);
original.setLongs(longs);
FloatArray floats = new FloatArray();
floats.add(1.1f);
floats.add(2.2f);
floats.add(3.3f);
original.setFloats(floats);
DoubleArray doubles = new DoubleArray();
doubles.add(11.1d);
doubles.add(22.2d);
doubles.add(33.3d);
original.setDoubles(doubles);
BooleanArray booleans = new BooleanArray();
booleans.add(false);
booleans.add(true);
original.setBooleans(booleans);
StringArray strings = new StringArray();
strings.add("a");
strings.add("b");
strings.add("c");
original.setStrings(strings);
BytesArray bytes = new BytesArray();
bytes.add(SchemaFixtures.bytes1);
bytes.add(SchemaFixtures.bytes2);
original.setBytes(bytes);
assertJson(original, json);
WithPrimitivesArray roundTripped = new WithPrimitivesArray(roundTrip(original.data()));
assertJson(roundTripped, json);
}
Aggregations