branch develop updated (435528e -> 27b56f6)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository nuiton-csv. See https://gitlab.nuiton.org/nuiton/nuiton-csv.git from 435528e Lifting de la doc sur le site et ajout du README new dd63152 Changement du nom des jobs new 27b56f6 fixes #4 Add unit test to prouve that bug doesn't exist anymore The 2 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 27b56f6b136b6523785dabe4559a3e4417778a78 Author: Arnaud Thimel <thimel@codelutin.com> Date: Wed May 2 15:52:21 2018 +0200 fixes #4 Add unit test to prouve that bug doesn't exist anymore commit dd631524d6650a805d8eab98dc8dd3216216f0ee Author: Arnaud Thimel <thimel@codelutin.com> Date: Wed May 2 15:39:05 2018 +0200 Changement du nom des jobs Summary of changes: .gitlab-ci.yml | 4 +-- src/test/java/org/nuiton/csv/ImportExportTest.java | 29 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) -- 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 https://gitlab.nuiton.org/nuiton/nuiton-csv.git commit dd631524d6650a805d8eab98dc8dd3216216f0ee Author: Arnaud Thimel <thimel@codelutin.com> Date: Wed May 2 15:39:05 2018 +0200 Changement du nom des jobs --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f92708b..cc6937b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,14 +18,14 @@ check-releasable: only: - develop -snapshot: +deploy:snapshot: stage: deploy only: - develop script: - mvn deploy -Prelease-profile -pages: +reporting:site: stage: reporting only: - master -- 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 https://gitlab.nuiton.org/nuiton/nuiton-csv.git commit 27b56f6b136b6523785dabe4559a3e4417778a78 Author: Arnaud Thimel <thimel@codelutin.com> Date: Wed May 2 15:52:21 2018 +0200 fixes #4 Add unit test to prouve that bug doesn't exist anymore --- src/test/java/org/nuiton/csv/ImportExportTest.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/test/java/org/nuiton/csv/ImportExportTest.java b/src/test/java/org/nuiton/csv/ImportExportTest.java index 5666c55..7f0016f 100644 --- a/src/test/java/org/nuiton/csv/ImportExportTest.java +++ b/src/test/java/org/nuiton/csv/ImportExportTest.java @@ -35,6 +35,8 @@ import java.io.Reader; import java.io.StringReader; import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Set; @@ -105,6 +107,33 @@ public class ImportExportTest { } + @Test + public void testExportImportDoubleQuotesString() throws Exception { + + RowBean one = new RowBean(new Date(), "Un singe en été", 24, RowBeanEnum.TWO); + one.setBooleans(Collections.singletonList(true)); + RowBean two = new RowBean(new Date(), "\"Amazing\" spiderman", 42, RowBeanEnum.ZERO); + two.setBooleans(Collections.singletonList(false)); + + List<RowBean> rowBeans = Arrays.asList(one, two); + + String csv = Export.exportToString(importExportModel, rowBeans, CHARSET); + + // 1 header line + one line per RowBean instance + int expectedLineCount = 1 + rowBeans.size(); + // number of '\n' in csv + int actualLineCount = csv.split("\n").length; + Assert.assertEquals("exported CSV must have all lines", + expectedLineCount, actualLineCount); + + List<RowBean> imported = importContent(importExportModel, csv); + + // Compare titles only, we want to test double quotes + Assert.assertEquals(one.getTitle(), imported.get(0).getTitle()); + Assert.assertEquals(two.getTitle(), imported.get(1).getTitle()); + + } + protected List<RowBean> importContent(ImportModel<RowBean> model, String content) throws IOException { Reader reader = new StringReader(content); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm