This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit 0dd526f3afb3de583f0a75653bd9bb48ad7c257f Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 23 14:50:58 2016 +0100 refs #1314 [ISO] renommage de méthode --- .../java/org/chorem/lima/business/api/ExportService.java | 2 +- .../java/org/chorem/lima/business/ejb/ExportServiceImpl.java | 2 +- .../org/chorem/lima/business/ImportExportServiceTest.java | 12 +++++------- .../java/org/chorem/lima/ui/importexport/ImportExport.java | 3 +-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java b/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java index bebba6c..20bfa5d 100644 --- a/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java +++ b/lima-business-api/src/main/java/org/chorem/lima/business/api/ExportService.java @@ -54,7 +54,7 @@ public interface ExportService { ImportExportResults exportVatStatements(String charset); - ImportExportResults exportBackup(String charset); + ImportExportResults exportAll(String charset); //####################################### EBP ############################################## diff --git a/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java b/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java index 86859e2..ca0d7bb 100644 --- a/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java +++ b/lima-business/src/main/java/org/chorem/lima/business/ejb/ExportServiceImpl.java @@ -261,7 +261,7 @@ public class ExportServiceImpl extends AbstractLimaService implements ExportServ } @Override - public ImportExportResults exportBackup(String charset) { + public ImportExportResults exportAll(String charset) { ImportExportResults results = exportAccountsAsCSV(charset); results.pushExportResults(exportEntryBooksAsCSV(charset)); 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 4fbd06a..80e4d95 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 @@ -71,6 +71,8 @@ import java.util.zip.ZipOutputStream; */ public class ImportExportServiceTest extends AbstractLimaTest { + public static final String JAVA_IO_TMPDIR = System.getProperty("java.io.tmpdir")+"/"; + @Test public void testExportImportAccounts() throws Exception { initTestWithAccounts(); @@ -80,13 +82,11 @@ public class ImportExportServiceTest extends AbstractLimaTest { List<Account> accounts = accountService.getAllAccounts(); Assert.assertTrue(accountService.getAllAccounts().size() > 0); - // export accounts - String tmpDir = System.getProperty("java.io.tmpdir")+"/"; ImportExportResults export = exportService.exportAccountsAsCSV(Charset.defaultCharset().name()); InputStream stream = IOUtils.toInputStream(export.getExportResults().get(0).exportData); - FileOutputStream res = new FileOutputStream(tmpDir + "export-accounts.csv"); + FileOutputStream res = new FileOutputStream(JAVA_IO_TMPDIR + "export-accounts.csv"); IOUtils.copy(stream, res); // remove accounts @@ -99,7 +99,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { // import accounts InputStream contentStream = null; try { - contentStream = new FileInputStream(tmpDir + "export-accounts.csv"); + contentStream = new FileInputStream(JAVA_IO_TMPDIR + "export-accounts.csv"); String inportStream = IOUtils.toString(contentStream); ImportExportResults result = importService.importAccountAsCSV(inportStream); @@ -267,7 +267,7 @@ public class ImportExportServiceTest extends AbstractLimaTest { identity.setCity("Saint-Sébastien-sur-Loire"); identityService.updateIdentity(identity); - ImportExportResults export = exportService.exportBackup(Charset.defaultCharset().name()); + ImportExportResults export = exportService.exportAll(Charset.defaultCharset().name()); String tmpDir = System.getProperty("java.io.tmpdir")+"/TMP_BACKUP.zip"; createZipFile(export, tmpDir); @@ -289,8 +289,6 @@ public class ImportExportServiceTest extends AbstractLimaTest { } } - public static final String JAVA_IO_TMPDIR = System.getProperty("java.io.tmpdir")+"/"; - protected ImportExportResults createZipFile(ImportExportResults streamData, String path){ ZipOutputStream export = null; 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 6ee3c74..3c61f72 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 @@ -276,7 +276,7 @@ public class ImportExport { createFile(exportFilePath, defaultCharset.name(), results.getExportResults().get(0).getExportData()); break; case CSV_ALL_EXPORT: - results = exportBackup(exportFilePath, defaultCharset.name()); + results = exportAll(exportFilePath, defaultCharset.name()); break; case CSV_ALL_IMPORT: results = importAllFromZipFile(importURL); @@ -501,7 +501,6 @@ public class ImportExport { return message; } - /** * open choose file dialog with appropriate file mode view * folders for export or folders+files for import -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.