CSVExporter: add test case for quoteAll option (#2430)
This commit is contained in:
parent
4ba75034cb
commit
0233e7186b
@ -106,7 +106,6 @@ public class CsvExporterTests extends RefineTest {
|
||||
Assert.assertEquals(writer.toString(), "column0,column1\n" +
|
||||
"row0cell0,row0cell1\n" +
|
||||
"row1cell0,row1cell1\n");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -124,7 +123,7 @@ public class CsvExporterTests extends RefineTest {
|
||||
|
||||
verify(options,times(2)).getProperty("printColumnHeader");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void exportSimpleCsvCustomLineSeparator(){
|
||||
CreateGrid(2, 2);
|
||||
@ -139,7 +138,22 @@ public class CsvExporterTests extends RefineTest {
|
||||
Assert.assertEquals(writer.toString(), "column0,column1X" +
|
||||
"row0cell0,row0cell1X" +
|
||||
"row1cell0,row1cell1X");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exportSimpleCsvQuoteAll(){
|
||||
CreateGrid(2, 2);
|
||||
when(options.getProperty("options")).thenReturn("{\"quoteAll\":\"true\"}");
|
||||
|
||||
try {
|
||||
SUT.export(project, options, engine, writer);
|
||||
} catch (IOException e) {
|
||||
Assert.fail();
|
||||
}
|
||||
|
||||
Assert.assertEquals(writer.toString(), "\"column0\",\"column1\"\n" +
|
||||
"\"row0cell0\",\"row0cell1\"\n" +
|
||||
"\"row1cell0\",\"row1cell1\"\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user