Skip to content

Commit

Permalink
[Ili2pgValidate] Add another integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
webrian committed Mar 13, 2024
1 parent 67c550d commit 9d39097
Show file tree
Hide file tree
Showing 11 changed files with 737 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,24 @@ public class Ili2pgValidateDatasetTest {
.waitingFor(Wait.forLogMessage(WAIT_PATTERN, 2));

@Test
public void validateData_Ok() throws Exception {
public void validateSingleDataset_Ok() throws Exception {
// Run task
GradleVariable[] gvs = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())};
IntegrationTestUtil.runJob("src/integrationTest/jobs/Ili2pgValidateDataset", gvs);
IntegrationTestUtil.runJob("src/integrationTest/jobs/Ili2pgValidateSingleDataset", gvs);

// Check result
String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateDataset/validation.log")));
String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateSingleDataset/validation.log")));
assertTrue(logFileContent.contains("Info: ...validate done"));
}

@Test
public void validateMultipleDataset_Ok() throws Exception {
// Run task
GradleVariable[] gvs = {GradleVariable.newGradleProperty(IntegrationTestUtilSql.VARNAME_PG_CON_URI, postgres.getJdbcUrl())};
IntegrationTestUtil.runJob("src/integrationTest/jobs/Ili2pgValidateMultipleDatasets", gvs);

// Check result
String logFileContent = new String(Files.readAllBytes(Paths.get("src/integrationTest/jobs/Ili2pgValidateMultipleDatasets/validation.log")));
assertTrue(logFileContent.contains("Info: ...validate done"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def db_uri = findProperty(GRETLTEST_DBURI) != null ? findProperty(GRETLTEST_DBUR

def db_user = "ddluser"
def db_pass = "ddluser"
def db_schema = "afu_schutzbauten_v1"
def db_schema = "afu_schutzbauten_v1_multi"

defaultTasks 'validate'

Expand Down Expand Up @@ -57,6 +57,7 @@ tasks.register('validate', Ili2pgValidate) {
database = [db_uri, db_user, db_pass]
modeldir = rootProject.projectDir.toString() + ";http://models.interlis.ch"
dbschema = db_schema
// Prüfe mit einer Liste von Datasets
dataset = ["agi.testeinzelobjekt1", "agi.testeinzelobjekt2"]
logFile = file("validation.log")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
Loading

0 comments on commit 9d39097

Please sign in to comment.