branch develop updated (0db0dde -> 410f02a)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository nuiton-csv. See http://git.nuiton.org/nuiton-csv.git from 0db0dde Update guava to 19.0 (Fixes #3807) new 410f02a Add test to prove new exporter API fixes #3015 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 410f02ab09fd13d36090f4423803aaf09f2a30ba Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Dec 19 02:28:25 2015 +0100 Add test to prove new exporter API fixes #3015 Summary of changes: src/test/java/org/nuiton/csv/ExporterTest.java | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-csv. See http://git.nuiton.org/nuiton-csv.git commit 410f02ab09fd13d36090f4423803aaf09f2a30ba Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Dec 19 02:28:25 2015 +0100 Add test to prove new exporter API fixes #3015 --- src/test/java/org/nuiton/csv/ExporterTest.java | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/test/java/org/nuiton/csv/ExporterTest.java b/src/test/java/org/nuiton/csv/ExporterTest.java index fee41ad..44c52f6 100644 --- a/src/test/java/org/nuiton/csv/ExporterTest.java +++ b/src/test/java/org/nuiton/csv/ExporterTest.java @@ -20,6 +20,7 @@ import java.io.StringWriter; import java.nio.charset.Charset; import java.util.Collections; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.Set; /** @@ -226,6 +227,35 @@ public class ExporterTest { } + /** + * See https://forge.nuiton.org/issues/3015 + * + * @throws IOException + */ + @Test + public void testHeaderShouldBeEspace() throws IOException { + + Exporter<RowBean> exporter = Exporter.<RowBean>builder() + .setCharset(CHARSET) + .addColumn("a;", "date", Common.DAY) + .addColumn("B\nb", "title") + .build(); + + Set<RowBean> set = new LinkedHashSet<>(); + set.add(new RowBean(DateUtil.createDate(1, 12, 2011), "One", 1, RowBeanEnum.ONE)); + set.add(new RowBean(DateUtil.createDate(1, 12, 2012), "Two", 1, RowBeanEnum.TWO)); + String csv = exporter.toString(set); + String csvWithoutHeader = exporter.toStringWithoutHeader(set); + + Assert.assertEquals("\"a;\";\"B\n" + + "b\"\n" + + "01/12/2011;One\n" + + "01/12/2012;Two\n", csv); + Assert.assertEquals("01/12/2011;One\n" + + "01/12/2012;Two\n", csvWithoutHeader); + + } + protected void assertExportResultEquals(Iterator<String> resultIterator, String actual, String actualWithoutHeader) { String expected = resultIterator.next(); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm