@Test
public void testParseValidQuotedStringsWithWhitespaces() {

	
	// check valid strings with out whitespaces and trailing delimiter
	byte[] recBytes = "  \"abcdefgh\"|     \"i\"\t\t\t|\t \t\"jklmno\"  |".getBytes();
	StringValue s = new StringValue();
	
	int startPos = 0;
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 13);
	assertTrue(s.getValue().equals("abcdefgh"));
	
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 25);
	assertTrue(s.getValue().equals("i"));
	
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 39);
	assertTrue(s.getValue().equals("jklmno"));
	
	// check valid strings with out whitespaces without trailing delimiter
	recBytes = "  \"abcdefgh\"|     \"i\"\t\t\t|\t \t\"jklmno\"  ".getBytes();
	s = new StringValue();
	
	startPos = 0;
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 13);
	assertTrue(s.getValue().equals("abcdefgh"));
	
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 25);
	assertTrue(s.getValue().equals("i"));
	
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 38);
	assertTrue(s.getValue().equals("jklmno"));
	
	// check single field not terminated
	recBytes = "  \t\"abcde\"\t\t  \t ".getBytes();
	startPos = 0;
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 16);
	assertTrue(s.getValue().equals("abcde"));
	
	// check single field terminated
	recBytes = "  \t\"abcde\"\t\t  \t |".getBytes();
	startPos = 0;
	startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
	assertTrue(startPos == 17);
	assertTrue(s.getValue().equals("abcde"));
}