TSK-1617: Fixed unit tests when creating db2 with prepare_db.bat script
This commit is contained in:
parent
74cd4eacd9
commit
2c5f97927b
|
@ -36,7 +36,7 @@ SET PROP_FILE=%HOMEPATH%\taskanaUnitTest.properties
|
||||||
ECHO jdbcUrl=jdbc:db2://localhost:5101/tskdb>> %PROP_FILE%
|
ECHO jdbcUrl=jdbc:db2://localhost:5101/tskdb>> %PROP_FILE%
|
||||||
ECHO dbUserName=db2inst1>> %PROP_FILE%
|
ECHO dbUserName=db2inst1>> %PROP_FILE%
|
||||||
ECHO dbPassword=db2inst1-pwd>> %PROP_FILE%
|
ECHO dbPassword=db2inst1-pwd>> %PROP_FILE%
|
||||||
ECHO schemaName=taskana>> %PROP_FILE%
|
ECHO schemaName=TASKANA>> %PROP_FILE%
|
||||||
ECHO ---
|
ECHO ---
|
||||||
GOTO MENU
|
GOTO MENU
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ function main() {
|
||||||
[[ -f "$propFile" ]] && rm "$propFile"
|
[[ -f "$propFile" ]] && rm "$propFile"
|
||||||
;;
|
;;
|
||||||
DB2_11_1)
|
DB2_11_1)
|
||||||
docker-compose -f $scriptDir/docker-compose.yml up -d $(mapDBToDockerComposeServiceName "$1")
|
docker-compose -f $scriptDir/docker-compose.yml up -d "$(mapDBToDockerComposeServiceName "$1")"
|
||||||
|
|
||||||
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
|
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
|
||||||
echo 'jdbcUrl=jdbc:db2://localhost:5101/tskdb' >> $propFile
|
echo 'jdbcUrl=jdbc:db2://localhost:5101/tskdb' >> $propFile
|
||||||
|
@ -62,7 +62,7 @@ function main() {
|
||||||
echo 'schemaName=TASKANA' >> $propFile
|
echo 'schemaName=TASKANA' >> $propFile
|
||||||
;;
|
;;
|
||||||
POSTGRES_10)
|
POSTGRES_10)
|
||||||
docker-compose -f $scriptDir/docker-compose.yml up -d $(mapDBToDockerComposeServiceName "$1")
|
docker-compose -f $scriptDir/docker-compose.yml up -d "$(mapDBToDockerComposeServiceName "$1")"
|
||||||
|
|
||||||
echo 'jdbcDriver=org.postgresql.Driver' > $propFile
|
echo 'jdbcDriver=org.postgresql.Driver' > $propFile
|
||||||
echo 'jdbcUrl=jdbc:postgresql://localhost:5102/postgres' >> $propFile
|
echo 'jdbcUrl=jdbc:postgresql://localhost:5102/postgres' >> $propFile
|
||||||
|
@ -71,7 +71,7 @@ function main() {
|
||||||
echo 'schemaName=taskana' >> $propFile
|
echo 'schemaName=taskana' >> $propFile
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
docker-compose -f $scriptDir/docker-compose.yml rm -f -s -v $(mapDBToDockerComposeServiceName "$2")
|
docker-compose -f $scriptDir/docker-compose.yml rm -f -s -v "$(mapDBToDockerComposeServiceName "$2")"
|
||||||
|
|
||||||
[[ -f "$propFile" ]] && rm "$propFile"
|
[[ -f "$propFile" ]] && rm "$propFile"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -48,13 +48,13 @@ public abstract class AbstractAccTest {
|
||||||
|
|
||||||
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
||||||
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
||||||
SampleDataGenerator sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, schemaName);
|
||||||
|
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(true);
|
||||||
|
SampleDataGenerator sampleDataGenerator =
|
||||||
|
new SampleDataGenerator(dataSource, taskanaEngineConfiguration.getSchemaName());
|
||||||
if (dropTables) {
|
if (dropTables) {
|
||||||
sampleDataGenerator.dropDb();
|
sampleDataGenerator.dropDb();
|
||||||
}
|
}
|
||||||
dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
|
||||||
taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, schemaName);
|
|
||||||
taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(true);
|
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
converter = taskanaEngine.getWorkingDaysToDaysConverter();
|
converter = taskanaEngine.getWorkingDaysToDaysConverter();
|
||||||
|
|
|
@ -60,8 +60,8 @@ public final class TaskanaEngineTestConfiguration {
|
||||||
*/
|
*/
|
||||||
public static String getSchemaName() {
|
public static String getSchemaName() {
|
||||||
if (schemaName == null) {
|
if (schemaName == null) {
|
||||||
String userHomeDirectroy = System.getProperty("user.home");
|
String userHomeDirectory = System.getProperty("user.home");
|
||||||
String propertiesFileName = userHomeDirectroy + "/taskanaUnitTest.properties";
|
String propertiesFileName = userHomeDirectory + "/taskanaUnitTest.properties";
|
||||||
File f = new File(propertiesFileName);
|
File f = new File(propertiesFileName);
|
||||||
if (f.exists() && !f.isDirectory()) {
|
if (f.exists() && !f.isDirectory()) {
|
||||||
schemaName = getSchemaNameFromPropertiesObject(propertiesFileName);
|
schemaName = getSchemaNameFromPropertiesObject(propertiesFileName);
|
||||||
|
|
Loading…
Reference in New Issue