Skip to content

Commit a48e335

Browse files
committed
New attribute which allow to disable the deletion of tmp dataset
1 parent 92ea2ae commit a48e335

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>testing-toolbox-core</artifactId>
77
<name>testing-toolbox-core</name>
88
<description>Units and integration tests libs</description>
9-
<version>1.0.1</version>
9+
<version>1.0.2</version>
1010
<packaging>jar</packaging>
1111

1212
<properties>

src/main/java/org/testing/toolbox/DatabaseTest.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public abstract class DatabaseTest extends IntegrationTest {
5959
protected static final DatabaseOperation DEFAULT_OPERATION = DatabaseOperation.INSERT;
6060
protected final String PURGE_DS = getTestCommonDataDir() + "schema_purge_ds.xml";
6161
protected final String SCHEMA = "public";
62+
protected Boolean disableDeleteTmpDataSet = false;
6263

6364
@Inject
6465
private DataSource dataSource;
@@ -438,7 +439,9 @@ public void assertOccrurrenceDataSet(String schema, List<String> tables, List<Ex
438439
assertEquals("Problème avec le nombre d'occurrence de " + line.buildXpath(), nbOccurence, getNbOccurrenceFromXpath(nameOfXML, line.buildXpath()));
439440
}
440441

441-
deleteFileQuietly(getAbsolutePath(getTestDataDir() + nameOfXML));
442+
if (null == disableDeleteTmpDataSet || !disableDeleteTmpDataSet) {
443+
deleteFileQuietly(getAbsolutePath(getTestDataDir() + nameOfXML));
444+
}
442445
}
443446

444447
/**
@@ -524,4 +527,19 @@ public void assertNotContainDataSet(String schema, String tableName, ExpectedLin
524527

525528
assertNotContainDataSet(schema, tables, lstLines);
526529
}
530+
531+
/**
532+
* @return the disableDeleteTmpDataSet
533+
*/
534+
public Boolean getDisableDeleteTmpDataSet() {
535+
return disableDeleteTmpDataSet;
536+
}
537+
538+
/**
539+
* @param disableDeleteTmpDataSet
540+
* the disableDeleteTmpDataSet to set
541+
*/
542+
public void setDisableDeleteTmpDataSet(Boolean disableDeleteTmpDataSet) {
543+
this.disableDeleteTmpDataSet = disableDeleteTmpDataSet;
544+
}
527545
}

0 commit comments

Comments
 (0)