Beispiel #1
0
 @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());
 }
Beispiel #2
0
 @Test(expected = UnsupportedOperationException.class)
 public void testJavaEncoderErrorMessageForPrivateClass() {
   Encoders.javaSerialization(PrivateClassTest.class);
 }