@Test
public void readStringFields() {

	try {
		final String fileContent = "abc|def|ghijk\nabc||hhg\n|||";
		final FileInputSplit split = createTempFile(fileContent);
		
		final CsvInputFormat<Tuple3<String, String, String>> format = new CsvInputFormat<Tuple3<String, String, String>>(PATH, "\n", '|', String.class, String.class, String.class);
	
		final Configuration parameters = new Configuration();
		format.configure(parameters);
		format.open(split);
		
		Tuple3<String, String, String> result = new Tuple3<String, String, String>();
		
		result = format.nextRecord(result);
		assertNotNull(result);
		assertEquals("abc", result.f0);
		assertEquals("def", result.f1);
		assertEquals("ghijk", result.f2);
		
		result = format.nextRecord(result);
		assertNotNull(result);
		assertEquals("abc", result.f0);
		assertEquals("", result.f1);
		assertEquals("hhg", result.f2);
		
		result = format.nextRecord(result);
		assertNotNull(result);
		assertEquals("", result.f0);
		assertEquals("", result.f1);
		assertEquals("", result.f2);
		
		result = format.nextRecord(result);
		assertNull(result);
		assertTrue(format.reachedEnd());
	}
	catch (Exception ex) {
		ex.printStackTrace();
		fail("Test failed due to a " + ex.getClass().getName() + ": " + ex.getMessage());
	}
}