fhueske commented on a change in pull request #6710: [FLINK-10134] UTF-16 
support for TextInputFormat bug fixed
URL: https://github.com/apache/flink/pull/6710#discussion_r221933563
 
 

 ##########
 File path: 
flink-java/src/test/java/org/apache/flink/api/java/io/TextInputFormatTest.java
 ##########
 @@ -207,8 +206,110 @@ private void testRemovingTrailingCR(String lineBreaker, 
String delimiter) {
                                assertEquals(content, result);
                        }
 
+               } catch (Throwable t) {
+                       System.err.println("test failed with exception: " + 
t.getMessage());
+                       t.printStackTrace(System.err);
+                       fail("Test erroneous");
+               }
+       }
+
+       @Test
+       public void testUTF16Read() {
+               final String first = "First line";
+               final String second = "Second line";
+
+               try {
+                       // create input file
+                       File tempFile = 
File.createTempFile("TextInputFormatTest", "tmp");
+                       tempFile.deleteOnExit();
+                       tempFile.setWritable(true);
+
+                       PrintStream ps = new PrintStream(tempFile, "UTF-16");
+                       ps.println(first);
+                       ps.println(second);
+                       ps.close();
+
+                       TextInputFormat inputFormat = new TextInputFormat(new 
Path(tempFile.toURI().toString()));
+                       inputFormat.setCharsetName("UTF-32");
+
+                       Configuration parameters = new Configuration();
+                       inputFormat.configure(parameters);
+
+//                     inputFormat.setDelimiter("\r");
 
 Review comment:
   please add tests to check if the `'\'` case is correctly handled for the 
different encodings.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to