ASF Bugzilla – Attachment 27367 Details for
Bug 51645
CSVDataSet does not read UTF-8 files when file.encoding is UTF-8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Test cases to expose bug. Run with file.encoding=UTF-8
51645-testcases.patch (text/plain), 3.10 KB, created by
Jacob Zwiers
on 2011-08-10 19:56:50 UTC
(
hide
)
Description:
Test cases to expose bug. Run with file.encoding=UTF-8
Filename:
MIME Type:
Creator:
Jacob Zwiers
Created:
2011-08-10 19:56:50 UTC
Size:
3.10 KB
patch
obsolete
>Index: test/src/org/apache/jmeter/config/TestCVSDataSet.java >=================================================================== >--- test/src/org/apache/jmeter/config/TestCVSDataSet.java (revision 1155546) >+++ test/src/org/apache/jmeter/config/TestCVSDataSet.java (working copy) >@@ -92,7 +92,41 @@ > assertEquals("b1",threadVars.get("b")); > assertEquals("c1",threadVars.get("c")); > } >+ >+ public void testutf8() throws Exception { >+ >+ CSVDataSet csv = new CSVDataSet(); >+ csv.setFilename(findTestPath("testfiles/testutf8.csv")); >+ csv.setVariableNames("a,b,c,d"); >+ csv.setDelimiter(","); >+ csv.setQuotedData( true ); >+ csv.setFileEncoding( "UTF-8" ); >+ >+ csv.iterationStart(null); >+ assertEquals("a1",threadVars.get("a")); >+ assertEquals("b1",threadVars.get("b")); >+ assertEquals("\u00e71",threadVars.get("c")); >+ assertEquals("d1",threadVars.get("d")); > >+ csv.iterationStart(null); >+ assertEquals("a2",threadVars.get("a")); >+ assertEquals("b2",threadVars.get("b")); >+ assertEquals("\u00e72",threadVars.get("c")); >+ assertEquals("d2",threadVars.get("d")); >+ >+ csv.iterationStart(null); >+ assertEquals("a3",threadVars.get("a")); >+ assertEquals("b3",threadVars.get("b")); >+ assertEquals("\u00e73",threadVars.get("c")); >+ assertEquals("d3",threadVars.get("d")); >+ >+ csv.iterationStart(null); >+ assertEquals("a4",threadVars.get("a")); >+ assertEquals("b4",threadVars.get("b")); >+ assertEquals("\u00e74",threadVars.get("c")); >+ assertEquals("d4",threadVars.get("d")); >+ } >+ > // Test CSV file with a header line > public void testHeaderOpen(){ > CSVDataSet csv = new CSVDataSet(); >Index: test/src/org/apache/jmeter/save/TestCSVSaveService.java >=================================================================== >--- test/src/org/apache/jmeter/save/TestCSVSaveService.java (revision 1155546) >+++ test/src/org/apache/jmeter/save/TestCSVSaveService.java (working copy) >@@ -60,6 +60,10 @@ > checkSplitString("a,bc,,", ',', new String[]{"a","bc","",""}); > checkSplitString("a,,,", ',', new String[]{"a","","",""}); > checkSplitString("a,bc,d,\n",',', new String[]{"a","bc","d",""}); >+ >+ // \u00e7 = LATIN SMALL LETTER C WITH CEDILLA >+ // \u00e9 = LATIN SMALL LETTER E WITH ACUTE >+ checkSplitString("a,b\u00e7,d,\u00e9", ',', new String[]{"a","b\u00e7","d","\u00e9"}); > } > > public void testSplitQuoted() throws Exception { >@@ -75,6 +79,10 @@ > checkSplitString("a,bc,d,", ',', new String[]{"a","bc","d",""}); > checkSplitString("a,bc,d,\"\"", ',', new String[]{"a","bc","d",""}); > checkSplitString("a,bc,d,\"\"\n",',', new String[]{"a","bc","d",""}); >+ >+ // \u00e7 = LATIN SMALL LETTER C WITH CEDILLA >+ // \u00e9 = LATIN SMALL LETTER E WITH ACUTE >+ checkSplitString("\"a\",\"b\u00e7\",\"d\",\"\u00e9\"", ',', new String[]{"a","b\u00e7","d","\u00e9"}); > } > > public void testSplitBadQuote() throws Exception {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51645
:
27366
| 27367 |
27368