This is an automated email from the git hooks/post-receive script. New commit to branch feature/1174-Import_EBP_Transactions in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 49a9e4543b9f0e5179c4838d225f854cb23ceaba Author: David Cossé <cosse@codelutin.com> Date: Thu Sep 8 13:38:54 2016 +0200 refs #1174 Correction sur affichage des résultats d'import dans le cas ou il n'y a pas eu d'erreur --- .../test/java/org/chorem/lima/business/ImportExportServiceTest.java | 3 ++- .../src/main/java/org/chorem/lima/ui/importexport/ImportExport.java | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java index dbaf7d5..e4e6a4d 100644 --- a/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java +++ b/lima-business/src/test/java/org/chorem/lima/business/ImportExportServiceTest.java @@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils; import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; import org.chorem.lima.business.exceptions.BeginAfterEndFiscalPeriodException; +import org.chorem.lima.business.exceptions.ImportEbpException; import org.chorem.lima.business.exceptions.ImportFileException; import org.chorem.lima.business.exceptions.LimaException; import org.chorem.lima.business.exceptions.MoreOneUnlockFiscalPeriodException; @@ -621,7 +622,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { } protected void importEBPData() throws IOException, ParseException, BeginAfterEndFiscalPeriodException, - NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException { + NotBeginNextDayOfLastFiscalPeriodException, MoreOneUnlockFiscalPeriodException, ImportEbpException { // create fiscal period (mandatory for import) FiscalPeriod fiscalPeriod = new FiscalPeriodImpl(); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java index 970d1b1..6ee3c74 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java @@ -395,7 +395,7 @@ public class ImportExport { Class fromSource = result.getFromSource(); message.append("Import "); message.append(getFromSourceMessage(fromSource)); - message.append(result.getAllExceptionsByLine().size() > 0 ? "Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n" : "Aucune erreur rencontrée\n"); + message.append(result.getAllExceptionsByLine().isEmpty() ? "Aucune erreur rencontrée\n" : "Des erreurs sont survenues lors de l'import, veuillez regarder le fichier de log pour plus de détails.\n"); message.append(t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); logErrorMessage(result, fromSource); @@ -420,7 +420,7 @@ public class ImportExport { protected void logErrorMessage(ImportResult result,Class fromSource) { Map<Integer, LimaException> exceptionsByLine = result.getAllExceptionsByLine(); - if (exceptionsByLine != null) { + if (!exceptionsByLine.isEmpty()) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("\n" + "Import " + getFromSourceMessage(fromSource)); errorMessage.append("\n" + t("lima.import.report", result.getNbCreated(), result.getNbIgnored(), result.getNbUpdated())); @@ -701,7 +701,7 @@ public class ImportExport { protected ImportExportResults processBackup(ImportResult result, String tmpDir, String determinant) { ImportExportResults results = null; InputStream entryBooksStream = null, transactionsStream = null, fiscalPeriodsStream = null, accountsStream = null, entriesStream = null, identityStream = null; - if (result.getAllExceptionsByLine() == null || result.getAllExceptionsByLine().isEmpty()) { + if (result.getAllExceptionsByLine().isEmpty()) { try { entryBooksStream = new FileInputStream(tmpDir + EntryBook.class.getSimpleName() + "-" + determinant + ".csv"); String entryBooksStreamString = IOUtils.toString(entryBooksStream); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.