From 2a952679445f1ba92722e839d37fab46f9144e95 Mon Sep 17 00:00:00 2001 From: Stefan Ziegler Date: Thu, 12 Dec 2024 15:04:57 +0100 Subject: [PATCH] refactor executeTestRunner Method to avoid having a mandatory taskName param (#209) --- .../java/ch/so/agi/gretl/jobs/Av2chTest.java | 6 +++--- .../ch/so/agi/gretl/jobs/Av2geobauTest.java | 4 ++-- .../ch/so/agi/gretl/jobs/Csv2ExcelTest.java | 2 +- .../ch/so/agi/gretl/jobs/CsvExportTest.java | 2 +- .../ch/so/agi/gretl/jobs/CsvImportTest.java | 4 ++-- .../so/agi/gretl/jobs/CsvValidatorTest.java | 4 ++-- .../java/ch/so/agi/gretl/jobs/CurlTest.java | 8 ++++---- .../jobs/DatabaseDocumentExportTest.java | 2 +- .../ch/so/agi/gretl/jobs/Db2DbTaskTest.java | 12 ++++++------ .../agi/gretl/jobs/DbDriverContainedTest.java | 7 +++++-- .../ch/so/agi/gretl/jobs/Gpkg2DxfTest.java | 2 +- .../ch/so/agi/gretl/jobs/Gpkg2ShpTest.java | 2 +- .../ch/so/agi/gretl/jobs/GpkgExportTest.java | 4 ++-- .../ch/so/agi/gretl/jobs/GpkgImportTest.java | 2 +- .../so/agi/gretl/jobs/GpkgValidatorTest.java | 4 ++-- .../java/ch/so/agi/gretl/jobs/GzipTest.java | 2 +- .../so/agi/gretl/jobs/Ili2gpkgImportTest.java | 4 ++-- .../gretl/jobs/Ili2pgDeleteDatasetsTest.java | 2 +- .../so/agi/gretl/jobs/Ili2pgDeleteTest.java | 2 +- .../gretl/jobs/Ili2pgExportDatasetsTest.java | 2 +- .../gretl/jobs/Ili2pgImportFileSetTest.java | 2 +- .../gretl/jobs/Ili2pgImportSchemaTest.java | 4 ++-- .../agi/gretl/jobs/Ili2pgReplaceFileTest.java | 4 ++-- .../gretl/jobs/Ili2pgValidateDatasetTest.java | 6 +++--- .../so/agi/gretl/jobs/Ili2pgValidateTest.java | 4 ++-- .../so/agi/gretl/jobs/IliValidatorTest.java | 8 ++++---- .../ch/so/agi/gretl/jobs/JsonImportTest.java | 4 ++-- .../gretl/jobs/PostgisRasterExportTest.java | 4 ++-- .../ch/so/agi/gretl/jobs/PublisherTest.java | 4 ++-- .../agi/gretl/jobs/S3Bucket2BucketTest.java | 2 +- .../ch/so/agi/gretl/jobs/S3DownloadTest.java | 2 +- .../ch/so/agi/gretl/jobs/S3UploadTest.java | 8 ++++---- .../ch/so/agi/gretl/jobs/ShpExportTest.java | 2 +- .../ch/so/agi/gretl/jobs/ShpImportTest.java | 2 +- .../so/agi/gretl/jobs/ShpValidatorTest.java | 4 ++-- .../gretl/jobs/SqlExecutorTaskDuckDbTest.java | 2 +- .../agi/gretl/jobs/SqlExecutorTaskTest.java | 8 ++++---- .../so/agi/gretl/jobs/XslTransformerTest.java | 6 +++--- .../agi/gretl/util/IntegrationTestUtil.java | 19 +++++++++++++------ 39 files changed, 91 insertions(+), 81 deletions(-) diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2chTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2chTest.java index 906d3e6d..3e986083 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2chTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2chTest.java @@ -13,7 +13,7 @@ public class Av2chTest { @Test public void transformation_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Av2ch"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); File resultFile = new File(projectDirectory + "/output/254900.itf"); @@ -31,7 +31,7 @@ public void transformation_Ok() throws Exception { public void transformationFileSet_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Av2chFileSet"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); File resultFile1 = new File("src/integrationTest/jobs/Av2chFileSet/output/252400.itf"); File resultFile2 = new File("src/integrationTest/jobs/Av2chFileSet/output/254900.itf"); @@ -45,7 +45,7 @@ public void transformation_Fail() { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Av2chFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); } } diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2geobauTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2geobauTest.java index 8f4e7e77..ec1d9030 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2geobauTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Av2geobauTest.java @@ -12,7 +12,7 @@ public class Av2geobauTest { public void simple() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Av2geobau"); cleanUpFiles(projectDirectory); - IntegrationTestUtil.executeTestRunner(projectDirectory, "av2geobau"); + IntegrationTestUtil.executeTestRunner(projectDirectory); File resultFile = new File(projectDirectory + "/empty.dxf"); assertTrue(resultFile.exists()); @@ -22,7 +22,7 @@ public void fileSet() throws Exception { File projectDir = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Av2geobauFileSet"); cleanUpFiles(projectDir); - IntegrationTestUtil.executeTestRunner(projectDir, "av2geobau"); + IntegrationTestUtil.executeTestRunner(projectDir); File resultFile1 = new File(projectDir + "/empty1.dxf"); File resultFile2 = new File(projectDir + "/empty2.dxf"); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Csv2ExcelTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Csv2ExcelTest.java index 14e5d11c..4bfc6d3e 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Csv2ExcelTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Csv2ExcelTest.java @@ -17,7 +17,7 @@ public class Csv2ExcelTest { public void convertCsv_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Csv2Excel"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "convertData"); + IntegrationTestUtil.executeTestRunner(projectDirectory); FileInputStream fis = new FileInputStream(projectDirectory.getAbsolutePath() + "/20230124_sap_Gebaeude.xlsx"); XSSFWorkbook workbook = new XSSFWorkbook(fis); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvExportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvExportTest.java index 39ca1b51..a43f1ec1 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvExportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvExportTest.java @@ -34,7 +34,7 @@ public void exportOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CsvExport"); GradleVariable[] gradleVariables = { GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl()) }; - IntegrationTestUtil.executeTestRunner(projectDirectory, "csvexport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); System.out.println("cwd " + new File(".").getAbsolutePath()); java.io.LineNumberReader reader = new java.io.LineNumberReader(new java.io.InputStreamReader(new java.io.FileInputStream(new File("src/integrationTest/jobs/CsvExport/data.csv")))); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvImportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvImportTest.java index 608543b2..8264bcb7 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvImportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvImportTest.java @@ -44,7 +44,7 @@ public void importOk() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CsvImport"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "csvimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres); Statement s2 = con.createStatement(); @@ -80,7 +80,7 @@ public void importOk_batchSize() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CsvImportBatchSize"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "csvimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres); Statement s2 = con.createStatement(); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvValidatorTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvValidatorTest.java index 98c6cab6..be8d5f6b 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvValidatorTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CsvValidatorTest.java @@ -12,14 +12,14 @@ public class CsvValidatorTest { public void validationOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CsvValidator"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test public void validationFail() { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CsvValidatorFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); } } diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CurlTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CurlTest.java index 02338b0a..8b097ccd 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CurlTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/CurlTest.java @@ -45,7 +45,7 @@ public void geodienste_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CurlGeodienste"); GradleVariable[] variables = { GradleVariable.newGradleProperty("mockWebServerPort", String.valueOf(mockWebServer.getPort())) }; - IntegrationTestUtil.executeTestRunner(projectDirectory, "uploadData", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Validate result RecordedRequest recordedRequest = mockWebServer.takeRequest(); @@ -74,7 +74,7 @@ public void geodienste_Fail() throws Exception { GradleVariable[] variables = { GradleVariable.newGradleProperty("mockWebServerPort", String.valueOf(mockWebServer.getPort())) }; assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "uploadData", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); }); } @@ -88,7 +88,7 @@ public void planregister_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CurlPlanregister"); GradleVariable[] variables = { GradleVariable.newGradleProperty("mockWebServerPort", String.valueOf(mockWebServer.getPort())) }; - IntegrationTestUtil.executeTestRunner(projectDirectory, "uploadData", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Validate result RecordedRequest recordedRequest = mockWebServer.takeRequest(); @@ -102,7 +102,7 @@ public void planregister_Ok() throws Exception { public void downloadFile_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/CurlDownload"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "downloadData"); + IntegrationTestUtil.executeTestRunner(projectDirectory); String content = new String(Files.readAllBytes(Paths.get(projectDirectory + "/README.md"))); assertTrue(content.contains("_GRETL_")); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DatabaseDocumentExportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DatabaseDocumentExportTest.java index 9349e925..24456194 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DatabaseDocumentExportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DatabaseDocumentExportTest.java @@ -34,7 +34,7 @@ public void exportOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/DatabaseDocumentExport"); GradleVariable[] variables = { GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl()) }; - IntegrationTestUtil.executeTestRunner(projectDirectory, "databasedocumentexport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); } diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Db2DbTaskTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Db2DbTaskTest.java index 1b7c7217..0598aea7 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Db2DbTaskTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Db2DbTaskTest.java @@ -65,7 +65,7 @@ public void fetchSizeParameterTest() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbTaskFetchSize"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "fetchSizeTask", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.target_data", schemaName); @@ -95,7 +95,7 @@ public void taskChainTest() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbTaskChain"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "bToA", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.albums_dest", schemaName); @@ -124,7 +124,7 @@ public void relativePathTest() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbTaskRelPath"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "relativePath", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.albums_dest", schemaName); @@ -153,7 +153,7 @@ public void deleteDestTableContent() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbTaskDelTable"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "sourceToDestWithDelete", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.albums_dest", schemaName); @@ -181,7 +181,7 @@ public void parameter() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbParameter"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "src2dest", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.dest", schemaName); @@ -211,7 +211,7 @@ public void parameterList() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Db2DbParameterList"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "src2dest", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try (Connection con = IntegrationTestUtilSql.connectPG(postgres)) { String countDestSql = String.format("SELECT COUNT(*) FROM %s.dest", schemaName); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DbDriverContainedTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DbDriverContainedTest.java index a2f73a63..741f7087 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DbDriverContainedTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/DbDriverContainedTest.java @@ -4,6 +4,8 @@ import ch.so.agi.gretl.util.GradleVariable; import ch.so.agi.gretl.util.IntegrationTestUtil; import ch.so.agi.gretl.util.IntegrationTestUtilSql; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.testcontainers.containers.OracleContainer; @@ -12,6 +14,7 @@ import java.io.File; +@Disabled @Testcontainers public class DbDriverContainedTest { @@ -23,7 +26,7 @@ public class DbDriverContainedTest { @Tag(TestTags.DB_DRIVERS_REACHABLE_TEST) public void SqliteDriverContainedTest() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/DbTasks_SqliteLibsPresent"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "querySqliteMaster"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test @@ -32,6 +35,6 @@ public void OracleDriverContainedTest() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/DbTasks_OracleLibsPresent"); GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_ORA_CON_URI, oracle.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "queryOracleVersion", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); } } \ No newline at end of file diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2DxfTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2DxfTest.java index 62094c60..e4b53b24 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2DxfTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2DxfTest.java @@ -47,7 +47,7 @@ public void export_Ok() throws Exception { }); } - IntegrationTestUtil.executeTestRunner(projectDirectory, "gpkg2dxf"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check results for (String dxfFile : dxfFiles) { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2ShpTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2ShpTest.java index aa278622..bd926f5f 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2ShpTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Gpkg2ShpTest.java @@ -48,7 +48,7 @@ public void export_Ok() throws Exception { }); } - IntegrationTestUtil.executeTestRunner(projectDirectory, "gpkg2shp"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check results { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgExportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgExportTest.java index c72bb36f..a4ec18cf 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgExportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgExportTest.java @@ -56,7 +56,7 @@ public void exportTableOk() throws Exception { con.commit(); } - IntegrationTestUtil.executeTestRunner(projectDirectory, "gpkgexport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check results try ( @@ -96,7 +96,7 @@ public void exportTablesOk() throws Exception { IntegrationTestUtilSql.closeCon(con); } - IntegrationTestUtil.executeTestRunner(projectDirectory, "gpkgexport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check results for (int i = 1; i <= 2; i++) { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgImportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgImportTest.java index 2cb6293e..142fd036 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgImportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgImportTest.java @@ -50,7 +50,7 @@ public void importOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/GpkgImport"); GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "gpkgimport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Reconnect to check results try (Connection con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgValidatorTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgValidatorTest.java index 18a79378..3c95b9c2 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgValidatorTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GpkgValidatorTest.java @@ -12,14 +12,14 @@ public class GpkgValidatorTest { public void validationOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/GpkgValidator"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test public void validationFail() { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/GpkgValidatorFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); } } diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GzipTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GzipTest.java index 50a501d5..5c9d3566 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GzipTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/GzipTest.java @@ -29,7 +29,7 @@ public GzipTest() { @Test public void compress_file_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Gzip"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "compressFile"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Validate result File gzipFile = new File("src/integrationTest/jobs/Gzip/planregister.xml.gz"); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2gpkgImportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2gpkgImportTest.java index 36521f71..11e3f667 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2gpkgImportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2gpkgImportTest.java @@ -32,7 +32,7 @@ public void importOk() throws Exception { Files.deleteIfExists(Paths.get(projectDirectory + "/ch.so.agi.av_gb_admin_einteilung_edit_2020-08-20.gpkg")); - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2gpkgimport"); + IntegrationTestUtil.executeTestRunner(projectDirectory); String url = "jdbc:sqlite:" + @@ -71,7 +71,7 @@ public void importFileSet() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2gpkgImportFileSet"); Files.deleteIfExists(Paths.get(projectDirectory + "/Beispiel2.gpkg")); - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2gpkgimport"); + IntegrationTestUtil.executeTestRunner(projectDirectory); String url = "jdbc:sqlite:" + new File(projectDirectory + "/Beispiel2.gpkg").getAbsolutePath(); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteDatasetsTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteDatasetsTest.java index cf4f0d0b..69397d46 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteDatasetsTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteDatasetsTest.java @@ -40,7 +40,7 @@ public void deleteOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgdelete", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); try ( Connection con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteTest.java index 6ec2019c..e6b5050f 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgDeleteTest.java @@ -37,7 +37,7 @@ public void deleteDataset_Ok() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgdelete", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); try ( Connection con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgExportDatasetsTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgExportDatasetsTest.java index 91597a37..800bdfdf 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgExportDatasetsTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgExportDatasetsTest.java @@ -35,7 +35,7 @@ public void exportOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgexport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // check results { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportFileSetTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportFileSetTest.java index 7895c455..488b20b0 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportFileSetTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportFileSetTest.java @@ -40,7 +40,7 @@ public void importOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgimport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Check results try ( diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportSchemaTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportSchemaTest.java index b49c23f0..7e150d52 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportSchemaTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgImportSchemaTest.java @@ -37,7 +37,7 @@ public void schemaImportOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgschemaimport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Check results try ( @@ -76,7 +76,7 @@ public void schemaImport_Options1_Ok() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgschemaimport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); // Check results try ( diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgReplaceFileTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgReplaceFileTest.java index efa0b5b2..8b32871e 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgReplaceFileTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgReplaceFileTest.java @@ -37,7 +37,7 @@ public class Ili2pgReplaceFileTest { @Test public void importLocalFile_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgReplaceFile"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try ( Connection con = IntegrationTestUtilSql.connectPG(postgres); @@ -67,7 +67,7 @@ public void importLocalFile_Ok() throws Exception { @Test public void importIlidataFile_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgReplaceIlidataFile"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "ili2pgimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); try ( Connection con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateDatasetTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateDatasetTest.java index 65bb3b28..69a6a4f7 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateDatasetTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateDatasetTest.java @@ -32,7 +32,7 @@ public class Ili2pgValidateDatasetTest { @Test public void validateSingleDataset_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgValidateSingleDataset"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateSingleDataset/validation.log"))); @@ -42,7 +42,7 @@ public void validateSingleDataset_Ok() throws Exception { @Test public void validateMultipleDataset_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgValidateMultipleDatasets"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateMultipleDatasets/validation.log"))); @@ -54,7 +54,7 @@ public void validateData_Fail() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgValidateDatasetFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); }); String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateDatasetFail/validation.log"))); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateTest.java index f36c5cd6..f177ef40 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/Ili2pgValidateTest.java @@ -33,7 +33,7 @@ public class Ili2pgValidateTest { @Test public void validateData_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgValidate"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidate/fubar.log"))); assertTrue(logFileContent.contains("Info: ...validate done")); @@ -44,7 +44,7 @@ public void validateData_Fail() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/Ili2pgValidateFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); }); String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateFail/fubar.log"))); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/IliValidatorTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/IliValidatorTest.java index c58a1618..19aea97b 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/IliValidatorTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/IliValidatorTest.java @@ -15,12 +15,12 @@ public class IliValidatorTest { @Test public void validationOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/IliValidator"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test public void validationFileSetOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/IliValidatorFileSet"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test @@ -28,7 +28,7 @@ public void validationFail() { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/IliValidatorFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); } @@ -38,7 +38,7 @@ public void validateFail_Ngk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/IliValidatorNgk"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); // Check result diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/JsonImportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/JsonImportTest.java index a7b1f293..0fefd746 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/JsonImportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/JsonImportTest.java @@ -52,7 +52,7 @@ public void importJsonObject_Ok() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/JsonImportObject"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "jsonimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Reconnect to check results try ( @@ -104,7 +104,7 @@ public void importJsonArray_Ok() throws Exception { } File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/JsonImportArray"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "jsonimport", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Reconnect to check results try ( diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PostgisRasterExportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PostgisRasterExportTest.java index 96b00740..8acaab4e 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PostgisRasterExportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PostgisRasterExportTest.java @@ -38,7 +38,7 @@ public void exportTiff() throws Exception { File file = new File(projectDirectory, exportFileName); Files.deleteIfExists(file.toPath()); - IntegrationTestUtil.executeTestRunner(projectDirectory, "exportTiff", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); long targetFileSize = new File(projectDirectory, targetFileName).length(); long exportFileSize = new File(projectDirectory, exportFileName).length(); @@ -57,7 +57,7 @@ public void exportGeoTiff() throws Exception { File file = new File(projectDirectory, exportFileName); Files.deleteIfExists(file.toPath()); - IntegrationTestUtil.executeTestRunner(projectDirectory, "exportGeotiff", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); long targetFileSize = new File(projectDirectory, targetFileName).length(); long exportFileSize = new File(projectDirectory, exportFileName).length(); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PublisherTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PublisherTest.java index 0b8c099a..6e771c26 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PublisherTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/PublisherTest.java @@ -17,7 +17,7 @@ public void simple() throws Exception { copyFileFromResourcesToJob(projectDirectory.getPath(), "files", "av_test.itf"); copyFileFromResourcesToJob(projectDirectory.getPath(), "ili", "DM.01-AV-CH_LV95_24d_ili1.ili"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "publishFile"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test @@ -28,7 +28,7 @@ public void regions() throws Exception { copyFileFromResourcesToJob(projectDirectory.getPath(), "files", "2502.itf"); copyFileFromResourcesToJob(projectDirectory.getPath(), "ili", "DM.01-AV-CH_LV95_24d_ili1.ili"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "printPublishedRegions"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } private void copyFileFromResourcesToJob(String jobDirectory, String resourceSubDirectory, String filename) throws IOException { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3Bucket2BucketTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3Bucket2BucketTest.java index 770a2f72..59c02886 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3Bucket2BucketTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3Bucket2BucketTest.java @@ -89,7 +89,7 @@ void uploadDirectory_Ok() throws Exception { // Execute File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/S3Bucket2Bucket"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "copyfiles", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result. ListObjectsRequest listObjects = ListObjectsRequest diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3DownloadTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3DownloadTest.java index 1f5f039b..0b0f241e 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3DownloadTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3DownloadTest.java @@ -72,7 +72,7 @@ void downloadFile_Ok() throws Exception { // Execute File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/S3DownloadFile"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "filedownload", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result. S3Client s3client = s3TestHelper.getS3Client(); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3UploadTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3UploadTest.java index 74dc1915..45bc18e5 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3UploadTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/S3UploadTest.java @@ -68,7 +68,7 @@ void uploadDirectory_Ok() throws Exception { // Execute File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/S3UploadDirectory"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "directoryupload", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result. ListObjectsRequest listObjects = ListObjectsRequest @@ -101,7 +101,7 @@ void uploadFileTree_Ok() throws Exception { // Execute File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/S3UploadFileTree"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "filetreeupload", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result ListObjectsRequest listObjects = ListObjectsRequest @@ -134,7 +134,7 @@ void uploadFile_Ok() throws Exception { // Execute File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/S3UploadFile"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "fileupload", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); // Check result. GetObjectRequest getObjectRequest = GetObjectRequest.builder() @@ -166,7 +166,7 @@ void uploadFile_Fail() throws Exception { // Execute assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "fileupload", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); }); } } \ No newline at end of file diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpExportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpExportTest.java index 8467771c..7e7831e6 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpExportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpExportTest.java @@ -57,7 +57,7 @@ public void exportOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "shpexport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); //check results { diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpImportTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpImportTest.java index b525aab7..484afdf1 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpImportTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpImportTest.java @@ -49,7 +49,7 @@ public void importOk() throws Exception { GradleVariable[] variables = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())}; - IntegrationTestUtil.executeTestRunner(projectDirectory, "shpimport", variables); + IntegrationTestUtil.executeTestRunner(projectDirectory, variables); //reconnect to check results con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpValidatorTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpValidatorTest.java index 992c002f..0b091616 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpValidatorTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/ShpValidatorTest.java @@ -12,7 +12,7 @@ public class ShpValidatorTest { public void validationOk() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/ShpValidator"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); } @Test @@ -20,7 +20,7 @@ public void validationFail() { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/ShpValidatorFail"); assertThrows(Throwable.class, () -> { - IntegrationTestUtil.executeTestRunner(projectDirectory, "validate"); + IntegrationTestUtil.executeTestRunner(projectDirectory); }); } } diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskDuckDbTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskDuckDbTest.java index 87772547..6167fb30 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskDuckDbTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskDuckDbTest.java @@ -29,7 +29,7 @@ public void multipleStuff_Ok() throws Exception { Files.delete(pathToDatabase); } - IntegrationTestUtil.executeTestRunner(projectDirectory, "importParquet"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check result // Vor allem die Parquet- und GPKG-Imports werden bereits im SQL geprüft: diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskTest.java index c828bb4c..eb5196c5 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/SqlExecutorTaskTest.java @@ -51,7 +51,7 @@ public void taskChainTest() throws Exception { IntegrationTestUtilSql.closeCon(con); File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/SqlExecutorTaskChain"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "insertInto", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); //reconnect to check results con = IntegrationTestUtilSql.connectPG(postgres); @@ -88,7 +88,7 @@ public void relPathTest() throws Exception { IntegrationTestUtilSql.closeCon(con); File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/SqlExecutorTaskRelPath"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "relativePathConfiguration", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); } finally { IntegrationTestUtilSql.closeCon(con); @@ -110,7 +110,7 @@ public void parameter() throws Exception{ IntegrationTestUtilSql.closeCon(con); File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/SqlExecutorTaskParameter"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "insertInto", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); //reconnect to check results con = IntegrationTestUtilSql.connectPG(postgres); @@ -146,7 +146,7 @@ public void parameterList() throws Exception{ File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/SqlExecutorTaskParameterList"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "insertInto", gradleVariables); + IntegrationTestUtil.executeTestRunner(projectDirectory, gradleVariables); //reconnect to check results con = IntegrationTestUtilSql.connectPG(postgres); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/XslTransformerTest.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/XslTransformerTest.java index 5c021178..c6555c2b 100644 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/XslTransformerTest.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/jobs/XslTransformerTest.java @@ -16,7 +16,7 @@ public class XslTransformerTest { public void transformFile_Resource_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/XslTransformerResource"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check result byte[] bytes = Files.readAllBytes(Paths.get("src/integrationTest/jobs/XslTransformerResource", "MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf")); @@ -31,7 +31,7 @@ public void transformFile_Resource_Ok() throws Exception { public void transformFile_File_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/XslTransformerFile"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check result byte[] bytes = Files.readAllBytes(Paths.get("src/integrationTest/jobs/XslTransformerFile", "MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf")); @@ -46,7 +46,7 @@ public void transformFile_File_Ok() throws Exception { public void transformFileSet_Ok() throws Exception { File projectDirectory = new File(System.getProperty("user.dir") + "/src/integrationTest/jobs/XslTransformerFileSet"); - IntegrationTestUtil.executeTestRunner(projectDirectory, "transform"); + IntegrationTestUtil.executeTestRunner(projectDirectory); // Check result assertTrue(new File("src/integrationTest/jobs/XslTransformerFileSet/MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf").exists()); diff --git a/gretl/src/integrationTest/java/ch/so/agi/gretl/util/IntegrationTestUtil.java b/gretl/src/integrationTest/java/ch/so/agi/gretl/util/IntegrationTestUtil.java index 0c274747..2000d660 100755 --- a/gretl/src/integrationTest/java/ch/so/agi/gretl/util/IntegrationTestUtil.java +++ b/gretl/src/integrationTest/java/ch/so/agi/gretl/util/IntegrationTestUtil.java @@ -26,11 +26,15 @@ public class IntegrationTestUtil { private static final String GRETL_PROJECT_ABSOLUTE_PATH = System.getProperty("GRETL_PROJECT_ABS_PATH"); private static final String ROOT_PROJECT_ABSOLUTE_PATH = System.getProperty("ROOT_PROJECT_ABS_PATH"); - public static void executeTestRunner(File projectDirectory, String taskName) throws IOException { - executeTestRunner(projectDirectory, taskName, null); + public static void executeTestRunner(File projectDirectory) throws IOException { + executeTestRunner(projectDirectory, null, null); } - public static void executeTestRunner(File projectDirectory, String taskName, GradleVariable[] variables) throws IOException { + public static void executeTestRunner(File projectDirectory, GradleVariable[] variables) throws IOException { + executeTestRunner(projectDirectory, variables, null); + } + + public static void executeTestRunner(File projectDirectory, GradleVariable[] variables, String taskName) throws IOException { if (TestType.IMAGE.equals(TEST_TYPE)) { executeDockerRunCommand(projectDirectory, variables); } else if(TestType.JAR.equals(TEST_TYPE)) { @@ -46,7 +50,7 @@ private static void executeGradleRunner(File projectDirectory, String taskName, .withProjectDir(projectDirectory) .withArguments(arguments) .forwardOutput().build(); - TaskOutcome outcome = Objects.requireNonNull(result.task(":" + taskName)).getOutcome(); + //TaskOutcome outcome = Objects.requireNonNull(result.task(":" + taskName)).getOutcome(); } private static void executeDockerRunCommand(File projectDirectory, GradleVariable[] variables) { @@ -105,9 +109,12 @@ private static List getRunnerArguments(String taskName, GradleVariable[] List arguments = new ArrayList<>(); arguments.add("--init-script"); arguments.add(IntegrationTestUtil.getPathToInitScript()); - arguments.add(taskName); + if (taskName != null) { + arguments.add(taskName); + } + arguments.add("--rerun-tasks"); arguments.add("-i"); - if(variables != null){ + if (variables != null) { for(GradleVariable variable: variables){ arguments.add(variable.buildOptionString()); }