@Test public void testString() { runTests("abc", "", StringUtils.getRandomString(new Random(289347567856686223L), 10, 100), StringUtils.getRandomString(new Random(289347567856686223L), 1000, 5000), StringUtils.getRandomString(new Random(289347567856686223L), 30000, 35000), StringUtils.getRandomString(new Random(289347567856686223L), 100 * 1024, 105 * 1024)); }
@Test public void testSimpleTypesObjects() { SimpleTypes a = new SimpleTypes(); SimpleTypes b = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); SimpleTypes c = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); SimpleTypes d = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); SimpleTypes e = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); SimpleTypes f = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); SimpleTypes g = new SimpleTypes(rnd.nextInt(), rnd.nextLong(), (byte) rnd.nextInt(), StringUtils.getRandomString(rnd, 10, 100), (short) rnd.nextInt(), rnd.nextDouble()); runTests(a, b, c, d, e, f, g); }
@Test public void testBeanStyleObjects() { { Book b1 = new Book(976243875L, "The Serialization Odyssey", 42); Book b2 = new Book(0L, "Debugging byte streams", 1337); Book b3 = new Book(-1L, "Low level interfaces", 0xC0FFEE); runTests(b1, b2, b3); } // object with collection { ArrayList<String> list = new ArrayList<String>(); list.add("A"); list.add("B"); list.add("C"); list.add("D"); list.add("E"); BookAuthor b1 = new BookAuthor(976243875L, list, "Arno Nym"); ArrayList<String> list2 = new ArrayList<String>(); BookAuthor b2 = new BookAuthor(987654321L, list2, "The Saurus"); runTests(b1, b2); } }
@Test public void testNestedInterfaces() { { SimpleWithNestedInterfaces s1 = new SimpleWithNestedInterfaces("Hello", 1); SimpleWithNestedInterfaces s2 = new SimpleWithNestedInterfaces("Ciao", 2); SimpleWithNestedInterfaces s3 = new SimpleWithNestedInterfaces("Foo", 3); runTests(s1, s2, s3); } // object with collection { ArrayList<String> list = new ArrayList<String>(); list.add("A"); list.add("B"); list.add("C"); list.add("D"); list.add("E"); BookAuthor b1 = new BookAuthor(976243875L, list, "Arno Nym"); ArrayList<String> list2 = new ArrayList<String>(); BookAuthor b2 = new BookAuthor(987654321L, list2, "The Saurus"); runTests(b1, b2); } }
@Test public void testNestedObjects() { ComplexNestedObject2 o1 = new ComplexNestedObject2(rnd); ComplexNestedObject2 o2 = new ComplexNestedObject2(); ComplexNestedObject2 o3 = new ComplexNestedObject2(rnd); ComplexNestedObject2 o4 = new ComplexNestedObject2(rnd); runTests(o1, o2, o3, o4); }
@Test public void testCompositeObject() { ComplexNestedObject1 o1 = new ComplexNestedObject1(5626435); ComplexNestedObject1 o2 = new ComplexNestedObject1(76923); ComplexNestedObject1 o3 = new ComplexNestedObject1(-1100); ComplexNestedObject1 o4 = new ComplexNestedObject1(0); ComplexNestedObject1 o5 = new ComplexNestedObject1(44); runTests(o1, o2, o3, o4, o5); }