commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r919363 [33/44] - in /websites/production/commons/content/proper/commons-csv: ./ apidocs/ apidocs/org/apache/commons/csv/ apidocs/org/apache/commons/csv/class-use/ apidocs/resources/ apidocs/src-html/org/apache/commons/csv/ jacoco/ jacoco/....
Date Thu, 14 Aug 2014 19:48:09 GMT
Modified: websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVPrinterTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVPrinterTest.html (original)
+++ websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVPrinterTest.html Thu Aug 14 19:48:06 2014
@@ -46,7 +46,7 @@
 <span class="sourceLineNo">038</span>/**<a name="line.38"></a>
 <span class="sourceLineNo">039</span> *<a name="line.39"></a>
 <span class="sourceLineNo">040</span> *<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * @version $Id: CSVPrinterTest.java 1582813 2014-03-28 16:37:54Z sebb $<a name="line.41"></a>
+<span class="sourceLineNo">041</span> * @version $Id: CSVPrinterTest.java 1612352 2014-07-21 17:18:20Z ggregory $<a name="line.41"></a>
 <span class="sourceLineNo">042</span> */<a name="line.42"></a>
 <span class="sourceLineNo">043</span>public class CSVPrinterTest {<a name="line.43"></a>
 <span class="sourceLineNo">044</span><a name="line.44"></a>
@@ -241,7 +241,7 @@
 <span class="sourceLineNo">233</span>    @Test<a name="line.233"></a>
 <span class="sourceLineNo">234</span>    public void testMultiLineComment() throws IOException {<a name="line.234"></a>
 <span class="sourceLineNo">235</span>        final StringWriter sw = new StringWriter();<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentStart('#'));<a name="line.236"></a>
+<span class="sourceLineNo">236</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentMarker('#'));<a name="line.236"></a>
 <span class="sourceLineNo">237</span>        printer.printComment("This is a comment\non multiple lines");<a name="line.237"></a>
 <span class="sourceLineNo">238</span><a name="line.238"></a>
 <span class="sourceLineNo">239</span>        assertEquals("# This is a comment" + recordSeparator + "# on multiple lines" + recordSeparator, sw.toString());<a name="line.239"></a>
@@ -312,204 +312,224 @@
 <span class="sourceLineNo">304</span>    }<a name="line.304"></a>
 <span class="sourceLineNo">305</span><a name="line.305"></a>
 <span class="sourceLineNo">306</span>    @Test<a name="line.306"></a>
-<span class="sourceLineNo">307</span>    public void testPrintNullValues() throws IOException {<a name="line.307"></a>
+<span class="sourceLineNo">307</span>    public void testPrint() throws IOException {<a name="line.307"></a>
 <span class="sourceLineNo">308</span>        final StringWriter sw = new StringWriter();<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT);<a name="line.309"></a>
-<span class="sourceLineNo">310</span>        printer.printRecord("a", null, "b");<a name="line.310"></a>
-<span class="sourceLineNo">311</span>        assertEquals("a,,b" + recordSeparator, sw.toString());<a name="line.311"></a>
+<span class="sourceLineNo">309</span>        final CSVPrinter printer = CSVFormat.DEFAULT.print(sw);<a name="line.309"></a>
+<span class="sourceLineNo">310</span>        printer.printRecord("a", "b\\c");<a name="line.310"></a>
+<span class="sourceLineNo">311</span>        assertEquals("a,b\\c" + recordSeparator, sw.toString());<a name="line.311"></a>
 <span class="sourceLineNo">312</span>        printer.close();<a name="line.312"></a>
 <span class="sourceLineNo">313</span>    }<a name="line.313"></a>
 <span class="sourceLineNo">314</span><a name="line.314"></a>
 <span class="sourceLineNo">315</span>    @Test<a name="line.315"></a>
-<span class="sourceLineNo">316</span>    public void testPrintCustomNullValues() throws IOException {<a name="line.316"></a>
+<span class="sourceLineNo">316</span>    public void testPrintNullValues() throws IOException {<a name="line.316"></a>
 <span class="sourceLineNo">317</span>        final StringWriter sw = new StringWriter();<a name="line.317"></a>
-<span class="sourceLineNo">318</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withNullString("NULL"));<a name="line.318"></a>
+<span class="sourceLineNo">318</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT);<a name="line.318"></a>
 <span class="sourceLineNo">319</span>        printer.printRecord("a", null, "b");<a name="line.319"></a>
-<span class="sourceLineNo">320</span>        assertEquals("a,NULL,b" + recordSeparator, sw.toString());<a name="line.320"></a>
+<span class="sourceLineNo">320</span>        assertEquals("a,,b" + recordSeparator, sw.toString());<a name="line.320"></a>
 <span class="sourceLineNo">321</span>        printer.close();<a name="line.321"></a>
 <span class="sourceLineNo">322</span>    }<a name="line.322"></a>
 <span class="sourceLineNo">323</span><a name="line.323"></a>
 <span class="sourceLineNo">324</span>    @Test<a name="line.324"></a>
-<span class="sourceLineNo">325</span>    public void testParseCustomNullValues() throws IOException {<a name="line.325"></a>
+<span class="sourceLineNo">325</span>    public void testPrintCustomNullValues() throws IOException {<a name="line.325"></a>
 <span class="sourceLineNo">326</span>        final StringWriter sw = new StringWriter();<a name="line.326"></a>
-<span class="sourceLineNo">327</span>        final CSVFormat format = CSVFormat.DEFAULT.withNullString("NULL");<a name="line.327"></a>
-<span class="sourceLineNo">328</span>        final CSVPrinter printer = new CSVPrinter(sw, format);<a name="line.328"></a>
-<span class="sourceLineNo">329</span>        printer.printRecord("a", null, "b");<a name="line.329"></a>
+<span class="sourceLineNo">327</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withNullString("NULL"));<a name="line.327"></a>
+<span class="sourceLineNo">328</span>        printer.printRecord("a", null, "b");<a name="line.328"></a>
+<span class="sourceLineNo">329</span>        assertEquals("a,NULL,b" + recordSeparator, sw.toString());<a name="line.329"></a>
 <span class="sourceLineNo">330</span>        printer.close();<a name="line.330"></a>
-<span class="sourceLineNo">331</span>        final String csvString = sw.toString();<a name="line.331"></a>
-<span class="sourceLineNo">332</span>        assertEquals("a,NULL,b" + recordSeparator, csvString);<a name="line.332"></a>
-<span class="sourceLineNo">333</span>        final Iterable&lt;CSVRecord&gt; iterable = format.parse(new StringReader(csvString));<a name="line.333"></a>
-<span class="sourceLineNo">334</span>        final Iterator&lt;CSVRecord&gt; iterator = iterable.iterator();<a name="line.334"></a>
-<span class="sourceLineNo">335</span>        final CSVRecord record = iterator.next();<a name="line.335"></a>
-<span class="sourceLineNo">336</span>        assertEquals("a", record.get(0));<a name="line.336"></a>
-<span class="sourceLineNo">337</span>        assertEquals(null, record.get(1));<a name="line.337"></a>
-<span class="sourceLineNo">338</span>        assertEquals("b", record.get(2));<a name="line.338"></a>
-<span class="sourceLineNo">339</span>        assertFalse(iterator.hasNext());<a name="line.339"></a>
-<span class="sourceLineNo">340</span>        ((CSVParser) iterable).close();<a name="line.340"></a>
-<span class="sourceLineNo">341</span>    }<a name="line.341"></a>
-<span class="sourceLineNo">342</span><a name="line.342"></a>
-<span class="sourceLineNo">343</span>    @Test<a name="line.343"></a>
-<span class="sourceLineNo">344</span>    public void testQuoteAll() throws IOException {<a name="line.344"></a>
-<span class="sourceLineNo">345</span>        final StringWriter sw = new StringWriter();<a name="line.345"></a>
-<span class="sourceLineNo">346</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuotePolicy(Quote.ALL));<a name="line.346"></a>
-<span class="sourceLineNo">347</span>        printer.printRecord("a", "b\nc", "d");<a name="line.347"></a>
-<span class="sourceLineNo">348</span>        assertEquals("\"a\",\"b\nc\",\"d\"" + recordSeparator, sw.toString());<a name="line.348"></a>
-<span class="sourceLineNo">349</span>        printer.close();<a name="line.349"></a>
+<span class="sourceLineNo">331</span>    }<a name="line.331"></a>
+<span class="sourceLineNo">332</span><a name="line.332"></a>
+<span class="sourceLineNo">333</span>    @Test<a name="line.333"></a>
+<span class="sourceLineNo">334</span>    public void testParseCustomNullValues() throws IOException {<a name="line.334"></a>
+<span class="sourceLineNo">335</span>        final StringWriter sw = new StringWriter();<a name="line.335"></a>
+<span class="sourceLineNo">336</span>        final CSVFormat format = CSVFormat.DEFAULT.withNullString("NULL");<a name="line.336"></a>
+<span class="sourceLineNo">337</span>        final CSVPrinter printer = new CSVPrinter(sw, format);<a name="line.337"></a>
+<span class="sourceLineNo">338</span>        printer.printRecord("a", null, "b");<a name="line.338"></a>
+<span class="sourceLineNo">339</span>        printer.close();<a name="line.339"></a>
+<span class="sourceLineNo">340</span>        final String csvString = sw.toString();<a name="line.340"></a>
+<span class="sourceLineNo">341</span>        assertEquals("a,NULL,b" + recordSeparator, csvString);<a name="line.341"></a>
+<span class="sourceLineNo">342</span>        final Iterable&lt;CSVRecord&gt; iterable = format.parse(new StringReader(csvString));<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        final Iterator&lt;CSVRecord&gt; iterator = iterable.iterator();<a name="line.343"></a>
+<span class="sourceLineNo">344</span>        final CSVRecord record = iterator.next();<a name="line.344"></a>
+<span class="sourceLineNo">345</span>        assertEquals("a", record.get(0));<a name="line.345"></a>
+<span class="sourceLineNo">346</span>        assertEquals(null, record.get(1));<a name="line.346"></a>
+<span class="sourceLineNo">347</span>        assertEquals("b", record.get(2));<a name="line.347"></a>
+<span class="sourceLineNo">348</span>        assertFalse(iterator.hasNext());<a name="line.348"></a>
+<span class="sourceLineNo">349</span>        ((CSVParser) iterable).close();<a name="line.349"></a>
 <span class="sourceLineNo">350</span>    }<a name="line.350"></a>
 <span class="sourceLineNo">351</span><a name="line.351"></a>
 <span class="sourceLineNo">352</span>    @Test<a name="line.352"></a>
-<span class="sourceLineNo">353</span>    public void testQuoteNonNumeric() throws IOException {<a name="line.353"></a>
+<span class="sourceLineNo">353</span>    public void testQuoteAll() throws IOException {<a name="line.353"></a>
 <span class="sourceLineNo">354</span>        final StringWriter sw = new StringWriter();<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuotePolicy(Quote.NON_NUMERIC));<a name="line.355"></a>
-<span class="sourceLineNo">356</span>        printer.printRecord("a", "b\nc", Integer.valueOf(1));<a name="line.356"></a>
-<span class="sourceLineNo">357</span>        assertEquals("\"a\",\"b\nc\",1" + recordSeparator, sw.toString());<a name="line.357"></a>
+<span class="sourceLineNo">355</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.ALL));<a name="line.355"></a>
+<span class="sourceLineNo">356</span>        printer.printRecord("a", "b\nc", "d");<a name="line.356"></a>
+<span class="sourceLineNo">357</span>        assertEquals("\"a\",\"b\nc\",\"d\"" + recordSeparator, sw.toString());<a name="line.357"></a>
 <span class="sourceLineNo">358</span>        printer.close();<a name="line.358"></a>
 <span class="sourceLineNo">359</span>    }<a name="line.359"></a>
 <span class="sourceLineNo">360</span><a name="line.360"></a>
 <span class="sourceLineNo">361</span>    @Test<a name="line.361"></a>
-<span class="sourceLineNo">362</span>    public void testRandom() throws Exception {<a name="line.362"></a>
-<span class="sourceLineNo">363</span>        final int iter = 10000;<a name="line.363"></a>
-<span class="sourceLineNo">364</span>        doRandom(CSVFormat.DEFAULT, iter);<a name="line.364"></a>
-<span class="sourceLineNo">365</span>        doRandom(CSVFormat.EXCEL, iter);<a name="line.365"></a>
-<span class="sourceLineNo">366</span>        doRandom(CSVFormat.MYSQL, iter);<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    }<a name="line.367"></a>
-<span class="sourceLineNo">368</span><a name="line.368"></a>
-<span class="sourceLineNo">369</span>    @Test<a name="line.369"></a>
-<span class="sourceLineNo">370</span>    public void testPlainQuoted() throws IOException {<a name="line.370"></a>
-<span class="sourceLineNo">371</span>        final StringWriter sw = new StringWriter();<a name="line.371"></a>
-<span class="sourceLineNo">372</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar('\''));<a name="line.372"></a>
-<span class="sourceLineNo">373</span>        printer.print("abc");<a name="line.373"></a>
-<span class="sourceLineNo">374</span>        assertEquals("abc", sw.toString());<a name="line.374"></a>
-<span class="sourceLineNo">375</span>        printer.close();<a name="line.375"></a>
+<span class="sourceLineNo">362</span>    public void testQuoteNonNumeric() throws IOException {<a name="line.362"></a>
+<span class="sourceLineNo">363</span>        final StringWriter sw = new StringWriter();<a name="line.363"></a>
+<span class="sourceLineNo">364</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.NON_NUMERIC));<a name="line.364"></a>
+<span class="sourceLineNo">365</span>        printer.printRecord("a", "b\nc", Integer.valueOf(1));<a name="line.365"></a>
+<span class="sourceLineNo">366</span>        assertEquals("\"a\",\"b\nc\",1" + recordSeparator, sw.toString());<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        printer.close();<a name="line.367"></a>
+<span class="sourceLineNo">368</span>    }<a name="line.368"></a>
+<span class="sourceLineNo">369</span><a name="line.369"></a>
+<span class="sourceLineNo">370</span>    @Test<a name="line.370"></a>
+<span class="sourceLineNo">371</span>    public void testRandom() throws Exception {<a name="line.371"></a>
+<span class="sourceLineNo">372</span>        final int iter = 10000;<a name="line.372"></a>
+<span class="sourceLineNo">373</span>        doRandom(CSVFormat.DEFAULT, iter);<a name="line.373"></a>
+<span class="sourceLineNo">374</span>        doRandom(CSVFormat.EXCEL, iter);<a name="line.374"></a>
+<span class="sourceLineNo">375</span>        doRandom(CSVFormat.MYSQL, iter);<a name="line.375"></a>
 <span class="sourceLineNo">376</span>    }<a name="line.376"></a>
 <span class="sourceLineNo">377</span><a name="line.377"></a>
 <span class="sourceLineNo">378</span>    @Test<a name="line.378"></a>
-<span class="sourceLineNo">379</span>    public void testSingleLineComment() throws IOException {<a name="line.379"></a>
+<span class="sourceLineNo">379</span>    public void testPlainQuoted() throws IOException {<a name="line.379"></a>
 <span class="sourceLineNo">380</span>        final StringWriter sw = new StringWriter();<a name="line.380"></a>
-<span class="sourceLineNo">381</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentStart('#'));<a name="line.381"></a>
-<span class="sourceLineNo">382</span>        printer.printComment("This is a comment");<a name="line.382"></a>
-<span class="sourceLineNo">383</span><a name="line.383"></a>
-<span class="sourceLineNo">384</span>        assertEquals("# This is a comment" + recordSeparator, sw.toString());<a name="line.384"></a>
-<span class="sourceLineNo">385</span>        printer.close();<a name="line.385"></a>
-<span class="sourceLineNo">386</span>    }<a name="line.386"></a>
-<span class="sourceLineNo">387</span><a name="line.387"></a>
-<span class="sourceLineNo">388</span>    @Test<a name="line.388"></a>
-<span class="sourceLineNo">389</span>    public void testSingleQuoteQuoted() throws IOException {<a name="line.389"></a>
-<span class="sourceLineNo">390</span>        final StringWriter sw = new StringWriter();<a name="line.390"></a>
-<span class="sourceLineNo">391</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar('\''));<a name="line.391"></a>
-<span class="sourceLineNo">392</span>        printer.print("a'b'c");<a name="line.392"></a>
-<span class="sourceLineNo">393</span>        printer.print("xyz");<a name="line.393"></a>
-<span class="sourceLineNo">394</span>        assertEquals("'a''b''c',xyz", sw.toString());<a name="line.394"></a>
-<span class="sourceLineNo">395</span>        printer.close();<a name="line.395"></a>
-<span class="sourceLineNo">396</span>    }<a name="line.396"></a>
-<span class="sourceLineNo">397</span><a name="line.397"></a>
-<span class="sourceLineNo">398</span>    @Test<a name="line.398"></a>
-<span class="sourceLineNo">399</span>    public void testDelimeterQuoted() throws IOException {<a name="line.399"></a>
-<span class="sourceLineNo">400</span>        final StringWriter sw = new StringWriter();<a name="line.400"></a>
-<span class="sourceLineNo">401</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar('\''));<a name="line.401"></a>
-<span class="sourceLineNo">402</span>        printer.print("a,b,c");<a name="line.402"></a>
-<span class="sourceLineNo">403</span>        printer.print("xyz");<a name="line.403"></a>
-<span class="sourceLineNo">404</span>        assertEquals("'a,b,c',xyz", sw.toString());<a name="line.404"></a>
-<span class="sourceLineNo">405</span>        printer.close();<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>    @Test<a name="line.408"></a>
-<span class="sourceLineNo">409</span>    public void testDelimeterQuoteNONE() throws IOException {<a name="line.409"></a>
-<span class="sourceLineNo">410</span>        final StringWriter sw = new StringWriter();<a name="line.410"></a>
-<span class="sourceLineNo">411</span>        final CSVFormat format = CSVFormat.DEFAULT.withEscape('!').withQuotePolicy(Quote.NONE);<a name="line.411"></a>
-<span class="sourceLineNo">412</span>        final CSVPrinter printer = new CSVPrinter(sw, format);<a name="line.412"></a>
-<span class="sourceLineNo">413</span>        printer.print("a,b,c");<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        printer.print("xyz");<a name="line.414"></a>
-<span class="sourceLineNo">415</span>        assertEquals("a!,b!,c,xyz", sw.toString());<a name="line.415"></a>
-<span class="sourceLineNo">416</span>        printer.close();<a name="line.416"></a>
-<span class="sourceLineNo">417</span>    }<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>    @Test<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    public void testEOLQuoted() throws IOException {<a name="line.420"></a>
-<span class="sourceLineNo">421</span>        final StringWriter sw = new StringWriter();<a name="line.421"></a>
-<span class="sourceLineNo">422</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar('\''));<a name="line.422"></a>
-<span class="sourceLineNo">423</span>        printer.print("a\rb\nc");<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        printer.print("x\by\fz");<a name="line.424"></a>
-<span class="sourceLineNo">425</span>        assertEquals("'a\rb\nc',x\by\fz", sw.toString());<a name="line.425"></a>
-<span class="sourceLineNo">426</span>        printer.close();<a name="line.426"></a>
-<span class="sourceLineNo">427</span>    }<a name="line.427"></a>
-<span class="sourceLineNo">428</span><a name="line.428"></a>
-<span class="sourceLineNo">429</span>    @Test<a name="line.429"></a>
-<span class="sourceLineNo">430</span>    public void testPlainEscaped() throws IOException {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>        final StringWriter sw = new StringWriter();<a name="line.431"></a>
-<span class="sourceLineNo">432</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar(null).withEscape('!'));<a name="line.432"></a>
-<span class="sourceLineNo">433</span>        printer.print("abc");<a name="line.433"></a>
-<span class="sourceLineNo">434</span>        printer.print("xyz");<a name="line.434"></a>
-<span class="sourceLineNo">435</span>        assertEquals("abc,xyz", sw.toString());<a name="line.435"></a>
-<span class="sourceLineNo">436</span>        printer.close();<a name="line.436"></a>
-<span class="sourceLineNo">437</span>    }<a name="line.437"></a>
-<span class="sourceLineNo">438</span><a name="line.438"></a>
-<span class="sourceLineNo">439</span>    @Test<a name="line.439"></a>
-<span class="sourceLineNo">440</span>    public void testDelimiterEscaped() throws IOException {<a name="line.440"></a>
-<span class="sourceLineNo">441</span>        final StringWriter sw = new StringWriter();<a name="line.441"></a>
-<span class="sourceLineNo">442</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape('!').withQuoteChar(null));<a name="line.442"></a>
-<span class="sourceLineNo">443</span>        printer.print("a,b,c");<a name="line.443"></a>
-<span class="sourceLineNo">444</span>        printer.print("xyz");<a name="line.444"></a>
-<span class="sourceLineNo">445</span>        assertEquals("a!,b!,c,xyz", sw.toString());<a name="line.445"></a>
-<span class="sourceLineNo">446</span>        printer.close();<a name="line.446"></a>
-<span class="sourceLineNo">447</span>    }<a name="line.447"></a>
-<span class="sourceLineNo">448</span><a name="line.448"></a>
-<span class="sourceLineNo">449</span>    @Test<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    public void testEOLEscaped() throws IOException {<a name="line.450"></a>
-<span class="sourceLineNo">451</span>        final StringWriter sw = new StringWriter();<a name="line.451"></a>
-<span class="sourceLineNo">452</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar(null).withEscape('!'));<a name="line.452"></a>
-<span class="sourceLineNo">453</span>        printer.print("a\rb\nc");<a name="line.453"></a>
-<span class="sourceLineNo">454</span>        printer.print("x\fy\bz");<a name="line.454"></a>
-<span class="sourceLineNo">455</span>        assertEquals("a!rb!nc,x\fy\bz", sw.toString());<a name="line.455"></a>
-<span class="sourceLineNo">456</span>        printer.close();<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    }<a name="line.457"></a>
-<span class="sourceLineNo">458</span><a name="line.458"></a>
-<span class="sourceLineNo">459</span>    @Test<a name="line.459"></a>
-<span class="sourceLineNo">460</span>    public void testPlainPlain() throws IOException {<a name="line.460"></a>
-<span class="sourceLineNo">461</span>        final StringWriter sw = new StringWriter();<a name="line.461"></a>
-<span class="sourceLineNo">462</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar(null));<a name="line.462"></a>
-<span class="sourceLineNo">463</span>        printer.print("abc");<a name="line.463"></a>
-<span class="sourceLineNo">464</span>        printer.print("xyz");<a name="line.464"></a>
-<span class="sourceLineNo">465</span>        assertEquals("abc,xyz", sw.toString());<a name="line.465"></a>
-<span class="sourceLineNo">466</span>        printer.close();<a name="line.466"></a>
-<span class="sourceLineNo">467</span>    }<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>    @Test<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    public void testDelimiterPlain() throws IOException {<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        final StringWriter sw = new StringWriter();<a name="line.471"></a>
-<span class="sourceLineNo">472</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar(null));<a name="line.472"></a>
-<span class="sourceLineNo">473</span>        printer.print("a,b,c");<a name="line.473"></a>
-<span class="sourceLineNo">474</span>        printer.print("xyz");<a name="line.474"></a>
-<span class="sourceLineNo">475</span>        assertEquals("a,b,c,xyz", sw.toString());<a name="line.475"></a>
-<span class="sourceLineNo">476</span>        printer.close();<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    }<a name="line.477"></a>
-<span class="sourceLineNo">478</span><a name="line.478"></a>
-<span class="sourceLineNo">479</span>    @Test<a name="line.479"></a>
-<span class="sourceLineNo">480</span>    public void testEOLPlain() throws IOException {<a name="line.480"></a>
-<span class="sourceLineNo">481</span>        final StringWriter sw = new StringWriter();<a name="line.481"></a>
-<span class="sourceLineNo">482</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteChar(null));<a name="line.482"></a>
-<span class="sourceLineNo">483</span>        printer.print("a\rb\nc");<a name="line.483"></a>
-<span class="sourceLineNo">484</span>        printer.print("x\fy\bz");<a name="line.484"></a>
-<span class="sourceLineNo">485</span>        assertEquals("a\rb\nc,x\fy\bz", sw.toString());<a name="line.485"></a>
-<span class="sourceLineNo">486</span>        printer.close();<a name="line.486"></a>
-<span class="sourceLineNo">487</span>    }<a name="line.487"></a>
-<span class="sourceLineNo">488</span><a name="line.488"></a>
-<span class="sourceLineNo">489</span>    @Test(expected = IllegalArgumentException.class)<a name="line.489"></a>
-<span class="sourceLineNo">490</span>    public void testInvalidFormat() throws Exception {<a name="line.490"></a>
-<span class="sourceLineNo">491</span>        final CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR);<a name="line.491"></a>
-<span class="sourceLineNo">492</span>        new CSVPrinter(new StringWriter(), invalidFormat).close();<a name="line.492"></a>
-<span class="sourceLineNo">493</span>    }<a name="line.493"></a>
-<span class="sourceLineNo">494</span><a name="line.494"></a>
-<span class="sourceLineNo">495</span>    @Test(expected = IllegalArgumentException.class)<a name="line.495"></a>
-<span class="sourceLineNo">496</span>    public void testNewCSVPrinterNullAppendableFormat() throws Exception {<a name="line.496"></a>
-<span class="sourceLineNo">497</span>        new CSVPrinter(null, CSVFormat.DEFAULT).close();<a name="line.497"></a>
-<span class="sourceLineNo">498</span>    }<a name="line.498"></a>
-<span class="sourceLineNo">499</span><a name="line.499"></a>
-<span class="sourceLineNo">500</span>    @Test(expected = IllegalArgumentException.class)<a name="line.500"></a>
-<span class="sourceLineNo">501</span>    public void testNewCsvPrinterAppendableNullFormat() throws Exception {<a name="line.501"></a>
-<span class="sourceLineNo">502</span>        new CSVPrinter(new StringWriter(), null).close();<a name="line.502"></a>
-<span class="sourceLineNo">503</span>    }<a name="line.503"></a>
-<span class="sourceLineNo">504</span>}<a name="line.504"></a>
+<span class="sourceLineNo">381</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''));<a name="line.381"></a>
+<span class="sourceLineNo">382</span>        printer.print("abc");<a name="line.382"></a>
+<span class="sourceLineNo">383</span>        assertEquals("abc", sw.toString());<a name="line.383"></a>
+<span class="sourceLineNo">384</span>        printer.close();<a name="line.384"></a>
+<span class="sourceLineNo">385</span>    }<a name="line.385"></a>
+<span class="sourceLineNo">386</span><a name="line.386"></a>
+<span class="sourceLineNo">387</span>    @Test<a name="line.387"></a>
+<span class="sourceLineNo">388</span>    public void testSingleLineComment() throws IOException {<a name="line.388"></a>
+<span class="sourceLineNo">389</span>        final StringWriter sw = new StringWriter();<a name="line.389"></a>
+<span class="sourceLineNo">390</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentMarker('#'));<a name="line.390"></a>
+<span class="sourceLineNo">391</span>        printer.printComment("This is a comment");<a name="line.391"></a>
+<span class="sourceLineNo">392</span><a name="line.392"></a>
+<span class="sourceLineNo">393</span>        assertEquals("# This is a comment" + recordSeparator, sw.toString());<a name="line.393"></a>
+<span class="sourceLineNo">394</span>        printer.close();<a name="line.394"></a>
+<span class="sourceLineNo">395</span>    }<a name="line.395"></a>
+<span class="sourceLineNo">396</span><a name="line.396"></a>
+<span class="sourceLineNo">397</span>    @Test<a name="line.397"></a>
+<span class="sourceLineNo">398</span>    public void testSingleQuoteQuoted() throws IOException {<a name="line.398"></a>
+<span class="sourceLineNo">399</span>        final StringWriter sw = new StringWriter();<a name="line.399"></a>
+<span class="sourceLineNo">400</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''));<a name="line.400"></a>
+<span class="sourceLineNo">401</span>        printer.print("a'b'c");<a name="line.401"></a>
+<span class="sourceLineNo">402</span>        printer.print("xyz");<a name="line.402"></a>
+<span class="sourceLineNo">403</span>        assertEquals("'a''b''c',xyz", sw.toString());<a name="line.403"></a>
+<span class="sourceLineNo">404</span>        printer.close();<a name="line.404"></a>
+<span class="sourceLineNo">405</span>    }<a name="line.405"></a>
+<span class="sourceLineNo">406</span><a name="line.406"></a>
+<span class="sourceLineNo">407</span>    @Test<a name="line.407"></a>
+<span class="sourceLineNo">408</span>    public void testDelimeterQuoted() throws IOException {<a name="line.408"></a>
+<span class="sourceLineNo">409</span>        final StringWriter sw = new StringWriter();<a name="line.409"></a>
+<span class="sourceLineNo">410</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''));<a name="line.410"></a>
+<span class="sourceLineNo">411</span>        printer.print("a,b,c");<a name="line.411"></a>
+<span class="sourceLineNo">412</span>        printer.print("xyz");<a name="line.412"></a>
+<span class="sourceLineNo">413</span>        assertEquals("'a,b,c',xyz", sw.toString());<a name="line.413"></a>
+<span class="sourceLineNo">414</span>        printer.close();<a name="line.414"></a>
+<span class="sourceLineNo">415</span>    }<a name="line.415"></a>
+<span class="sourceLineNo">416</span><a name="line.416"></a>
+<span class="sourceLineNo">417</span>    @Test<a name="line.417"></a>
+<span class="sourceLineNo">418</span>    public void testDelimeterQuoteNONE() throws IOException {<a name="line.418"></a>
+<span class="sourceLineNo">419</span>        final StringWriter sw = new StringWriter();<a name="line.419"></a>
+<span class="sourceLineNo">420</span>        final CSVFormat format = CSVFormat.DEFAULT.withEscape('!').withQuoteMode(QuoteMode.NONE);<a name="line.420"></a>
+<span class="sourceLineNo">421</span>        final CSVPrinter printer = new CSVPrinter(sw, format);<a name="line.421"></a>
+<span class="sourceLineNo">422</span>        printer.print("a,b,c");<a name="line.422"></a>
+<span class="sourceLineNo">423</span>        printer.print("xyz");<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        assertEquals("a!,b!,c,xyz", sw.toString());<a name="line.424"></a>
+<span class="sourceLineNo">425</span>        printer.close();<a name="line.425"></a>
+<span class="sourceLineNo">426</span>    }<a name="line.426"></a>
+<span class="sourceLineNo">427</span><a name="line.427"></a>
+<span class="sourceLineNo">428</span>    @Test<a name="line.428"></a>
+<span class="sourceLineNo">429</span>    public void testEOLQuoted() throws IOException {<a name="line.429"></a>
+<span class="sourceLineNo">430</span>        final StringWriter sw = new StringWriter();<a name="line.430"></a>
+<span class="sourceLineNo">431</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''));<a name="line.431"></a>
+<span class="sourceLineNo">432</span>        printer.print("a\rb\nc");<a name="line.432"></a>
+<span class="sourceLineNo">433</span>        printer.print("x\by\fz");<a name="line.433"></a>
+<span class="sourceLineNo">434</span>        assertEquals("'a\rb\nc',x\by\fz", sw.toString());<a name="line.434"></a>
+<span class="sourceLineNo">435</span>        printer.close();<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    }<a name="line.436"></a>
+<span class="sourceLineNo">437</span><a name="line.437"></a>
+<span class="sourceLineNo">438</span>    @Test<a name="line.438"></a>
+<span class="sourceLineNo">439</span>    public void testPlainEscaped() throws IOException {<a name="line.439"></a>
+<span class="sourceLineNo">440</span>        final StringWriter sw = new StringWriter();<a name="line.440"></a>
+<span class="sourceLineNo">441</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withEscape('!'));<a name="line.441"></a>
+<span class="sourceLineNo">442</span>        printer.print("abc");<a name="line.442"></a>
+<span class="sourceLineNo">443</span>        printer.print("xyz");<a name="line.443"></a>
+<span class="sourceLineNo">444</span>        assertEquals("abc,xyz", sw.toString());<a name="line.444"></a>
+<span class="sourceLineNo">445</span>        printer.close();<a name="line.445"></a>
+<span class="sourceLineNo">446</span>    }<a name="line.446"></a>
+<span class="sourceLineNo">447</span><a name="line.447"></a>
+<span class="sourceLineNo">448</span>    @Test<a name="line.448"></a>
+<span class="sourceLineNo">449</span>    public void testDelimiterEscaped() throws IOException {<a name="line.449"></a>
+<span class="sourceLineNo">450</span>        final StringWriter sw = new StringWriter();<a name="line.450"></a>
+<span class="sourceLineNo">451</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape('!').withQuote(null));<a name="line.451"></a>
+<span class="sourceLineNo">452</span>        printer.print("a,b,c");<a name="line.452"></a>
+<span class="sourceLineNo">453</span>        printer.print("xyz");<a name="line.453"></a>
+<span class="sourceLineNo">454</span>        assertEquals("a!,b!,c,xyz", sw.toString());<a name="line.454"></a>
+<span class="sourceLineNo">455</span>        printer.close();<a name="line.455"></a>
+<span class="sourceLineNo">456</span>    }<a name="line.456"></a>
+<span class="sourceLineNo">457</span><a name="line.457"></a>
+<span class="sourceLineNo">458</span>    @Test<a name="line.458"></a>
+<span class="sourceLineNo">459</span>    public void testEOLEscaped() throws IOException {<a name="line.459"></a>
+<span class="sourceLineNo">460</span>        final StringWriter sw = new StringWriter();<a name="line.460"></a>
+<span class="sourceLineNo">461</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withEscape('!'));<a name="line.461"></a>
+<span class="sourceLineNo">462</span>        printer.print("a\rb\nc");<a name="line.462"></a>
+<span class="sourceLineNo">463</span>        printer.print("x\fy\bz");<a name="line.463"></a>
+<span class="sourceLineNo">464</span>        assertEquals("a!rb!nc,x\fy\bz", sw.toString());<a name="line.464"></a>
+<span class="sourceLineNo">465</span>        printer.close();<a name="line.465"></a>
+<span class="sourceLineNo">466</span>    }<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>    @Test<a name="line.468"></a>
+<span class="sourceLineNo">469</span>    public void testPlainPlain() throws IOException {<a name="line.469"></a>
+<span class="sourceLineNo">470</span>        final StringWriter sw = new StringWriter();<a name="line.470"></a>
+<span class="sourceLineNo">471</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null));<a name="line.471"></a>
+<span class="sourceLineNo">472</span>        printer.print("abc");<a name="line.472"></a>
+<span class="sourceLineNo">473</span>        printer.print("xyz");<a name="line.473"></a>
+<span class="sourceLineNo">474</span>        assertEquals("abc,xyz", sw.toString());<a name="line.474"></a>
+<span class="sourceLineNo">475</span>        printer.close();<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    }<a name="line.476"></a>
+<span class="sourceLineNo">477</span><a name="line.477"></a>
+<span class="sourceLineNo">478</span>    @Test<a name="line.478"></a>
+<span class="sourceLineNo">479</span>    public void testDelimiterPlain() throws IOException {<a name="line.479"></a>
+<span class="sourceLineNo">480</span>        final StringWriter sw = new StringWriter();<a name="line.480"></a>
+<span class="sourceLineNo">481</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null));<a name="line.481"></a>
+<span class="sourceLineNo">482</span>        printer.print("a,b,c");<a name="line.482"></a>
+<span class="sourceLineNo">483</span>        printer.print("xyz");<a name="line.483"></a>
+<span class="sourceLineNo">484</span>        assertEquals("a,b,c,xyz", sw.toString());<a name="line.484"></a>
+<span class="sourceLineNo">485</span>        printer.close();<a name="line.485"></a>
+<span class="sourceLineNo">486</span>    }<a name="line.486"></a>
+<span class="sourceLineNo">487</span><a name="line.487"></a>
+<span class="sourceLineNo">488</span>    @Test<a name="line.488"></a>
+<span class="sourceLineNo">489</span>    public void testHeader() throws IOException {<a name="line.489"></a>
+<span class="sourceLineNo">490</span>        final StringWriter sw = new StringWriter();<a name="line.490"></a>
+<span class="sourceLineNo">491</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null)<a name="line.491"></a>
+<span class="sourceLineNo">492</span>                .withHeader("C1", "C2", "C3"));<a name="line.492"></a>
+<span class="sourceLineNo">493</span>        printer.printRecord("a", "b", "c");<a name="line.493"></a>
+<span class="sourceLineNo">494</span>        printer.printRecord("x", "y", "z");<a name="line.494"></a>
+<span class="sourceLineNo">495</span>        assertEquals("C1,C2,C3\r\na,b,c\r\nx,y,z\r\n", sw.toString());<a name="line.495"></a>
+<span class="sourceLineNo">496</span>        printer.close();<a name="line.496"></a>
+<span class="sourceLineNo">497</span>    }<a name="line.497"></a>
+<span class="sourceLineNo">498</span><a name="line.498"></a>
+<span class="sourceLineNo">499</span>    @Test<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    public void testEOLPlain() throws IOException {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>        final StringWriter sw = new StringWriter();<a name="line.501"></a>
+<span class="sourceLineNo">502</span>        final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null));<a name="line.502"></a>
+<span class="sourceLineNo">503</span>        printer.print("a\rb\nc");<a name="line.503"></a>
+<span class="sourceLineNo">504</span>        printer.print("x\fy\bz");<a name="line.504"></a>
+<span class="sourceLineNo">505</span>        assertEquals("a\rb\nc,x\fy\bz", sw.toString());<a name="line.505"></a>
+<span class="sourceLineNo">506</span>        printer.close();<a name="line.506"></a>
+<span class="sourceLineNo">507</span>    }<a name="line.507"></a>
+<span class="sourceLineNo">508</span><a name="line.508"></a>
+<span class="sourceLineNo">509</span>    @Test(expected = IllegalArgumentException.class)<a name="line.509"></a>
+<span class="sourceLineNo">510</span>    public void testInvalidFormat() throws Exception {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        final CSVFormat invalidFormat = CSVFormat.DEFAULT.withDelimiter(CR);<a name="line.511"></a>
+<span class="sourceLineNo">512</span>        new CSVPrinter(new StringWriter(), invalidFormat).close();<a name="line.512"></a>
+<span class="sourceLineNo">513</span>    }<a name="line.513"></a>
+<span class="sourceLineNo">514</span><a name="line.514"></a>
+<span class="sourceLineNo">515</span>    @Test(expected = IllegalArgumentException.class)<a name="line.515"></a>
+<span class="sourceLineNo">516</span>    public void testNewCSVPrinterNullAppendableFormat() throws Exception {<a name="line.516"></a>
+<span class="sourceLineNo">517</span>        new CSVPrinter(null, CSVFormat.DEFAULT).close();<a name="line.517"></a>
+<span class="sourceLineNo">518</span>    }<a name="line.518"></a>
+<span class="sourceLineNo">519</span><a name="line.519"></a>
+<span class="sourceLineNo">520</span>    @Test(expected = IllegalArgumentException.class)<a name="line.520"></a>
+<span class="sourceLineNo">521</span>    public void testNewCsvPrinterAppendableNullFormat() throws Exception {<a name="line.521"></a>
+<span class="sourceLineNo">522</span>        new CSVPrinter(new StringWriter(), null).close();<a name="line.522"></a>
+<span class="sourceLineNo">523</span>    }<a name="line.523"></a>
+<span class="sourceLineNo">524</span>}<a name="line.524"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVRecordTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVRecordTest.html (original)
+++ websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/CSVRecordTest.html Thu Aug 14 19:48:06 2014
@@ -26,170 +26,180 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>import static org.junit.Assert.assertEquals;<a name="line.19"></a>
 <span class="sourceLineNo">020</span>import static org.junit.Assert.assertFalse;<a name="line.20"></a>
-<span class="sourceLineNo">021</span>import static org.junit.Assert.assertNull;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import static org.junit.Assert.assertTrue;<a name="line.22"></a>
-<span class="sourceLineNo">023</span><a name="line.23"></a>
-<span class="sourceLineNo">024</span>import java.io.IOException;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import java.util.ArrayList;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import java.util.Collections;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import java.util.HashMap;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import java.util.Map;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import java.util.TreeMap;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import java.util.concurrent.ConcurrentHashMap;<a name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.junit.Assert;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.junit.Before;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import org.junit.Test;<a name="line.34"></a>
-<span class="sourceLineNo">035</span><a name="line.35"></a>
-<span class="sourceLineNo">036</span>public class CSVRecordTest {<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>    private enum EnumFixture { UNKNOWN_COLUMN }<a name="line.38"></a>
-<span class="sourceLineNo">039</span><a name="line.39"></a>
-<span class="sourceLineNo">040</span>    private String[] values;<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    private CSVRecord record, recordWithHeader;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    private Map&lt;String, Integer&gt; header;<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>    @Before<a name="line.44"></a>
-<span class="sourceLineNo">045</span>    public void setUp() throws Exception {<a name="line.45"></a>
-<span class="sourceLineNo">046</span>        values = new String[] { "A", "B", "C" };<a name="line.46"></a>
-<span class="sourceLineNo">047</span>        record = new CSVRecord(values, null, null, 0);<a name="line.47"></a>
-<span class="sourceLineNo">048</span>        header = new HashMap&lt;String, Integer&gt;();<a name="line.48"></a>
-<span class="sourceLineNo">049</span>        header.put("first", Integer.valueOf(0));<a name="line.49"></a>
-<span class="sourceLineNo">050</span>        header.put("second", Integer.valueOf(1));<a name="line.50"></a>
-<span class="sourceLineNo">051</span>        header.put("third", Integer.valueOf(2));<a name="line.51"></a>
-<span class="sourceLineNo">052</span>        recordWithHeader = new CSVRecord(values, header, null, 0);<a name="line.52"></a>
-<span class="sourceLineNo">053</span>    }<a name="line.53"></a>
-<span class="sourceLineNo">054</span><a name="line.54"></a>
-<span class="sourceLineNo">055</span>    @Test<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    public void testGetInt() {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>        assertEquals(values[0], record.get(0));<a name="line.57"></a>
-<span class="sourceLineNo">058</span>        assertEquals(values[1], record.get(1));<a name="line.58"></a>
-<span class="sourceLineNo">059</span>        assertEquals(values[2], record.get(2));<a name="line.59"></a>
-<span class="sourceLineNo">060</span>    }<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>    @Test<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    public void testGetString() {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        assertEquals(values[0], recordWithHeader.get("first"));<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        assertEquals(values[1], recordWithHeader.get("second"));<a name="line.65"></a>
-<span class="sourceLineNo">066</span>        assertEquals(values[2], recordWithHeader.get("third"));<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    }<a name="line.67"></a>
-<span class="sourceLineNo">068</span><a name="line.68"></a>
-<span class="sourceLineNo">069</span>    @Test(expected = IllegalArgumentException.class)<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    public void testGetStringInconsistentRecord() {<a name="line.70"></a>
-<span class="sourceLineNo">071</span>        header.put("fourth", Integer.valueOf(4));<a name="line.71"></a>
-<span class="sourceLineNo">072</span>        recordWithHeader.get("fourth");<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    }<a name="line.73"></a>
-<span class="sourceLineNo">074</span><a name="line.74"></a>
-<span class="sourceLineNo">075</span>    @Test(expected = IllegalStateException.class)<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    public void testGetStringNoHeader() {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>        record.get("first");<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
-<span class="sourceLineNo">079</span><a name="line.79"></a>
-<span class="sourceLineNo">080</span>    @Test(expected = IllegalArgumentException.class)<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    public void testGetUnmappedEnum() {<a name="line.81"></a>
-<span class="sourceLineNo">082</span>        assertNull(recordWithHeader.get(EnumFixture.UNKNOWN_COLUMN));<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    }<a name="line.83"></a>
-<span class="sourceLineNo">084</span><a name="line.84"></a>
-<span class="sourceLineNo">085</span>    @Test(expected = IllegalArgumentException.class)<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    public void testGetUnmappedName() {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>        assertNull(recordWithHeader.get("fourth"));<a name="line.87"></a>
-<span class="sourceLineNo">088</span>    }<a name="line.88"></a>
-<span class="sourceLineNo">089</span><a name="line.89"></a>
-<span class="sourceLineNo">090</span>    @Test(expected = ArrayIndexOutOfBoundsException.class)<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    public void testGetUnmappedNegativeInt() {<a name="line.91"></a>
-<span class="sourceLineNo">092</span>        assertNull(recordWithHeader.get(Integer.MIN_VALUE));<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    }<a name="line.93"></a>
-<span class="sourceLineNo">094</span><a name="line.94"></a>
-<span class="sourceLineNo">095</span>    @Test(expected = ArrayIndexOutOfBoundsException.class)<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    public void testGetUnmappedPositiveInt() {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>        assertNull(recordWithHeader.get(Integer.MAX_VALUE));<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    }<a name="line.98"></a>
-<span class="sourceLineNo">099</span><a name="line.99"></a>
-<span class="sourceLineNo">100</span>    @Test<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    public void testIsConsistent() {<a name="line.101"></a>
-<span class="sourceLineNo">102</span>        assertTrue(record.isConsistent());<a name="line.102"></a>
-<span class="sourceLineNo">103</span>        assertTrue(recordWithHeader.isConsistent());<a name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>        header.put("fourth", Integer.valueOf(4));<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        assertFalse(recordWithHeader.isConsistent());<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    }<a name="line.107"></a>
-<span class="sourceLineNo">108</span><a name="line.108"></a>
-<span class="sourceLineNo">109</span>    @Test<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    public void testIsMapped() {<a name="line.110"></a>
-<span class="sourceLineNo">111</span>        assertFalse(record.isMapped("first"));<a name="line.111"></a>
-<span class="sourceLineNo">112</span>        assertTrue(recordWithHeader.isMapped("first"));<a name="line.112"></a>
-<span class="sourceLineNo">113</span>        assertFalse(recordWithHeader.isMapped("fourth"));<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    }<a name="line.114"></a>
-<span class="sourceLineNo">115</span><a name="line.115"></a>
-<span class="sourceLineNo">116</span>    @Test<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    public void testIsSet() {<a name="line.117"></a>
-<span class="sourceLineNo">118</span>        assertFalse(record.isSet("first"));<a name="line.118"></a>
-<span class="sourceLineNo">119</span>        assertTrue(recordWithHeader.isSet("first"));<a name="line.119"></a>
-<span class="sourceLineNo">120</span>        assertFalse(recordWithHeader.isSet("fourth"));<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
-<span class="sourceLineNo">122</span><a name="line.122"></a>
-<span class="sourceLineNo">123</span>    @Test<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    public void testIterator() {<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        int i = 0;<a name="line.125"></a>
-<span class="sourceLineNo">126</span>        for (final String value : record) {<a name="line.126"></a>
-<span class="sourceLineNo">127</span>            assertEquals(values[i], value);<a name="line.127"></a>
-<span class="sourceLineNo">128</span>            i++;<a name="line.128"></a>
-<span class="sourceLineNo">129</span>        }<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    }<a name="line.130"></a>
-<span class="sourceLineNo">131</span><a name="line.131"></a>
-<span class="sourceLineNo">132</span>    @Test<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    public void testPutInMap() {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>        final Map&lt;String, String&gt; map = new ConcurrentHashMap&lt;String, String&gt;();<a name="line.134"></a>
-<span class="sourceLineNo">135</span>        this.recordWithHeader.putIn(map);<a name="line.135"></a>
-<span class="sourceLineNo">136</span>        this.validateMap(map, false);<a name="line.136"></a>
-<span class="sourceLineNo">137</span>        // Test that we can compile with assigment to the same map as the param.<a name="line.137"></a>
-<span class="sourceLineNo">138</span>        final TreeMap&lt;String, String&gt; map2 = recordWithHeader.putIn(new TreeMap&lt;String, String&gt;());<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        this.validateMap(map2, false);<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    }<a name="line.140"></a>
-<span class="sourceLineNo">141</span><a name="line.141"></a>
-<span class="sourceLineNo">142</span>    @Test<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    public void testRemoveAndAddColumns() throws IOException {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>        // do:<a name="line.144"></a>
-<span class="sourceLineNo">145</span>        final CSVPrinter printer = new CSVPrinter(new StringBuilder(), CSVFormat.DEFAULT);<a name="line.145"></a>
-<span class="sourceLineNo">146</span>        final Map&lt;String, String&gt; map = recordWithHeader.toMap();<a name="line.146"></a>
-<span class="sourceLineNo">147</span>        map.remove("OldColumn");<a name="line.147"></a>
-<span class="sourceLineNo">148</span>        map.put("ZColumn", "NewValue");<a name="line.148"></a>
-<span class="sourceLineNo">149</span>        // check:<a name="line.149"></a>
-<span class="sourceLineNo">150</span>        final ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;(map.values());<a name="line.150"></a>
-<span class="sourceLineNo">151</span>        Collections.sort(list);<a name="line.151"></a>
-<span class="sourceLineNo">152</span>        printer.printRecord(list);<a name="line.152"></a>
-<span class="sourceLineNo">153</span>        Assert.assertEquals("A,B,C,NewValue" + CSVFormat.DEFAULT.getRecordSeparator(), printer.getOut().toString());<a name="line.153"></a>
-<span class="sourceLineNo">154</span>        printer.close();<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    }<a name="line.155"></a>
-<span class="sourceLineNo">156</span><a name="line.156"></a>
-<span class="sourceLineNo">157</span>    @Test<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    public void testToMap() {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>        final Map&lt;String, String&gt; map = this.recordWithHeader.toMap();<a name="line.159"></a>
-<span class="sourceLineNo">160</span>        this.validateMap(map, true);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>    @Test<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    public void testToMapWithShortRecord() throws Exception {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>       final CSVParser parser =  CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"));<a name="line.165"></a>
-<span class="sourceLineNo">166</span>       final CSVRecord shortRec = parser.iterator().next();<a name="line.166"></a>
-<span class="sourceLineNo">167</span>       shortRec.toMap();<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    }<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    <a name="line.169"></a>
-<span class="sourceLineNo">170</span>    private void validateMap(final Map&lt;String, String&gt; map, final boolean allowsNulls) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>        assertTrue(map.containsKey("first"));<a name="line.171"></a>
-<span class="sourceLineNo">172</span>        assertTrue(map.containsKey("second"));<a name="line.172"></a>
-<span class="sourceLineNo">173</span>        assertTrue(map.containsKey("third"));<a name="line.173"></a>
-<span class="sourceLineNo">174</span>        assertFalse(map.containsKey("fourth"));<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        if (allowsNulls) {<a name="line.175"></a>
-<span class="sourceLineNo">176</span>            assertFalse(map.containsKey(null));<a name="line.176"></a>
-<span class="sourceLineNo">177</span>        }<a name="line.177"></a>
-<span class="sourceLineNo">178</span>        assertEquals("A", map.get("first"));<a name="line.178"></a>
-<span class="sourceLineNo">179</span>        assertEquals("B", map.get("second"));<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        assertEquals("C", map.get("third"));<a name="line.180"></a>
-<span class="sourceLineNo">181</span>        assertEquals(null, map.get("fourth"));<a name="line.181"></a>
-<span class="sourceLineNo">182</span>    }<a name="line.182"></a>
-<span class="sourceLineNo">183</span><a name="line.183"></a>
-<span class="sourceLineNo">184</span>}<a name="line.184"></a>
+<span class="sourceLineNo">021</span>import static org.junit.Assert.assertNotNull;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import static org.junit.Assert.assertNull;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import static org.junit.Assert.assertTrue;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import java.io.IOException;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import java.util.ArrayList;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import java.util.Collections;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import java.util.HashMap;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import java.util.Map;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import java.util.TreeMap;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import java.util.concurrent.ConcurrentHashMap;<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.junit.Assert;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.junit.Before;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import org.junit.Test;<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>public class CSVRecordTest {<a name="line.37"></a>
+<span class="sourceLineNo">038</span><a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private enum EnumFixture { UNKNOWN_COLUMN }<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>    private String[] values;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    private CSVRecord record, recordWithHeader;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    private Map&lt;String, Integer&gt; header;<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    @Before<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    public void setUp() throws Exception {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>        values = new String[] { "A", "B", "C" };<a name="line.47"></a>
+<span class="sourceLineNo">048</span>        record = new CSVRecord(values, null, null, 0);<a name="line.48"></a>
+<span class="sourceLineNo">049</span>        header = new HashMap&lt;String, Integer&gt;();<a name="line.49"></a>
+<span class="sourceLineNo">050</span>        header.put("first", Integer.valueOf(0));<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        header.put("second", Integer.valueOf(1));<a name="line.51"></a>
+<span class="sourceLineNo">052</span>        header.put("third", Integer.valueOf(2));<a name="line.52"></a>
+<span class="sourceLineNo">053</span>        recordWithHeader = new CSVRecord(values, header, null, 0);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>    @Test<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    public void testGetInt() {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>        assertEquals(values[0], record.get(0));<a name="line.58"></a>
+<span class="sourceLineNo">059</span>        assertEquals(values[1], record.get(1));<a name="line.59"></a>
+<span class="sourceLineNo">060</span>        assertEquals(values[2], record.get(2));<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    }<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>    @Test<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    public void testGetString() {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>        assertEquals(values[0], recordWithHeader.get("first"));<a name="line.65"></a>
+<span class="sourceLineNo">066</span>        assertEquals(values[1], recordWithHeader.get("second"));<a name="line.66"></a>
+<span class="sourceLineNo">067</span>        assertEquals(values[2], recordWithHeader.get("third"));<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    }<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>    @Test(expected = IllegalArgumentException.class)<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    public void testGetStringInconsistentRecord() {<a name="line.71"></a>
+<span class="sourceLineNo">072</span>        header.put("fourth", Integer.valueOf(4));<a name="line.72"></a>
+<span class="sourceLineNo">073</span>        recordWithHeader.get("fourth");<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>    @Test(expected = IllegalStateException.class)<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    public void testGetStringNoHeader() {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>        record.get("first");<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    }<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>    @Test(expected = IllegalArgumentException.class)<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    public void testGetUnmappedEnum() {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>        assertNull(recordWithHeader.get(EnumFixture.UNKNOWN_COLUMN));<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>    @Test(expected = IllegalArgumentException.class)<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    public void testGetUnmappedName() {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        assertNull(recordWithHeader.get("fourth"));<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    }<a name="line.89"></a>
+<span class="sourceLineNo">090</span><a name="line.90"></a>
+<span class="sourceLineNo">091</span>    @Test(expected = ArrayIndexOutOfBoundsException.class)<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    public void testGetUnmappedNegativeInt() {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>        assertNull(recordWithHeader.get(Integer.MIN_VALUE));<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    }<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>    @Test(expected = ArrayIndexOutOfBoundsException.class)<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    public void testGetUnmappedPositiveInt() {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        assertNull(recordWithHeader.get(Integer.MAX_VALUE));<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>    @Test<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    public void testIsConsistent() {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        assertTrue(record.isConsistent());<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        assertTrue(recordWithHeader.isConsistent());<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>        header.put("fourth", Integer.valueOf(4));<a name="line.106"></a>
+<span class="sourceLineNo">107</span>        assertFalse(recordWithHeader.isConsistent());<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    }<a name="line.108"></a>
+<span class="sourceLineNo">109</span><a name="line.109"></a>
+<span class="sourceLineNo">110</span>    @Test<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    public void testIsMapped() {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>        assertFalse(record.isMapped("first"));<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        assertTrue(recordWithHeader.isMapped("first"));<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        assertFalse(recordWithHeader.isMapped("fourth"));<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    }<a name="line.115"></a>
+<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">117</span>    @Test<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    public void testIsSet() {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>        assertFalse(record.isSet("first"));<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        assertTrue(recordWithHeader.isSet("first"));<a name="line.120"></a>
+<span class="sourceLineNo">121</span>        assertFalse(recordWithHeader.isSet("fourth"));<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    }<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>    @Test<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    public void testIterator() {<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        int i = 0;<a name="line.126"></a>
+<span class="sourceLineNo">127</span>        for (final String value : record) {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>            assertEquals(values[i], value);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>            i++;<a name="line.129"></a>
+<span class="sourceLineNo">130</span>        }<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span><a name="line.132"></a>
+<span class="sourceLineNo">133</span>    @Test<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    public void testPutInMap() {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        final Map&lt;String, String&gt; map = new ConcurrentHashMap&lt;String, String&gt;();<a name="line.135"></a>
+<span class="sourceLineNo">136</span>        this.recordWithHeader.putIn(map);<a name="line.136"></a>
+<span class="sourceLineNo">137</span>        this.validateMap(map, false);<a name="line.137"></a>
+<span class="sourceLineNo">138</span>        // Test that we can compile with assigment to the same map as the param.<a name="line.138"></a>
+<span class="sourceLineNo">139</span>        final TreeMap&lt;String, String&gt; map2 = recordWithHeader.putIn(new TreeMap&lt;String, String&gt;());<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        this.validateMap(map2, false);<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>    @Test<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    public void testRemoveAndAddColumns() throws IOException {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        // do:<a name="line.145"></a>
+<span class="sourceLineNo">146</span>        final CSVPrinter printer = new CSVPrinter(new StringBuilder(), CSVFormat.DEFAULT);<a name="line.146"></a>
+<span class="sourceLineNo">147</span>        final Map&lt;String, String&gt; map = recordWithHeader.toMap();<a name="line.147"></a>
+<span class="sourceLineNo">148</span>        map.remove("OldColumn");<a name="line.148"></a>
+<span class="sourceLineNo">149</span>        map.put("ZColumn", "NewValue");<a name="line.149"></a>
+<span class="sourceLineNo">150</span>        // check:<a name="line.150"></a>
+<span class="sourceLineNo">151</span>        final ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;(map.values());<a name="line.151"></a>
+<span class="sourceLineNo">152</span>        Collections.sort(list);<a name="line.152"></a>
+<span class="sourceLineNo">153</span>        printer.printRecord(list);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>        Assert.assertEquals("A,B,C,NewValue" + CSVFormat.DEFAULT.getRecordSeparator(), printer.getOut().toString());<a name="line.154"></a>
+<span class="sourceLineNo">155</span>        printer.close();<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>    @Test<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    public void testToMap() {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>        final Map&lt;String, String&gt; map = this.recordWithHeader.toMap();<a name="line.160"></a>
+<span class="sourceLineNo">161</span>        this.validateMap(map, true);<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    }<a name="line.162"></a>
+<span class="sourceLineNo">163</span><a name="line.163"></a>
+<span class="sourceLineNo">164</span>    @Test<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    public void testToMapWithShortRecord() throws Exception {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>       final CSVParser parser =  CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"));<a name="line.166"></a>
+<span class="sourceLineNo">167</span>       final CSVRecord shortRec = parser.iterator().next();<a name="line.167"></a>
+<span class="sourceLineNo">168</span>       shortRec.toMap();<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>    @Test<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    public void testToMapWithNoHeader() throws Exception {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>       final CSVParser parser =  CSVParser.parse("a,b", CSVFormat.newFormat(','));<a name="line.173"></a>
+<span class="sourceLineNo">174</span>       final CSVRecord shortRec = parser.iterator().next();<a name="line.174"></a>
+<span class="sourceLineNo">175</span>       final Map&lt;String, String&gt; map = shortRec.toMap();<a name="line.175"></a>
+<span class="sourceLineNo">176</span>       assertNotNull("Map is not null.", map);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>       assertTrue("Map is empty.", map.isEmpty());<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>    private void validateMap(final Map&lt;String, String&gt; map, final boolean allowsNulls) {<a name="line.180"></a>
+<span class="sourceLineNo">181</span>        assertTrue(map.containsKey("first"));<a name="line.181"></a>
+<span class="sourceLineNo">182</span>        assertTrue(map.containsKey("second"));<a name="line.182"></a>
+<span class="sourceLineNo">183</span>        assertTrue(map.containsKey("third"));<a name="line.183"></a>
+<span class="sourceLineNo">184</span>        assertFalse(map.containsKey("fourth"));<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        if (allowsNulls) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>            assertFalse(map.containsKey(null));<a name="line.186"></a>
+<span class="sourceLineNo">187</span>        }<a name="line.187"></a>
+<span class="sourceLineNo">188</span>        assertEquals("A", map.get("first"));<a name="line.188"></a>
+<span class="sourceLineNo">189</span>        assertEquals("B", map.get("second"));<a name="line.189"></a>
+<span class="sourceLineNo">190</span>        assertEquals("C", map.get("third"));<a name="line.190"></a>
+<span class="sourceLineNo">191</span>        assertEquals(null, map.get("fourth"));<a name="line.191"></a>
+<span class="sourceLineNo">192</span>    }<a name="line.192"></a>
+<span class="sourceLineNo">193</span><a name="line.193"></a>
+<span class="sourceLineNo">194</span>}<a name="line.194"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/LexerTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/LexerTest.html (original)
+++ websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/LexerTest.html Thu Aug 14 19:48:06 2014
@@ -49,7 +49,7 @@
 <span class="sourceLineNo">041</span>/**<a name="line.41"></a>
 <span class="sourceLineNo">042</span> *<a name="line.42"></a>
 <span class="sourceLineNo">043</span> *<a name="line.43"></a>
-<span class="sourceLineNo">044</span> * @version $Id: LexerTest.java 1522876 2013-09-13 11:26:59Z britter $<a name="line.44"></a>
+<span class="sourceLineNo">044</span> * @version $Id: LexerTest.java 1612352 2014-07-21 17:18:20Z ggregory $<a name="line.44"></a>
 <span class="sourceLineNo">045</span> */<a name="line.45"></a>
 <span class="sourceLineNo">046</span>public class LexerTest {<a name="line.46"></a>
 <span class="sourceLineNo">047</span><a name="line.47"></a>
@@ -130,7 +130,7 @@
 <span class="sourceLineNo">122</span>                "third,line,#no-comment\n"+<a name="line.122"></a>
 <span class="sourceLineNo">123</span>                "# penultimate comment\n"+<a name="line.123"></a>
 <span class="sourceLineNo">124</span>                "# Final comment\n";<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        final CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#');<a name="line.125"></a>
+<span class="sourceLineNo">125</span>        final CSVFormat format = CSVFormat.DEFAULT.withCommentMarker('#');<a name="line.125"></a>
 <span class="sourceLineNo">126</span>        final Lexer parser = getLexer(code, format);<a name="line.126"></a>
 <span class="sourceLineNo">127</span><a name="line.127"></a>
 <span class="sourceLineNo">128</span>        assertThat(parser.nextToken(new Token()), matches(TOKEN, "first"));<a name="line.128"></a>
@@ -166,7 +166,7 @@
 <span class="sourceLineNo">158</span>                "\n"+                      // 6b<a name="line.158"></a>
 <span class="sourceLineNo">159</span>                "\n"+                      // 6c<a name="line.159"></a>
 <span class="sourceLineNo">160</span>                "# Final comment\n";       // 7<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        final CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#').withIgnoreEmptyLines(false);<a name="line.161"></a>
+<span class="sourceLineNo">161</span>        final CSVFormat format = CSVFormat.DEFAULT.withCommentMarker('#').withIgnoreEmptyLines(false);<a name="line.161"></a>
 <span class="sourceLineNo">162</span>        assertFalse("Should not ignore empty lines", format.getIgnoreEmptyLines());<a name="line.162"></a>
 <span class="sourceLineNo">163</span><a name="line.163"></a>
 <span class="sourceLineNo">164</span>        final Lexer parser = getLexer(code, format);<a name="line.164"></a>
@@ -206,7 +206,7 @@
 <span class="sourceLineNo">198</span>        */<a name="line.198"></a>
 <span class="sourceLineNo">199</span>        final String code = "a,\\,,b\\\n\\,,";<a name="line.199"></a>
 <span class="sourceLineNo">200</span>        final CSVFormat format = CSVFormat.DEFAULT;<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        assertFalse(format.isEscaping());<a name="line.201"></a>
+<span class="sourceLineNo">201</span>        assertFalse(format.isEscapeCharacterSet());<a name="line.201"></a>
 <span class="sourceLineNo">202</span>        final Lexer parser = getLexer(code, format);<a name="line.202"></a>
 <span class="sourceLineNo">203</span><a name="line.203"></a>
 <span class="sourceLineNo">204</span>        assertThat(parser.nextToken(new Token()), matches(TOKEN, "a"));<a name="line.204"></a>
@@ -228,7 +228,7 @@
 <span class="sourceLineNo">220</span>        */<a name="line.220"></a>
 <span class="sourceLineNo">221</span>        final String code = "a,\\,,b\\\\\n\\,,\\\nc,d\\\r\ne";<a name="line.221"></a>
 <span class="sourceLineNo">222</span>        final CSVFormat format = formatWithEscaping.withIgnoreEmptyLines(false);<a name="line.222"></a>
-<span class="sourceLineNo">223</span>        assertTrue(format.isEscaping());<a name="line.223"></a>
+<span class="sourceLineNo">223</span>        assertTrue(format.isEscapeCharacterSet());<a name="line.223"></a>
 <span class="sourceLineNo">224</span>        final Lexer parser = getLexer(code, format);<a name="line.224"></a>
 <span class="sourceLineNo">225</span><a name="line.225"></a>
 <span class="sourceLineNo">226</span>        assertThat(parser.nextToken(new Token()), matches(TOKEN, "a"));<a name="line.226"></a>
@@ -287,7 +287,7 @@
 <span class="sourceLineNo">279</span>        *       ;;<a name="line.279"></a>
 <span class="sourceLineNo">280</span>        */<a name="line.280"></a>
 <span class="sourceLineNo">281</span>        final String code = "a;'b and '' more\n'\n!comment;;;;\n;;";<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        final CSVFormat format = CSVFormat.DEFAULT.withQuoteChar('\'').withCommentStart('!').withDelimiter(';');<a name="line.282"></a>
+<span class="sourceLineNo">282</span>        final CSVFormat format = CSVFormat.DEFAULT.withQuote('\'').withCommentMarker('!').withDelimiter(';');<a name="line.282"></a>
 <span class="sourceLineNo">283</span>        final Lexer parser = getLexer(code, format);<a name="line.283"></a>
 <span class="sourceLineNo">284</span>        assertThat(parser.nextToken(new Token()), matches(TOKEN, "a"));<a name="line.284"></a>
 <span class="sourceLineNo">285</span>        assertThat(parser.nextToken(new Token()), matches(EORECORD, "b and ' more\n"));<a name="line.285"></a>

Modified: websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/perf/PerformanceTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/perf/PerformanceTest.html (original)
+++ websites/production/commons/content/proper/commons-csv/testapidocs/src-html/org/apache/commons/csv/perf/PerformanceTest.html Thu Aug 14 19:48:06 2014
@@ -82,7 +82,7 @@
 <span class="sourceLineNo">074</span>        for (final CSVRecord record : format.parse(in)) {<a name="line.74"></a>
 <span class="sourceLineNo">075</span>            recordCount++;<a name="line.75"></a>
 <span class="sourceLineNo">076</span>            if (traverseColumns) {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>                for (final String value : record) {<a name="line.77"></a>
+<span class="sourceLineNo">077</span>                for (@SuppressWarnings("unused") final String value : record) {<a name="line.77"></a>
 <span class="sourceLineNo">078</span>                    // do nothing for now<a name="line.78"></a>
 <span class="sourceLineNo">079</span>                }<a name="line.79"></a>
 <span class="sourceLineNo">080</span>            }<a name="line.80"></a>



Mime
View raw message