@Test public void testJavaEncoder() { Encoder<JavaSerializable> encoder = Encoders.javaSerialization(JavaSerializable.class); List<JavaSerializable> data = Arrays.asList(new JavaSerializable("hello"), new JavaSerializable("world")); Dataset<JavaSerializable> ds = context.createDataset(data, encoder); Assert.assertEquals(data, ds.collectAsList()); }
@Test(expected = UnsupportedOperationException.class) public void testJavaEncoderErrorMessageForPrivateClass() { Encoders.javaSerialization(PrivateClassTest.class); }