@@ -51,7 +51,7 @@ public static String printable(final String s) {
5151 return sb .toString ();
5252 }
5353
54- String recordSeparator = CSVFormat .DEFAULT .getRecordSeparator ();
54+ String recordSeparator = CSVFormat .RFC4180_EMPTY_LINES .getRecordSeparator ();
5555
5656 public void doOneRandom (final CSVFormat format ) throws Exception {
5757 final Random r = new Random ();
@@ -144,7 +144,7 @@ public String randStr() {
144144 @ Test
145145 public void testDisabledComment () throws IOException {
146146 final StringWriter sw = new StringWriter ();
147- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
147+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
148148 printer .printComment ("This is a comment" );
149149
150150 assertEquals ("" , sw .toString ());
@@ -216,7 +216,7 @@ public void testJdbcPrinter() throws IOException, ClassNotFoundException, SQLExc
216216 stmt .execute ("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))" );
217217 stmt .execute ("insert into TEST values(1, 'r1')" );
218218 stmt .execute ("insert into TEST values(2, 'r2')" );
219- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
219+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
220220 printer .printRecords (stmt .executeQuery ("select ID, NAME from TEST" ));
221221 assertEquals ("1,r1" + recordSeparator + "2,r2" + recordSeparator , sw .toString ());
222222 printer .close ();
@@ -238,7 +238,7 @@ public void testMultiLineComment() throws IOException {
238238 @ Test
239239 public void testPrinter1 () throws IOException {
240240 final StringWriter sw = new StringWriter ();
241- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
241+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
242242 printer .printRecord ("a" , "b" );
243243 assertEquals ("a,b" + recordSeparator , sw .toString ());
244244 printer .close ();
@@ -247,7 +247,7 @@ public void testPrinter1() throws IOException {
247247 @ Test
248248 public void testPrinter2 () throws IOException {
249249 final StringWriter sw = new StringWriter ();
250- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
250+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
251251 printer .printRecord ("a,b" , "b" );
252252 assertEquals ("\" a,b\" ,b" + recordSeparator , sw .toString ());
253253 printer .close ();
@@ -256,7 +256,7 @@ public void testPrinter2() throws IOException {
256256 @ Test
257257 public void testPrinter3 () throws IOException {
258258 final StringWriter sw = new StringWriter ();
259- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
259+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
260260 printer .printRecord ("a, b" , "b " );
261261 assertEquals ("\" a, b\" ,\" b \" " + recordSeparator , sw .toString ());
262262 printer .close ();
@@ -265,7 +265,7 @@ public void testPrinter3() throws IOException {
265265 @ Test
266266 public void testPrinter4 () throws IOException {
267267 final StringWriter sw = new StringWriter ();
268- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
268+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
269269 printer .printRecord ("a" , "b\" c" );
270270 assertEquals ("a,\" b\" \" c\" " + recordSeparator , sw .toString ());
271271 printer .close ();
@@ -274,7 +274,7 @@ public void testPrinter4() throws IOException {
274274 @ Test
275275 public void testPrinter5 () throws IOException {
276276 final StringWriter sw = new StringWriter ();
277- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
277+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
278278 printer .printRecord ("a" , "b\n c" );
279279 assertEquals ("a,\" b\n c\" " + recordSeparator , sw .toString ());
280280 printer .close ();
@@ -283,7 +283,7 @@ public void testPrinter5() throws IOException {
283283 @ Test
284284 public void testPrinter6 () throws IOException {
285285 final StringWriter sw = new StringWriter ();
286- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
286+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
287287 printer .printRecord ("a" , "b\r \n c" );
288288 assertEquals ("a,\" b\r \n c\" " + recordSeparator , sw .toString ());
289289 printer .close ();
@@ -292,7 +292,7 @@ public void testPrinter6() throws IOException {
292292 @ Test
293293 public void testPrinter7 () throws IOException {
294294 final StringWriter sw = new StringWriter ();
295- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
295+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
296296 printer .printRecord ("a" , "b\\ c" );
297297 assertEquals ("a,b\\ c" + recordSeparator , sw .toString ());
298298 printer .close ();
@@ -301,7 +301,7 @@ public void testPrinter7() throws IOException {
301301 @ Test
302302 public void testPrintNullValues () throws IOException {
303303 final StringWriter sw = new StringWriter ();
304- final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT );
304+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .RFC4180_EMPTY_LINES );
305305 printer .printRecord ("a" , null , "b" );
306306 assertEquals ("a,,b" + recordSeparator , sw .toString ());
307307 printer .close ();
@@ -328,7 +328,7 @@ public void testQuoteNonNumeric() throws IOException {
328328 @ Test
329329 public void testRandom () throws Exception {
330330 final int iter = 10000 ;
331- doRandom (CSVFormat .DEFAULT , iter );
331+ doRandom (CSVFormat .RFC4180_EMPTY_LINES , iter );
332332 doRandom (CSVFormat .EXCEL , iter );
333333 doRandom (CSVFormat .MYSQL , iter );
334334 }
0 commit comments