@Test public void testDefaultOptions() throws Exception { init( "default.csv" ); setFields( new TextFileInputField( "Field 1", -1, -1 ), new TextFileInputField( "Field 2", -1, -1 ), new TextFileInputField( "Field 3", -1, -1 ) ); process(); check( new Object[][] { { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" } } ); }
@Test public void testColumnNameWithSpaces() throws Exception { init( "column_name_with_spaces.csv" ); setFields( new TextFileInputField( "Field 1", -1, -1 ), new TextFileInputField( "Field 2", -1, -1 ), new TextFileInputField( "Field 3", -1, -1 ) ); process(); check( new Object[][] { { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" } } ); }
@Test public void testMultiCharDelimOptions() throws Exception { meta.setDelimiter( "|||" ); init( "multi_delim.csv" ); setFields( new TextFileInputField( "Field 1", -1, -1 ), new TextFileInputField( "Field 2", -1, -1 ), new TextFileInputField( "Field 3", -1, -1 ) ); process(); check( new Object[][] { { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" }, { "\u043d\u0435-\u043b\u0430\u0446\u0456\u043d\u043a\u0430(non-latin)", "4", "4" } } ); }
@Test public void testSemicolonOptions() throws Exception { meta.setDelimiter( ";" ); init( "semicolon.csv" ); setFields( new TextFileInputField( "Field 1", -1, -1 ), new TextFileInputField( "Field 2", -1, -1 ), new TextFileInputField( "Field 3", -1, -1 ) ); process(); check( new Object[][] { { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" }, { "\u043d\u0435-\u043b\u0430\u0446\u0456\u043d\u043a\u0430(non-latin)", "4", "4" } } ); }