Merge remote-tracking branch 'refs/remotes/origin/master'
Conflicts: history/taskana-simplehistory-rest-spring/src/main/java/pro/taskana/simplehistory/rest/TaskHistoryEventController.java rest/taskana-rest-spring-example-wildfly/src/test/java/pro/taskana/AbstractAccTest.java
This commit is contained in:
commit
850ad5f724
|
|
@ -126,7 +126,9 @@ jobs:
|
||||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||||
# travis_terminate is necessary since after_success is a job phase which can change the build result.
|
# travis_terminate is necessary since after_success is a job phase which can change the build result.
|
||||||
# it is not documented, so this is a little hack. see: https://docs.travis-ci.com/user/job-lifecycle/#breaking-the-build
|
# it is not documented, so this is a little hack. see: https://docs.travis-ci.com/user/job-lifecycle/#breaking-the-build
|
||||||
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh || travis_terminate 1
|
after_success: ci/change_version.sh -i -m .
|
||||||
|
&& ci/update_taskana_dependency_for_wildfly.sh
|
||||||
|
&& ci/commitPoms.sh || travis_terminate 1
|
||||||
deploy:
|
deploy:
|
||||||
provider: cloudfoundry
|
provider: cloudfoundry
|
||||||
username: $BLUEMIX_ACCOUNT
|
username: $BLUEMIX_ACCOUNT
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
set -e #fail fast
|
set -e #fail fast
|
||||||
|
|
||||||
#H Usage:
|
#H Usage:
|
||||||
#H change_version.sh -h | change_version.sh --help
|
#H %FILE% -h | %FILE% --help
|
||||||
#H
|
#H
|
||||||
#H prints this help and exits
|
#H prints this help and exits
|
||||||
#H
|
#H
|
||||||
#H change_version.sh <-m modules...> [-i]
|
#H %FILE% <-m modules...> [-i]
|
||||||
#H
|
#H
|
||||||
#H if a release version exists (extracted from TRAVIS_TAG)
|
#H if a release version exists (extracted from TRAVIS_TAG)
|
||||||
#H the maven versions of all modules will be changed to the given release version.
|
#H the maven versions of all modules will be changed to the given release version.
|
||||||
|
|
@ -23,7 +23,7 @@ set -e #fail fast
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit() {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g"
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
set -e # fail fast
|
set -e # fail fast
|
||||||
|
|
||||||
#H Usage:
|
#H Usage:
|
||||||
#H commitPoms.sh -h | commitPoms.sh --help
|
#H %FILE% -h | %FILE% --help
|
||||||
#H
|
#H
|
||||||
#H prints this help and exits
|
#H prints this help and exits
|
||||||
#H
|
#H
|
||||||
#H commitPoms.sh [additional files...]
|
#H %FILE% [additional files...]
|
||||||
#H
|
#H
|
||||||
#H commits and pushes all *.pom files (+ additional files)
|
#H commits and pushes all *.pom files (+ additional files)
|
||||||
#H
|
#H
|
||||||
|
|
@ -21,7 +21,7 @@ set -e # fail fast
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit() {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g"
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e # fail fast
|
set -e # fail fast
|
||||||
#H Usage:
|
#H Usage:
|
||||||
#H compile.sh -h | compile.sh --help
|
#H %FILE% -h | %FILE% --help
|
||||||
#H
|
#H
|
||||||
#H prints this help and exits
|
#H prints this help and exits
|
||||||
#H
|
#H
|
||||||
#H compile.sh <module>
|
#H %FILE% <module>
|
||||||
#H
|
#H
|
||||||
#H compiles the taskana application. Does not package and install artifacts.
|
#H compiles the taskana application. Does not package and install artifacts.
|
||||||
#H
|
#H
|
||||||
|
|
@ -18,7 +18,7 @@ set -e # fail fast
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit() {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g"
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e #fail fast
|
||||||
|
|
||||||
|
#H Usage:
|
||||||
|
#H %FILE% -h | %FILE% --help
|
||||||
|
#H
|
||||||
|
#H prints this help and exits
|
||||||
|
#H
|
||||||
|
#H %FILE%
|
||||||
|
#H
|
||||||
|
#H if a release version exists (extracted from TRAVIS_TAG environment variable)
|
||||||
|
#H the taskana dependency in our wildfly example project will be incremented to the new version snapshot.
|
||||||
|
#H
|
||||||
|
# Arguments:
|
||||||
|
# $1: exit code
|
||||||
|
function helpAndExit() {
|
||||||
|
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g"
|
||||||
|
exit "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# takes a version (without leading v) and increments its
|
||||||
|
# last number by one.
|
||||||
|
# Arguments:
|
||||||
|
# $1: version (without leading v) which will be patched
|
||||||
|
# Return:
|
||||||
|
# version with last number incremented
|
||||||
|
function increment_version() {
|
||||||
|
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||||
|
echo "'$1' does not match tag pattern." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "${1%\.*}.$(expr ${1##*\.*\.} + 1)"
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||||
|
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
REL=$(dirname "$0")
|
||||||
|
FILES=(
|
||||||
|
$REL/../rest/taskana-rest-spring-example-wildfly/pom.xml
|
||||||
|
)
|
||||||
|
for file in ${FILES[@]}; do
|
||||||
|
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT/$(increment_version "${TRAVIS_TAG##v}")-SNAPSHOT/g" $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-parent</artifactId>
|
<artifactId>taskana-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-common-parent</artifactId>
|
<artifactId>taskana-common-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ import org.apache.ibatis.jdbc.ScriptRunner;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import pro.taskana.common.internal.configuration.DB;
|
||||||
|
|
||||||
/** This class generates sample data for manual testing purposes. */
|
/** This class generates sample data for manual testing purposes. */
|
||||||
public class SampleDataGenerator {
|
public class SampleDataGenerator {
|
||||||
|
|
||||||
|
|
@ -90,9 +92,10 @@ public class SampleDataGenerator {
|
||||||
|
|
||||||
private List<String> parseScripts(Stream<String> scripts) {
|
private List<String> parseScripts(Stream<String> scripts) {
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
String dbProductName = connection.getMetaData().getDatabaseProductName();
|
String dbProductId =
|
||||||
|
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
||||||
return scripts
|
return scripts
|
||||||
.map(script -> SqlReplacer.getScriptAsSql(dbProductName, now, script))
|
.map(script -> SqlReplacer.getScriptAsSql(dbProductId, now, script))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeSqlException("Connection to database failed.", e);
|
throw new RuntimeSqlException("Connection to database failed.", e);
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ final class SqlReplacer {
|
||||||
// to prevent initialization
|
// to prevent initialization
|
||||||
private SqlReplacer() {}
|
private SqlReplacer() {}
|
||||||
|
|
||||||
static String getScriptAsSql(String dbProductName, ZonedDateTime now, String scriptPath) {
|
static String getScriptAsSql(String dbProductId, ZonedDateTime now, String scriptPath) {
|
||||||
return parseAndReplace(getScriptBufferedStream(scriptPath), now, dbProductName);
|
return parseAndReplace(getScriptBufferedStream(scriptPath), now, dbProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -65,10 +65,9 @@ final class SqlReplacer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String parseAndReplace(
|
private static String parseAndReplace(
|
||||||
BufferedReader bufferedReader, ZonedDateTime now, String dbProductname) {
|
BufferedReader bufferedReader, ZonedDateTime now, String dbProductId) {
|
||||||
boolean isDb2 = DB.isDb2(dbProductname);
|
|
||||||
String sql = bufferedReader.lines().collect(Collectors.joining(System.lineSeparator()));
|
String sql = bufferedReader.lines().collect(Collectors.joining(System.lineSeparator()));
|
||||||
if (isDb2) {
|
if (DB.isDb2(dbProductId)) {
|
||||||
sql = replaceBooleanWithInteger(sql);
|
sql = replaceBooleanWithInteger(sql);
|
||||||
}
|
}
|
||||||
return replaceDatePlaceholder(now, sql);
|
return replaceDatePlaceholder(now, sql);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
-- KSC workbaskets
|
-- KSC workbaskets
|
||||||
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
|
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC' , 'owner0815' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1' , 'Peter Maier', 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung', 'projekt' , 'team' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung', 'projekt' , 'team' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A', 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A', 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
|
|
@ -17,16 +17,16 @@ INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'owner0815' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false );
|
||||||
|
|
||||||
-- Workbaskets for sorting test
|
-- Workbaskets for sorting test
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A' , 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'Max' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,31 @@
|
||||||
-- KSC workbaskets
|
-- KSC workbaskets
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC', '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC', 'owner0815', 'ABCQVW', '', 'xyz4', '', '', '', '', '', FALSE);
|
-- WORKBASKET TABLE (ID , KEY , CREATED , MODIFIED , NAME , DOMAIN , TYPE , DESCRIPTION , OWNER , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4 , ORG_LEVEL_1 , ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4, MARKED_FOR_DELETION );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC 1', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC' , '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC' , 'teamlead-1' , 'ABCQVW' , '' , 'xyz4' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC 2', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 1' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1', 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC 2' , 'DOMAIN_A', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2', 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1', 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1', '', '', '', '', 'custom4z', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000005', 'TEAMLEAD-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK Teamlead KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1', 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1', 'Peter Maier', 'custom1', 'custom2', 'custom3', 'custom4', 'versicherung', 'abteilung', 'projekt', 'team', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000006', 'USER-1-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 1' , '' , '' , '' , '' , 'custom4z', '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2', 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000007', 'USER-1-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 1' , 'user-1-2' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'versicherung', 'abteilung', 'projekt' , 'team' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2', 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000008', 'USER-2-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 1 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP', 'DOMAIN_A', 'TOPIC', 'Themenpostkorb VIP', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000009', 'USER-2-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 2' , 'DOMAIN_A', 'PERSONAL', 'PPK User 2 KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000010', 'TPK_VIP' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Themenpostkorb VIP' , 'DOMAIN_A', 'TOPIC' , 'Themenpostkorb VIP' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
|
|
||||||
-- KSC workbaskets Domain_B
|
-- KSC workbaskets Domain_B
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B', 'DOMAIN_B', 'GROUP', 'Gruppenpostkorb KSC', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000011', 'GPK_B_KSC' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1', 'DOMAIN_B', 'GROUP', 'Gruppenpostkorb KSC 1', '', 'custom1', 'custom2', 'custom3', 'custom4', 'orgl1', 'orgl2', 'orgl3', 'aorgl4', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000012', 'GPK_B_KSC_1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B1' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 1' , '' , 'custom1', 'custom2' , 'custom3', 'custom4' , 'orgl1' , 'orgl2' , 'orgl3' , 'aorgl4' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2', 'DOMAIN_B', 'GROUP', 'Gruppenpostkorb KSC 2', '', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000013', 'GPK_B_KSC_2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Gruppenpostkorb KSC B2' , 'DOMAIN_B', 'GROUP' , 'Gruppenpostkorb KSC 2' , '' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B', '', '', 'custom20', '', 'custom4', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000014', 'USER-B-1' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 1 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , '' , '' , 'custom20', '' , 'custom4' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B', 'owner0815', 'ABCABC', 'cust2', 'cust3', 'cust4', 'orgl1', 'orgl2', 'orgl3', 'orgl4', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000015', 'USER-B-2' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'PPK User 2 KSC 1 Domain B', 'DOMAIN_B', 'PERSONAL', 'PPK User 1 KSC 1 Domain B' , 'user-1-2' , 'ABCABC' , 'cust2' , 'cust3' , 'cust4' , 'orgl1' , 'orgl2' , 'orgl3' , 'orgl4' , false );
|
||||||
|
|
||||||
-- Workbaskets for sorting test
|
-- Workbaskets for sorting test
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000900', 'sort001' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxet0' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000901', 'Sort002' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'Basxet1' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000902', 'sOrt003' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'bAsxet2' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000903', 'soRt004' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'baSxet3' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000904', 'sorT005' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basXet4' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000905', 'Sort006' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxEt5' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000906', 'SOrt007' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'basxeT6' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000907', 'SoRt008' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BAsxet7' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000908', 'SorT009' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BaSxet8' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010', RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet.', 'Max', '', '', '', '', '', '', '', '', FALSE);
|
INSERT INTO WORKBASKET VALUES ('WBI:000000000000000000000000000000000909', 'Sort010' , RELATIVE_DATE(0) , RELATIVE_DATE(0) , 'BasXet9' , 'DOMAIN_A', 'TOPIC' , 'Lorem ipsum dolor sit amet.', 'user-1-3' , '' , '' , '' , '' , '' , '' , '' , '' , false );
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>taskana-common-parent</artifactId>
|
<artifactId>taskana-common-parent</artifactId>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,19 +132,6 @@ ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 1
|
||||||
cn: Elena Faul
|
cn: Elena Faul
|
||||||
userPassword: user-1-3
|
userPassword: user-1-3
|
||||||
|
|
||||||
dn: uid=Max,cn=users,OU=Test,O=TASKANA
|
|
||||||
objectclass: inetorgperson
|
|
||||||
objectclass: organizationalperson
|
|
||||||
objectclass: person
|
|
||||||
objectclass: top
|
|
||||||
givenName: Max
|
|
||||||
description: desc
|
|
||||||
uid: Max
|
|
||||||
sn: Mustermann
|
|
||||||
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 1
|
|
||||||
cn: Max Mustermann
|
|
||||||
userPassword: Max
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Users KSC 2
|
# Users KSC 2
|
||||||
########################
|
########################
|
||||||
|
|
@ -187,18 +174,109 @@ ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
cn:: VGltIFNjaGzDpGZyaWc=
|
cn:: VGltIFNjaGzDpGZyaWc=
|
||||||
userPassword: user-2-1
|
userPassword: user-2-1
|
||||||
|
|
||||||
dn: uid=owner0815,cn=users,OU=Test,O=TASKANA
|
dn: uid=user-2-3,cn=users,OU=Test,O=TASKANA
|
||||||
objectclass: inetorgperson
|
objectclass: inetorgperson
|
||||||
objectclass: organizationalperson
|
objectclass: organizationalperson
|
||||||
objectclass: person
|
objectclass: person
|
||||||
objectclass: top
|
objectclass: top
|
||||||
givenName: Hans
|
givenName: Thomas
|
||||||
description: desc
|
description: desc
|
||||||
uid: owner0815
|
uid: user-2-3
|
||||||
sn: Hafer
|
sn: Bach
|
||||||
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
cn: Hans Hafer
|
cn: Thomas Bach
|
||||||
userPassword: owner0815
|
userPassword: user-2-3
|
||||||
|
|
||||||
|
dn: uid=user-2-4,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Rolf
|
||||||
|
description: desc
|
||||||
|
uid: user-2-4
|
||||||
|
sn: Wieland
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Rolf Wieland
|
||||||
|
userPassword: user-2-4
|
||||||
|
|
||||||
|
dn: uid=user-2-5,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Heike
|
||||||
|
description: desc
|
||||||
|
uid: user-2-5
|
||||||
|
sn: Schmidt
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Heike Schmidt
|
||||||
|
userPassword: user-2-5
|
||||||
|
|
||||||
|
dn: uid=user-2-6,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Kurt
|
||||||
|
description: desc
|
||||||
|
uid: user-2-6
|
||||||
|
sn: Maier
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Kurt Maier
|
||||||
|
userPassword: user-2-6
|
||||||
|
|
||||||
|
dn: uid=user-2-7,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Wiebke
|
||||||
|
description: desc
|
||||||
|
uid: user-2-7
|
||||||
|
sn: Meyer
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Wiebke Meyer
|
||||||
|
userPassword: user-2-7
|
||||||
|
|
||||||
|
dn: uid=user-2-8,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Jana
|
||||||
|
description: desc
|
||||||
|
uid: user-2-8
|
||||||
|
sn: Heeg
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Jana Heeg
|
||||||
|
userPassword: user-2-8
|
||||||
|
|
||||||
|
dn: uid=user-2-9,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Nathalie
|
||||||
|
description: desc
|
||||||
|
uid: user-2-9
|
||||||
|
sn: Fuchs
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Nathalie Fuchs
|
||||||
|
userPassword: user-2-9
|
||||||
|
|
||||||
|
dn: uid=user-2-10,cn=users,OU=Test,O=TASKANA
|
||||||
|
objectclass: inetorgperson
|
||||||
|
objectclass: organizationalperson
|
||||||
|
objectclass: person
|
||||||
|
objectclass: top
|
||||||
|
givenName: Johannes
|
||||||
|
description: desc
|
||||||
|
uid: user-2-10
|
||||||
|
sn: Renz
|
||||||
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
|
cn: Johannes Renz
|
||||||
|
userPassword: user-2-10
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Users Domäne B
|
# Users Domäne B
|
||||||
|
|
@ -286,6 +364,14 @@ dn: cn=Organisationseinheit KSC 2,cn=Organisationseinheit KSC,cn=organisation,OU
|
||||||
uniquemember: uid=teamlead-2,cn=users,OU=Test,O=TASKANA
|
uniquemember: uid=teamlead-2,cn=users,OU=Test,O=TASKANA
|
||||||
uniquemember: uid=user-2-1,cn=users,OU=Test,O=TASKANA
|
uniquemember: uid=user-2-1,cn=users,OU=Test,O=TASKANA
|
||||||
uniquemember: uid=user-2-2,cn=users,OU=Test,O=TASKANA
|
uniquemember: uid=user-2-2,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-3,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-4,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-5,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-6,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-7,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-8,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-9,cn=users,OU=Test,O=TASKANA
|
||||||
|
uniquemember: uid=user-2-10,cn=users,OU=Test,O=TASKANA
|
||||||
cn: Organisationseinheit KSC 2
|
cn: Organisationseinheit KSC 2
|
||||||
objectclass: groupofuniquenames
|
objectclass: groupofuniquenames
|
||||||
objectclass: top
|
objectclass: top
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>taskana-common-parent</artifactId>
|
<artifactId>taskana-common-parent</artifactId>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,58 @@
|
||||||
package pro.taskana.common.internal.configuration;
|
package pro.taskana.common.internal.configuration;
|
||||||
|
|
||||||
|
import pro.taskana.common.api.exceptions.SystemException;
|
||||||
import pro.taskana.common.api.exceptions.UnsupportedDatabaseException;
|
import pro.taskana.common.api.exceptions.UnsupportedDatabaseException;
|
||||||
|
|
||||||
/** Supported versions of databases. */
|
/** Supported versions of databases. */
|
||||||
public enum DB {
|
public enum DB {
|
||||||
H2("H2", "h2"),
|
H2("H2", "h2"),
|
||||||
DB2("DB2", "db2"),
|
DB2("DB2", "db2"),
|
||||||
POSTGRESS("PostgreSQL", "postgres");
|
POSTGRES("PostgreSQL", "postgres");
|
||||||
|
|
||||||
public final String dbProductname;
|
public final String dbProductName;
|
||||||
public final String dbProductId;
|
public final String dbProductId;
|
||||||
|
|
||||||
DB(String dbProductname, String dbProductId) {
|
DB(String dbProductName, String dbProductId) {
|
||||||
this.dbProductname = dbProductname;
|
this.dbProductName = dbProductName;
|
||||||
this.dbProductId = dbProductId;
|
this.dbProductId = dbProductId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDb2(String dbProductName) {
|
public static boolean isH2(String dbProductId) {
|
||||||
return dbProductName != null && dbProductName.contains(DB2.dbProductname);
|
return H2.dbProductId.equals(dbProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isH2(String dbProductName) {
|
public static boolean isDb2(String dbProductId) {
|
||||||
return dbProductName != null && dbProductName.contains(H2.dbProductname);
|
return DB2.dbProductId.equals(dbProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPostgreSql(String dbProductName) {
|
public static boolean isPostgres(String dbProductId) {
|
||||||
return POSTGRESS.dbProductname.equals(dbProductName);
|
return POSTGRES.dbProductId.equals(dbProductId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DB getDbForId(String databaseId) {
|
||||||
|
if (isH2(databaseId)) {
|
||||||
|
return H2;
|
||||||
|
} else if (isDb2(databaseId)) {
|
||||||
|
return DB2;
|
||||||
|
} else if (isPostgres(databaseId)) {
|
||||||
|
return POSTGRES;
|
||||||
|
}
|
||||||
|
throw new SystemException("Unknown database id: " + databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDatabaseProductId(String dbProductName) {
|
public static String getDatabaseProductId(String dbProductName) {
|
||||||
|
if (dbProductName.contains(H2.dbProductName)) {
|
||||||
if (isDb2(dbProductName)) {
|
|
||||||
return DB2.dbProductId;
|
|
||||||
} else if (isH2(dbProductName)) {
|
|
||||||
return H2.dbProductId;
|
return H2.dbProductId;
|
||||||
} else if (isPostgreSql(dbProductName)) {
|
} else if (dbProductName.contains(DB2.dbProductName)) {
|
||||||
return POSTGRESS.dbProductId;
|
return DB2.dbProductId;
|
||||||
|
} else if (POSTGRES.dbProductName.equals(dbProductName)) {
|
||||||
|
return POSTGRES.dbProductId;
|
||||||
} else {
|
} else {
|
||||||
throw new UnsupportedDatabaseException(dbProductName);
|
throw new UnsupportedDatabaseException(dbProductName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getProductId() {
|
||||||
|
return this.dbProductId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ import org.apache.ibatis.jdbc.SqlRunner;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import pro.taskana.common.internal.util.ComparableVersion;
|
||||||
|
|
||||||
/** This class create the schema for taskana. */
|
/** This class create the schema for taskana. */
|
||||||
public class DbSchemaCreator {
|
public class DbSchemaCreator {
|
||||||
|
|
||||||
|
|
@ -59,10 +61,11 @@ public class DbSchemaCreator {
|
||||||
connection.getMetaData().getDatabaseProductName(),
|
connection.getMetaData().getDatabaseProductName(),
|
||||||
connection.getMetaData().getURL());
|
connection.getMetaData().getURL());
|
||||||
ScriptRunner runner = getScriptRunnerInstance(connection);
|
ScriptRunner runner = getScriptRunnerInstance(connection);
|
||||||
|
String dbProductId =
|
||||||
|
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
||||||
|
|
||||||
if (!isSchemaPreexisting(connection)) {
|
if (!isSchemaPreexisting(connection, dbProductId)) {
|
||||||
String scriptPath =
|
String scriptPath = selectDbScriptFileName(dbProductId);
|
||||||
selectDbScriptFileName(connection.getMetaData().getDatabaseProductName());
|
|
||||||
InputStream resourceAsStream = DbSchemaCreator.class.getResourceAsStream(scriptPath);
|
InputStream resourceAsStream = DbSchemaCreator.class.getResourceAsStream(scriptPath);
|
||||||
BufferedReader reader =
|
BufferedReader reader =
|
||||||
new BufferedReader(new InputStreamReader(resourceAsStream, StandardCharsets.UTF_8));
|
new BufferedReader(new InputStreamReader(resourceAsStream, StandardCharsets.UTF_8));
|
||||||
|
|
@ -75,7 +78,7 @@ public class DbSchemaCreator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValidSchemaVersion(String expectedVersion) {
|
public boolean isValidSchemaVersion(String expectedMinVersion) {
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
connection.setSchema(this.schemaName);
|
connection.setSchema(this.schemaName);
|
||||||
SqlRunner runner = new SqlRunner(connection);
|
SqlRunner runner = new SqlRunner(connection);
|
||||||
|
|
@ -83,15 +86,18 @@ public class DbSchemaCreator {
|
||||||
|
|
||||||
String query =
|
String query =
|
||||||
"select VERSION from TASKANA_SCHEMA_VERSION where "
|
"select VERSION from TASKANA_SCHEMA_VERSION where "
|
||||||
+ "VERSION = (select max(VERSION) from TASKANA_SCHEMA_VERSION) "
|
+ "VERSION = (select max(VERSION) from TASKANA_SCHEMA_VERSION) ";
|
||||||
+ "AND VERSION = ?";
|
|
||||||
|
|
||||||
Map<String, Object> queryResult = runner.selectOne(query, expectedVersion);
|
Map<String, Object> queryResult = runner.selectOne(query);
|
||||||
if (queryResult == null || queryResult.isEmpty()) {
|
|
||||||
|
ComparableVersion actualVersion = new ComparableVersion((String) queryResult.get("VERSION"));
|
||||||
|
ComparableVersion minVersion = new ComparableVersion(expectedMinVersion);
|
||||||
|
|
||||||
|
if (actualVersion.compareTo(minVersion) < 0) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"Schema version not valid. The VERSION property in table TASKANA_SCHEMA_VERSION "
|
"Schema version not valid. The VERSION property in table TASKANA_SCHEMA_VERSION "
|
||||||
+ "has not the expected value {}",
|
+ "has not the expected min value {}",
|
||||||
expectedVersion);
|
expectedMinVersion);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("Schema version is valid.");
|
LOGGER.debug("Schema version is valid.");
|
||||||
|
|
@ -101,8 +107,8 @@ public class DbSchemaCreator {
|
||||||
} catch (RuntimeSqlException | SQLException e) {
|
} catch (RuntimeSqlException | SQLException e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"Schema version not valid. The VERSION property in table TASKANA_SCHEMA_VERSION "
|
"Schema version not valid. The VERSION property in table TASKANA_SCHEMA_VERSION "
|
||||||
+ "has not the expected value {}",
|
+ "has not the expected min value {}",
|
||||||
expectedVersion);
|
expectedMinVersion);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -115,18 +121,28 @@ public class DbSchemaCreator {
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String selectDbScriptFileName(String dbProductName) {
|
private static String selectDbScriptFileName(String dbProductId) {
|
||||||
return DB.isPostgreSql(dbProductName)
|
|
||||||
? DB_SCHEMA_POSTGRES
|
switch (DB.getDbForId(dbProductId)) {
|
||||||
: DB.isH2(dbProductName) ? DB_SCHEMA_H2 : DB_SCHEMA_DB2;
|
case DB2:
|
||||||
|
return DB_SCHEMA_DB2;
|
||||||
|
case POSTGRES:
|
||||||
|
return DB_SCHEMA_POSTGRES;
|
||||||
|
default:
|
||||||
|
return DB_SCHEMA_H2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String selectDbSchemaDetectionScript(String dbProductName) {
|
private static String selectDbSchemaDetectionScript(String dbProductId) {
|
||||||
|
|
||||||
if (DB.isPostgreSql(dbProductName)) {
|
switch (DB.getDbForId(dbProductId)) {
|
||||||
return DB_SCHEMA_DETECTION_POSTGRES;
|
case DB2:
|
||||||
|
return DB_SCHEMA_DETECTION_DB2;
|
||||||
|
case POSTGRES:
|
||||||
|
return DB_SCHEMA_DETECTION_POSTGRES;
|
||||||
|
default:
|
||||||
|
return DB_SCHEMA_DETECTION_H2;
|
||||||
}
|
}
|
||||||
return DB.isH2(dbProductName) ? DB_SCHEMA_DETECTION_H2 : DB_SCHEMA_DETECTION_DB2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScriptRunner getScriptRunnerInstance(Connection connection) {
|
private ScriptRunner getScriptRunnerInstance(Connection connection) {
|
||||||
|
|
@ -137,18 +153,17 @@ public class DbSchemaCreator {
|
||||||
return runner;
|
return runner;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSchemaPreexisting(Connection connection) {
|
private boolean isSchemaPreexisting(Connection connection, String dbProductId) {
|
||||||
ScriptRunner runner = getScriptRunnerInstance(connection);
|
ScriptRunner runner = getScriptRunnerInstance(connection);
|
||||||
StringWriter errorWriter = new StringWriter();
|
StringWriter errorWriter = new StringWriter();
|
||||||
runner.setErrorLogWriter(new PrintWriter(errorWriter));
|
runner.setErrorLogWriter(new PrintWriter(errorWriter));
|
||||||
try {
|
|
||||||
String scriptPath =
|
String scriptPath = selectDbSchemaDetectionScript(dbProductId);
|
||||||
selectDbSchemaDetectionScript(connection.getMetaData().getDatabaseProductName());
|
try (InputStream resource = DbSchemaCreator.class.getResourceAsStream(scriptPath);
|
||||||
InputStream resourceAsStream = DbSchemaCreator.class.getResourceAsStream(scriptPath);
|
InputStreamReader inputReader = new InputStreamReader(resource, StandardCharsets.UTF_8);
|
||||||
BufferedReader reader =
|
BufferedReader reader = new BufferedReader(inputReader)) {
|
||||||
new BufferedReader(new InputStreamReader(resourceAsStream, StandardCharsets.UTF_8));
|
|
||||||
runner.runScript(getSqlSchemaNameParsed(reader));
|
runner.runScript(getSqlSchemaNameParsed(reader));
|
||||||
} catch (RuntimeSqlException | SQLException e) {
|
} catch (RuntimeSqlException | IOException e) {
|
||||||
LOGGER.debug("Schema does not exist.");
|
LOGGER.debug("Schema does not exist.");
|
||||||
if (!errorWriter.toString().trim().isEmpty()) {
|
if (!errorWriter.toString().trim().isEmpty()) {
|
||||||
LOGGER.debug(errorWriter.toString());
|
LOGGER.debug(errorWriter.toString());
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,683 @@
|
||||||
|
package pro.taskana.common.internal.util;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*
|
||||||
|
* Original file:
|
||||||
|
* https://github.com/apache/maven/blob/master/maven-artifact/src/main/java/org/apache
|
||||||
|
* /maven/artifact/versioning/ComparableVersion.java
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Deque;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic implementation of version comparison. Features:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>mixing of '<code>-</code>' (hyphen) and '<code>.</code>' (dot) separators,
|
||||||
|
* <li>transition between characters and digits also constitutes a separator: <code>
|
||||||
|
* 1.0alpha1 => [1, 0, alpha, 1]</code>
|
||||||
|
* <li>unlimited number of version components,
|
||||||
|
* <li>version components in the text can be digits or strings,
|
||||||
|
* <li>strings are checked for well-known qualifiers and the qualifier ordering is used for
|
||||||
|
* version ordering. Well-known qualifiers (case insensitive) are:
|
||||||
|
* <ul>
|
||||||
|
* <li><code>alpha</code> or <code>a</code>
|
||||||
|
* <li><code>beta</code> or <code>b</code>
|
||||||
|
* <li><code>milestone</code> or <code>m</code>
|
||||||
|
* <li><code>rc</code> or <code>cr</code>
|
||||||
|
* <li><code>snapshot</code>
|
||||||
|
* <li><code>(the empty string)</code> or <code>ga</code> or <code>final</code>
|
||||||
|
* <li><code>sp</code>
|
||||||
|
* </ul>
|
||||||
|
* Unknown qualifiers are considered after known qualifiers, with lexical order (always case
|
||||||
|
* insensitive),
|
||||||
|
* <li>a hyphen usually precedes a qualifier, and is always less important than something preceded
|
||||||
|
* with a dot.
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @see <a href="https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning">"Versioning" on
|
||||||
|
* Maven Wiki</a>
|
||||||
|
* @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
|
||||||
|
* @author <a href="mailto:hboutemy@apache.org">Hervé Boutemy</a>
|
||||||
|
*/
|
||||||
|
public class ComparableVersion implements Comparable<ComparableVersion> {
|
||||||
|
private static final int MAX_INTITEM_LENGTH = 9;
|
||||||
|
|
||||||
|
private static final int MAX_LONGITEM_LENGTH = 18;
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
private String canonical;
|
||||||
|
|
||||||
|
private ListItem items;
|
||||||
|
|
||||||
|
public ComparableVersion(String version) {
|
||||||
|
parseVersion(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("checkstyle:innerassignment")
|
||||||
|
public final void parseVersion(String version) {
|
||||||
|
this.value = version;
|
||||||
|
|
||||||
|
items = new ListItem();
|
||||||
|
|
||||||
|
version = version.toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
|
ListItem list = items;
|
||||||
|
|
||||||
|
Deque<Item> stack = new ArrayDeque<>();
|
||||||
|
stack.push(list);
|
||||||
|
|
||||||
|
boolean isDigit = false;
|
||||||
|
|
||||||
|
int startIndex = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < version.length(); i++) {
|
||||||
|
char c = version.charAt(i);
|
||||||
|
|
||||||
|
if (c == '.') {
|
||||||
|
if (i == startIndex) {
|
||||||
|
list.add(IntItem.ZERO);
|
||||||
|
} else {
|
||||||
|
list.add(parseItem(isDigit, version.substring(startIndex, i)));
|
||||||
|
}
|
||||||
|
startIndex = i + 1;
|
||||||
|
} else if (c == '-') {
|
||||||
|
if (i == startIndex) {
|
||||||
|
list.add(IntItem.ZERO);
|
||||||
|
} else {
|
||||||
|
list.add(parseItem(isDigit, version.substring(startIndex, i)));
|
||||||
|
}
|
||||||
|
startIndex = i + 1;
|
||||||
|
|
||||||
|
list.add(list = new ListItem());
|
||||||
|
stack.push(list);
|
||||||
|
} else if (Character.isDigit(c)) {
|
||||||
|
if (!isDigit && i > startIndex) {
|
||||||
|
list.add(new StringItem(version.substring(startIndex, i), true));
|
||||||
|
startIndex = i;
|
||||||
|
|
||||||
|
list.add(list = new ListItem());
|
||||||
|
stack.push(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
isDigit = true;
|
||||||
|
} else {
|
||||||
|
if (isDigit && i > startIndex) {
|
||||||
|
list.add(parseItem(true, version.substring(startIndex, i)));
|
||||||
|
startIndex = i;
|
||||||
|
|
||||||
|
list.add(list = new ListItem());
|
||||||
|
stack.push(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
isDigit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version.length() > startIndex) {
|
||||||
|
list.add(parseItem(isDigit, version.substring(startIndex)));
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!stack.isEmpty()) {
|
||||||
|
list = (ListItem) stack.pop();
|
||||||
|
list.normalize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(ComparableVersion o) {
|
||||||
|
return items.compareTo(o.items);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCanonical() {
|
||||||
|
if (canonical == null) {
|
||||||
|
canonical = items.toString();
|
||||||
|
}
|
||||||
|
return canonical;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main to test version parsing and comparison.
|
||||||
|
*
|
||||||
|
* <p>To check how "1.2.7" compares to "1.2-SNAPSHOT", for example, you can issue
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* java -jar ${maven.repo.local}/org/apache/maven/maven-artifact/
|
||||||
|
* ${maven.version}/maven-artifact-${maven.version}.jar "1.2.7" "1.2-SNAPSHOT"
|
||||||
|
* </pre>
|
||||||
|
* command to command line. Result of given command will be something like this:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* Display parameters as parsed by Maven (in canonical form) and comparison result:
|
||||||
|
* 1. 1.2.7 == 1.2.7
|
||||||
|
* 1.2.7 > 1.2-SNAPSHOT
|
||||||
|
* 2. 1.2-SNAPSHOT == 1.2-snapshot
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param args the version strings to parse and compare. You can pass arbitrary number of version
|
||||||
|
* strings and always two adjacent will be compared
|
||||||
|
*/
|
||||||
|
// CHECKSTYLE_ON: LineLength
|
||||||
|
public static void main(String... args) {
|
||||||
|
/* System.out.println(
|
||||||
|
"Display parameters as parsed by Maven (in canonical form) and comparison result:");*/
|
||||||
|
if (args.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComparableVersion prev = null;
|
||||||
|
int i = 1;
|
||||||
|
for (String version : args) {
|
||||||
|
ComparableVersion c = new ComparableVersion(version);
|
||||||
|
|
||||||
|
if (prev != null) {
|
||||||
|
int compare = prev.compareTo(c);
|
||||||
|
/* System.out.println(
|
||||||
|
" "
|
||||||
|
+ prev.toString()
|
||||||
|
+ ' '
|
||||||
|
+ ((compare == 0) ? "==" : ((compare < 0) ? "<" : ">"))
|
||||||
|
+ ' '
|
||||||
|
+ version);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// System.out.println(String.valueOf(i++) + ". " + version + " == " + c.getCanonical());
|
||||||
|
|
||||||
|
prev = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Item parseItem(boolean isDigit, String buf) {
|
||||||
|
if (isDigit) {
|
||||||
|
buf = stripLeadingZeroes(buf);
|
||||||
|
if (buf.length() <= MAX_INTITEM_LENGTH) {
|
||||||
|
// lower than 2^31
|
||||||
|
return new IntItem(buf);
|
||||||
|
} else if (buf.length() <= MAX_LONGITEM_LENGTH) {
|
||||||
|
// lower than 2^63
|
||||||
|
return new LongItem(buf);
|
||||||
|
}
|
||||||
|
return new BigIntegerItem(buf);
|
||||||
|
}
|
||||||
|
return new StringItem(buf, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String stripLeadingZeroes(String buf) {
|
||||||
|
if (buf == null || buf.isEmpty()) {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
for (int i = 0; i < buf.length(); ++i) {
|
||||||
|
char c = buf.charAt(i);
|
||||||
|
if (c != '0') {
|
||||||
|
return buf.substring(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return items.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
return (o instanceof ComparableVersion) && items.equals(((ComparableVersion) o).items);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private interface Item {
|
||||||
|
int INT_ITEM = 3;
|
||||||
|
int LONG_ITEM = 4;
|
||||||
|
int BIGINTEGER_ITEM = 0;
|
||||||
|
int STRING_ITEM = 1;
|
||||||
|
int LIST_ITEM = 2;
|
||||||
|
|
||||||
|
int compareTo(Item item);
|
||||||
|
|
||||||
|
int getType();
|
||||||
|
|
||||||
|
boolean isNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Represents a numeric item in the version item list that can be represented with an int. */
|
||||||
|
private static class IntItem implements Item {
|
||||||
|
public static final IntItem ZERO = new IntItem();
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
private IntItem() {
|
||||||
|
this.value = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
IntItem(String str) {
|
||||||
|
this.value = Integer.parseInt(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return INT_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNull() {
|
||||||
|
return value == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Item item) {
|
||||||
|
if (item == null) {
|
||||||
|
return (value == 0) ? 0 : 1; // 1.0 == 1, 1.1 > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (item.getType()) {
|
||||||
|
case INT_ITEM:
|
||||||
|
int itemValue = ((IntItem) item).value;
|
||||||
|
return (value < itemValue) ? -1 : ((value == itemValue) ? 0 : 1);
|
||||||
|
case LONG_ITEM:
|
||||||
|
case BIGINTEGER_ITEM:
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
case STRING_ITEM:
|
||||||
|
return 1; // 1.1 > 1-sp
|
||||||
|
|
||||||
|
case LIST_ITEM:
|
||||||
|
return 1; // 1.1 > 1-1
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("invalid item: " + item.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IntItem intItem = (IntItem) o;
|
||||||
|
|
||||||
|
return value == intItem.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Integer.toString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Represents a numeric item in the version item list that can be represented with a long. */
|
||||||
|
private static class LongItem implements Item {
|
||||||
|
private final long value;
|
||||||
|
|
||||||
|
LongItem(String str) {
|
||||||
|
this.value = Long.parseLong(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return LONG_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNull() {
|
||||||
|
return value == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Item item) {
|
||||||
|
if (item == null) {
|
||||||
|
return (value == 0) ? 0 : 1; // 1.0 == 1, 1.1 > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (item.getType()) {
|
||||||
|
case INT_ITEM:
|
||||||
|
return 1;
|
||||||
|
case LONG_ITEM:
|
||||||
|
long itemValue = ((LongItem) item).value;
|
||||||
|
return (value < itemValue) ? -1 : ((value == itemValue) ? 0 : 1);
|
||||||
|
case BIGINTEGER_ITEM:
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
case STRING_ITEM:
|
||||||
|
return 1; // 1.1 > 1-sp
|
||||||
|
|
||||||
|
case LIST_ITEM:
|
||||||
|
return 1; // 1.1 > 1-1
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("invalid item: " + item.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return (int) (value ^ (value >>> 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LongItem longItem = (LongItem) o;
|
||||||
|
|
||||||
|
return value == longItem.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Long.toString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Represents a numeric item in the version item list. */
|
||||||
|
private static class BigIntegerItem implements Item {
|
||||||
|
private final BigInteger value;
|
||||||
|
|
||||||
|
BigIntegerItem(String str) {
|
||||||
|
this.value = new BigInteger(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return BIGINTEGER_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNull() {
|
||||||
|
return BigInteger.ZERO.equals(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Item item) {
|
||||||
|
if (item == null) {
|
||||||
|
return BigInteger.ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (item.getType()) {
|
||||||
|
case INT_ITEM:
|
||||||
|
case LONG_ITEM:
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
case BIGINTEGER_ITEM:
|
||||||
|
return value.compareTo(((BigIntegerItem) item).value);
|
||||||
|
|
||||||
|
case STRING_ITEM:
|
||||||
|
return 1; // 1.1 > 1-sp
|
||||||
|
|
||||||
|
case LIST_ITEM:
|
||||||
|
return 1; // 1.1 > 1-1
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("invalid item: " + item.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return value.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
BigIntegerItem that = (BigIntegerItem) o;
|
||||||
|
|
||||||
|
return value.equals(that.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Represents a string in the version item list, usually a qualifier. */
|
||||||
|
private static class StringItem implements Item {
|
||||||
|
private static final List<String> QUALIFIERS =
|
||||||
|
Arrays.asList("alpha", "beta", "milestone", "rc", "snapshot", "", "sp");
|
||||||
|
|
||||||
|
private static final Properties ALIASES = new Properties();
|
||||||
|
/**
|
||||||
|
* A comparable value for the empty-string qualifier. This one is used to determine if a given
|
||||||
|
* qualifier makes the version older than one without a qualifier, or more recent.
|
||||||
|
*/
|
||||||
|
private static final String RELEASE_VERSION_INDEX = String.valueOf(QUALIFIERS.indexOf(""));
|
||||||
|
|
||||||
|
static {
|
||||||
|
ALIASES.put("ga", "");
|
||||||
|
ALIASES.put("final", "");
|
||||||
|
ALIASES.put("release", "");
|
||||||
|
ALIASES.put("cr", "rc");
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
StringItem(String value, boolean followedByDigit) {
|
||||||
|
if (followedByDigit && value.length() == 1) {
|
||||||
|
// a1 = alpha-1, b1 = beta-1, m1 = milestone-1
|
||||||
|
switch (value.charAt(0)) {
|
||||||
|
case 'a':
|
||||||
|
value = "alpha";
|
||||||
|
break;
|
||||||
|
case 'b':
|
||||||
|
value = "beta";
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
value = "milestone";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.value = ALIASES.getProperty(value, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return STRING_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNull() {
|
||||||
|
return (comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a comparable value for a qualifier.
|
||||||
|
*
|
||||||
|
* <p>This method takes into account the ordering of known qualifiers then unknown qualifiers
|
||||||
|
* with lexical ordering.
|
||||||
|
*
|
||||||
|
* <p>just returning an Integer with the index here is faster, but requires a lot of
|
||||||
|
* if/then/else to check for -1 or QUALIFIERS.size and then resort to lexical ordering. Most
|
||||||
|
* comparisons are decided by the first character, so this is still fast. If more characters are
|
||||||
|
* needed then it requires a lexical sort anyway.
|
||||||
|
*
|
||||||
|
* @param qualifier the qualifier
|
||||||
|
* @return an equivalent value that can be used with lexical comparison
|
||||||
|
*/
|
||||||
|
public static String comparableQualifier(String qualifier) {
|
||||||
|
int i = QUALIFIERS.indexOf(qualifier);
|
||||||
|
|
||||||
|
return i == -1 ? (QUALIFIERS.size() + "-" + qualifier) : String.valueOf(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Item item) {
|
||||||
|
if (item == null) {
|
||||||
|
// 1-rc < 1, 1-ga > 1
|
||||||
|
return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX);
|
||||||
|
}
|
||||||
|
switch (item.getType()) {
|
||||||
|
case INT_ITEM:
|
||||||
|
case LONG_ITEM:
|
||||||
|
case BIGINTEGER_ITEM:
|
||||||
|
return -1; // 1.any < 1.1 ?
|
||||||
|
|
||||||
|
case STRING_ITEM:
|
||||||
|
return comparableQualifier(value)
|
||||||
|
.compareTo(comparableQualifier(((StringItem) item).value));
|
||||||
|
|
||||||
|
case LIST_ITEM:
|
||||||
|
return -1; // 1.any < 1-1
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("invalid item: " + item.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return value.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringItem that = (StringItem) o;
|
||||||
|
|
||||||
|
return value.equals(that.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CHECKSTYLE_OFF: LineLength
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a version list item. This class is used both for the global item list and for
|
||||||
|
* sub-lists (which start with '-(number)' in the version specification).
|
||||||
|
*/
|
||||||
|
private static class ListItem extends ArrayList<Item> implements Item {
|
||||||
|
@Override
|
||||||
|
public int getType() {
|
||||||
|
return LIST_ITEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNull() {
|
||||||
|
return (size() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(Item item) {
|
||||||
|
if (item == null) {
|
||||||
|
if (size() == 0) {
|
||||||
|
return 0; // 1-0 = 1- (normalize) = 1
|
||||||
|
}
|
||||||
|
Item first = get(0);
|
||||||
|
return first.compareTo(null);
|
||||||
|
}
|
||||||
|
switch (item.getType()) {
|
||||||
|
case INT_ITEM:
|
||||||
|
case LONG_ITEM:
|
||||||
|
case BIGINTEGER_ITEM:
|
||||||
|
return -1; // 1-1 < 1.0.x
|
||||||
|
|
||||||
|
case STRING_ITEM:
|
||||||
|
return 1; // 1-1 > 1-sp
|
||||||
|
|
||||||
|
case LIST_ITEM:
|
||||||
|
Iterator<Item> left = iterator();
|
||||||
|
Iterator<Item> right = ((ListItem) item).iterator();
|
||||||
|
|
||||||
|
while (left.hasNext() || right.hasNext()) {
|
||||||
|
Item l = left.hasNext() ? left.next() : null;
|
||||||
|
Item r = right.hasNext() ? right.next() : null;
|
||||||
|
|
||||||
|
// if this is shorter, then invert the compare and mul with -1
|
||||||
|
int result = l == null ? (r == null ? 0 : -1 * r.compareTo(l)) : l.compareTo(r);
|
||||||
|
|
||||||
|
if (result != 0) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("invalid item: " + item.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void normalize() {
|
||||||
|
for (int i = size() - 1; i >= 0; i--) {
|
||||||
|
Item lastItem = get(i);
|
||||||
|
|
||||||
|
if (lastItem.isNull()) {
|
||||||
|
// remove null trailing items: 0, "", empty list
|
||||||
|
remove(i);
|
||||||
|
} else if (!(lastItem instanceof ListItem)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder buffer = new StringBuilder();
|
||||||
|
for (Item item : this) {
|
||||||
|
if (buffer.length() > 0) {
|
||||||
|
buffer.append((item instanceof ListItem) ? '-' : '.');
|
||||||
|
}
|
||||||
|
buffer.append(item);
|
||||||
|
}
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ CREATE TABLE TASKANA_SCHEMA_VERSION(
|
||||||
PRIMARY KEY (ID)
|
PRIMARY KEY (ID)
|
||||||
);
|
);
|
||||||
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
||||||
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP);
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
CREATE TABLE CLASSIFICATION(
|
CREATE TABLE CLASSIFICATION(
|
||||||
ID VARCHAR(40) NOT NULL,
|
ID VARCHAR(40) NOT NULL,
|
||||||
|
|
@ -166,8 +166,8 @@ CREATE TABLE ATTACHMENT(
|
||||||
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
||||||
CLASSIFICATION_ID VARCHAR(40) NULL,
|
CLASSIFICATION_ID VARCHAR(40) NULL,
|
||||||
REF_COMPANY VARCHAR(32) NOT NULL,
|
REF_COMPANY VARCHAR(32) NOT NULL,
|
||||||
REF_SYSTEM VARCHAR(32) NOT NULL,
|
REF_SYSTEM VARCHAR(32),
|
||||||
REF_INSTANCE VARCHAR(32) NOT NULL,
|
REF_INSTANCE VARCHAR(32),
|
||||||
REF_TYPE VARCHAR(32) NOT NULL,
|
REF_TYPE VARCHAR(32) NOT NULL,
|
||||||
REF_VALUE VARCHAR(128) NOT NULL,
|
REF_VALUE VARCHAR(128) NOT NULL,
|
||||||
CHANNEL VARCHAR(64) NULL,
|
CHANNEL VARCHAR(64) NULL,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
-- this script updates the tables TASKANA_SCHEMA_VERSION and ATTACHMENT.
|
||||||
|
|
||||||
|
SET SCHEMA %schemaName%;
|
||||||
|
|
||||||
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
|
ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL ALTER COLUMN REF_INSTANCE DROP NOT NULL;
|
||||||
|
|
||||||
|
REORG TABLE ATTACHMENT;
|
||||||
|
|
@ -14,7 +14,7 @@ CREATE TABLE TASKANA_SCHEMA_VERSION(
|
||||||
PRIMARY KEY (ID)
|
PRIMARY KEY (ID)
|
||||||
);
|
);
|
||||||
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
||||||
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP);
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
CREATE TABLE CLASSIFICATION(
|
CREATE TABLE CLASSIFICATION(
|
||||||
ID VARCHAR(40) NOT NULL,
|
ID VARCHAR(40) NOT NULL,
|
||||||
|
|
@ -173,8 +173,8 @@ CREATE TABLE ATTACHMENT(
|
||||||
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
||||||
CLASSIFICATION_ID VARCHAR(40) NULL,
|
CLASSIFICATION_ID VARCHAR(40) NULL,
|
||||||
REF_COMPANY VARCHAR(32) NOT NULL,
|
REF_COMPANY VARCHAR(32) NOT NULL,
|
||||||
REF_SYSTEM VARCHAR(32) NOT NULL,
|
REF_SYSTEM VARCHAR(32),
|
||||||
REF_INSTANCE VARCHAR(32) NOT NULL,
|
REF_INSTANCE VARCHAR(32),
|
||||||
REF_TYPE VARCHAR(32) NOT NULL,
|
REF_TYPE VARCHAR(32) NOT NULL,
|
||||||
REF_VALUE VARCHAR(128) NOT NULL,
|
REF_VALUE VARCHAR(128) NOT NULL,
|
||||||
CHANNEL VARCHAR(64) NULL,
|
CHANNEL VARCHAR(64) NULL,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
-- this script updates the tables TASKANA_SCHEMA_VERSION and ATTACHMENT.
|
||||||
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
|
ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE ATTACHMENT ALTER COLUMN REF_INSTANCE DROP NOT NULL;
|
||||||
|
|
@ -9,7 +9,7 @@ CREATE TABLE TASKANA_SCHEMA_VERSION(
|
||||||
PRIMARY KEY (ID)
|
PRIMARY KEY (ID)
|
||||||
);
|
);
|
||||||
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
-- The VERSION value must match the value of TaskanaEngineConfiguration.TASKANA_SCHEMA_VERSION
|
||||||
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.0.0', CURRENT_TIMESTAMP);
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
CREATE TABLE CLASSIFICATION(
|
CREATE TABLE CLASSIFICATION(
|
||||||
ID VARCHAR(40) NOT NULL,
|
ID VARCHAR(40) NOT NULL,
|
||||||
|
|
@ -168,8 +168,8 @@ CREATE TABLE ATTACHMENT(
|
||||||
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
CLASSIFICATION_KEY VARCHAR(32) NULL,
|
||||||
CLASSIFICATION_ID VARCHAR(40) NULL,
|
CLASSIFICATION_ID VARCHAR(40) NULL,
|
||||||
REF_COMPANY VARCHAR(32) NOT NULL,
|
REF_COMPANY VARCHAR(32) NOT NULL,
|
||||||
REF_SYSTEM VARCHAR(32) NOT NULL,
|
REF_SYSTEM VARCHAR(32),
|
||||||
REF_INSTANCE VARCHAR(32) NOT NULL,
|
REF_INSTANCE VARCHAR(32),
|
||||||
REF_TYPE VARCHAR(32) NOT NULL,
|
REF_TYPE VARCHAR(32) NOT NULL,
|
||||||
REF_VALUE VARCHAR(128) NOT NULL,
|
REF_VALUE VARCHAR(128) NOT NULL,
|
||||||
CHANNEL VARCHAR(64) NULL,
|
CHANNEL VARCHAR(64) NULL,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- this script updates the tables TASKANA_SCHEMA_VERSION and ATTACHMENT.
|
||||||
|
|
||||||
|
SET search_path = %schemaName%;
|
||||||
|
|
||||||
|
INSERT INTO TASKANA_SCHEMA_VERSION (VERSION, CREATED) VALUES ('4.3.0', CURRENT_TIMESTAMP);
|
||||||
|
|
||||||
|
ALTER TABLE ATTACHMENT ALTER COLUMN REF_SYSTEM DROP NOT NULL, ALTER COLUMN REF_INSTANCE DROP NOT NULL;
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-parent</artifactId>
|
<artifactId>taskana-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
<artifactId>taskana-history-parent</artifactId>
|
<artifactId>taskana-history-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
<artifactId>taskana-history-parent</artifactId>
|
<artifactId>taskana-history-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import acceptance.AbstractAccTest;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
|
@ -382,14 +383,15 @@ class HistoryCleanupJobAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(30);
|
assertThat(jobsToRun).hasSize(30);
|
||||||
|
|
||||||
|
List<ScheduledJob> historyCleanupJobs =
|
||||||
|
jobsToRun.stream()
|
||||||
|
.filter(scheduledJob -> scheduledJob.getType().equals(Type.HISTORYCLEANUPJOB))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
HistoryCleanupJob.initializeSchedule(taskanaEngine);
|
HistoryCleanupJob.initializeSchedule(taskanaEngine);
|
||||||
|
|
||||||
jobsToRun = getJobMapper().findJobsToRun();
|
jobsToRun = getJobMapper().findJobsToRun();
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(20);
|
assertThat(jobsToRun).doesNotContainAnyElementsOf(historyCleanupJobs);
|
||||||
|
|
||||||
assertThat(jobsToRun)
|
|
||||||
.extracting(ScheduledJob::getType)
|
|
||||||
.containsOnly(Type.CLASSIFICATIONCHANGEDJOB, Type.UPDATETASKSJOB);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import acceptance.AbstractAccTest;
|
import acceptance.AbstractAccTest;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
|
@ -54,7 +55,7 @@ class SimpleHistoryServiceImplTest {
|
||||||
@Mock private SqlSession sqlSessionMock;
|
@Mock private SqlSession sqlSessionMock;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testInitializeSimpleHistoryService() {
|
void testInitializeSimpleHistoryService() throws SQLException {
|
||||||
when(sqlSessionManagerMock.getMapper(TaskHistoryEventMapper.class))
|
when(sqlSessionManagerMock.getMapper(TaskHistoryEventMapper.class))
|
||||||
.thenReturn(taskHistoryEventMapperMock);
|
.thenReturn(taskHistoryEventMapperMock);
|
||||||
when(sqlSessionManagerMock.getMapper(WorkbasketHistoryEventMapper.class))
|
when(sqlSessionManagerMock.getMapper(WorkbasketHistoryEventMapper.class))
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
<artifactId>taskana-history-parent</artifactId>
|
<artifactId>taskana-history-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.simplehistory.rest;
|
package pro.taskana.simplehistory.rest;
|
||||||
|
|
||||||
import java.beans.ConstructorProperties;
|
import java.beans.ConstructorProperties;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -44,7 +45,7 @@ public class TaskHistoryEventController {
|
||||||
public TaskHistoryEventController(
|
public TaskHistoryEventController(
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration,
|
TaskanaEngineConfiguration taskanaEngineConfiguration,
|
||||||
SimpleHistoryServiceImpl simpleHistoryServiceImpl,
|
SimpleHistoryServiceImpl simpleHistoryServiceImpl,
|
||||||
TaskHistoryEventRepresentationModelAssembler assembler) {
|
TaskHistoryEventRepresentationModelAssembler assembler) throws SQLException {
|
||||||
|
|
||||||
this.simpleHistoryService = simpleHistoryServiceImpl;
|
this.simpleHistoryService = simpleHistoryServiceImpl;
|
||||||
this.simpleHistoryService.initialize(taskanaEngineConfiguration.buildTaskanaEngine());
|
this.simpleHistoryService.initialize(taskanaEngineConfiguration.buildTaskanaEngine());
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-parent</artifactId>
|
<artifactId>taskana-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-lib-parent</artifactId>
|
<artifactId>taskana-lib-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-lib-parent</artifactId>
|
<artifactId>taskana-lib-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public class TaskanaProducers {
|
||||||
|
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
@Produces
|
@Produces
|
||||||
public TaskanaEngine generateTaskEngine() {
|
public TaskanaEngine generateTaskEngine() throws SQLException {
|
||||||
return taskanaEngineConfiguration.buildTaskanaEngine();
|
return taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-lib-parent</artifactId>
|
<artifactId>taskana-lib-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@ import pro.taskana.common.api.exceptions.SystemException;
|
||||||
import pro.taskana.common.api.exceptions.WrongCustomHolidayFormatException;
|
import pro.taskana.common.api.exceptions.WrongCustomHolidayFormatException;
|
||||||
import pro.taskana.common.internal.TaskanaEngineImpl;
|
import pro.taskana.common.internal.TaskanaEngineImpl;
|
||||||
import pro.taskana.common.internal.configuration.DB;
|
import pro.taskana.common.internal.configuration.DB;
|
||||||
import pro.taskana.common.internal.configuration.DbSchemaCreator;
|
|
||||||
import pro.taskana.common.internal.configuration.SecurityVerifier;
|
|
||||||
import pro.taskana.common.internal.util.CheckedFunction;
|
import pro.taskana.common.internal.util.CheckedFunction;
|
||||||
import pro.taskana.common.internal.util.Pair;
|
import pro.taskana.common.internal.util.Pair;
|
||||||
|
|
||||||
|
|
@ -53,8 +51,6 @@ public class TaskanaEngineConfiguration {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineConfiguration.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineConfiguration.class);
|
||||||
|
|
||||||
// must match the VERSION value in table
|
|
||||||
private static final String TASKANA_SCHEMA_VERSION = "4.0.0";
|
|
||||||
private static final String TASKANA_PROPERTIES = "/taskana.properties";
|
private static final String TASKANA_PROPERTIES = "/taskana.properties";
|
||||||
private static final String TASKANA_PROPERTY_SEPARATOR = "|";
|
private static final String TASKANA_PROPERTY_SEPARATOR = "|";
|
||||||
private static final String TASKANA_JOB_BATCH_SIZE = "taskana.jobs.batchSize";
|
private static final String TASKANA_JOB_BATCH_SIZE = "taskana.jobs.batchSize";
|
||||||
|
|
@ -84,7 +80,6 @@ public class TaskanaEngineConfiguration {
|
||||||
protected String propertiesFileName = TASKANA_PROPERTIES;
|
protected String propertiesFileName = TASKANA_PROPERTIES;
|
||||||
// Taskana datasource configuration
|
// Taskana datasource configuration
|
||||||
protected DataSource dataSource;
|
protected DataSource dataSource;
|
||||||
protected DbSchemaCreator dbSchemaCreator;
|
|
||||||
protected String schemaName;
|
protected String schemaName;
|
||||||
// Taskana role configuration
|
// Taskana role configuration
|
||||||
protected String propertiesSeparator = TASKANA_PROPERTY_SEPARATOR;
|
protected String propertiesSeparator = TASKANA_PROPERTY_SEPARATOR;
|
||||||
|
|
@ -92,7 +87,6 @@ public class TaskanaEngineConfiguration {
|
||||||
// global switch to enable JAAS based authentication and Taskana
|
// global switch to enable JAAS based authentication and Taskana
|
||||||
// authorizations
|
// authorizations
|
||||||
protected boolean securityEnabled;
|
protected boolean securityEnabled;
|
||||||
protected SecurityVerifier securityVerifier;
|
|
||||||
protected boolean useManagedTransactions;
|
protected boolean useManagedTransactions;
|
||||||
// List of configured domain names
|
// List of configured domain names
|
||||||
protected List<String> domains = new ArrayList<>();
|
protected List<String> domains = new ArrayList<>();
|
||||||
|
|
@ -113,8 +107,7 @@ public class TaskanaEngineConfiguration {
|
||||||
private boolean taskCleanupJobAllCompletedSameParentBusiness = true;
|
private boolean taskCleanupJobAllCompletedSameParentBusiness = true;
|
||||||
|
|
||||||
public TaskanaEngineConfiguration(
|
public TaskanaEngineConfiguration(
|
||||||
DataSource dataSource, boolean useManagedTransactions, String schemaName)
|
DataSource dataSource, boolean useManagedTransactions, String schemaName) {
|
||||||
throws SQLException {
|
|
||||||
this(dataSource, useManagedTransactions, true, schemaName);
|
this(dataSource, useManagedTransactions, true, schemaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,8 +115,7 @@ public class TaskanaEngineConfiguration {
|
||||||
DataSource dataSource,
|
DataSource dataSource,
|
||||||
boolean useManagedTransactions,
|
boolean useManagedTransactions,
|
||||||
boolean securityEnabled,
|
boolean securityEnabled,
|
||||||
String schemaName)
|
String schemaName) {
|
||||||
throws SQLException {
|
|
||||||
this(dataSource, useManagedTransactions, securityEnabled, null, null, schemaName);
|
this(dataSource, useManagedTransactions, securityEnabled, null, null, schemaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,8 +125,7 @@ public class TaskanaEngineConfiguration {
|
||||||
boolean securityEnabled,
|
boolean securityEnabled,
|
||||||
String propertiesFileName,
|
String propertiesFileName,
|
||||||
String propertySeparator,
|
String propertySeparator,
|
||||||
String schemaName)
|
String schemaName) {
|
||||||
throws SQLException {
|
|
||||||
this.useManagedTransactions = useManagedTransactions;
|
this.useManagedTransactions = useManagedTransactions;
|
||||||
this.securityEnabled = securityEnabled;
|
this.securityEnabled = securityEnabled;
|
||||||
|
|
||||||
|
|
@ -155,18 +146,6 @@ public class TaskanaEngineConfiguration {
|
||||||
|
|
||||||
initSchemaName(schemaName);
|
initSchemaName(schemaName);
|
||||||
initTaskanaProperties(this.propertiesFileName, this.propertiesSeparator);
|
initTaskanaProperties(this.propertiesFileName, this.propertiesSeparator);
|
||||||
|
|
||||||
dbSchemaCreator = new DbSchemaCreator(this.dataSource, this.getSchemaName());
|
|
||||||
dbSchemaCreator.run();
|
|
||||||
|
|
||||||
if (!dbSchemaCreator.isValidSchemaVersion(TASKANA_SCHEMA_VERSION)) {
|
|
||||||
throw new SystemException(
|
|
||||||
"The Database Schema Version doesn't match the expected version "
|
|
||||||
+ TASKANA_SCHEMA_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
securityVerifier = new SecurityVerifier(this.dataSource, this.getSchemaName());
|
|
||||||
securityVerifier.checkSecureAccess(securityEnabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initTaskanaProperties(String propertiesFile, String separator) {
|
public void initTaskanaProperties(String propertiesFile, String separator) {
|
||||||
|
|
@ -210,8 +189,9 @@ public class TaskanaEngineConfiguration {
|
||||||
* This method creates the TaskanaEngine without an sqlSessionFactory.
|
* This method creates the TaskanaEngine without an sqlSessionFactory.
|
||||||
*
|
*
|
||||||
* @return the TaskanaEngine
|
* @return the TaskanaEngine
|
||||||
|
* @throws SQLException if a database access error occurs
|
||||||
*/
|
*/
|
||||||
public TaskanaEngine buildTaskanaEngine() {
|
public TaskanaEngine buildTaskanaEngine() throws SQLException {
|
||||||
return TaskanaEngineImpl.createTaskanaEngine(this);
|
return TaskanaEngineImpl.createTaskanaEngine(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -491,8 +471,9 @@ public class TaskanaEngineConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
String databaseProductName = connection.getMetaData().getDatabaseProductName();
|
String databaseProductId =
|
||||||
if (DB.isPostgreSql(databaseProductName)) {
|
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
||||||
|
if (DB.isPostgres(databaseProductId)) {
|
||||||
this.schemaName = this.schemaName.toLowerCase();
|
this.schemaName = this.schemaName.toLowerCase();
|
||||||
} else {
|
} else {
|
||||||
this.schemaName = this.schemaName.toUpperCase();
|
this.schemaName = this.schemaName.toUpperCase();
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
||||||
import pro.taskana.common.api.security.CurrentUserContext;
|
import pro.taskana.common.api.security.CurrentUserContext;
|
||||||
import pro.taskana.common.api.security.GroupPrincipal;
|
import pro.taskana.common.api.security.GroupPrincipal;
|
||||||
import pro.taskana.common.internal.configuration.DB;
|
import pro.taskana.common.internal.configuration.DB;
|
||||||
|
import pro.taskana.common.internal.configuration.DbSchemaCreator;
|
||||||
|
import pro.taskana.common.internal.configuration.SecurityVerifier;
|
||||||
import pro.taskana.common.internal.persistence.InstantTypeHandler;
|
import pro.taskana.common.internal.persistence.InstantTypeHandler;
|
||||||
import pro.taskana.common.internal.persistence.MapTypeHandler;
|
import pro.taskana.common.internal.persistence.MapTypeHandler;
|
||||||
import pro.taskana.common.internal.security.CurrentUserContextImpl;
|
import pro.taskana.common.internal.security.CurrentUserContextImpl;
|
||||||
|
|
@ -70,7 +72,8 @@ import pro.taskana.workbasket.internal.WorkbasketServiceImpl;
|
||||||
/** This is the implementation of TaskanaEngine. */
|
/** This is the implementation of TaskanaEngine. */
|
||||||
public class TaskanaEngineImpl implements TaskanaEngine {
|
public class TaskanaEngineImpl implements TaskanaEngine {
|
||||||
|
|
||||||
private static final String DEFAULT = "default";
|
// must match the VERSION value in table
|
||||||
|
private static final String TASKANA_SCHEMA_VERSION = "4.0.0";
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineImpl.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineImpl.class);
|
||||||
private static final SessionStack SESSION_STACK = new SessionStack();
|
private static final SessionStack SESSION_STACK = new SessionStack();
|
||||||
private final TaskRoutingManager taskRoutingManager;
|
private final TaskRoutingManager taskRoutingManager;
|
||||||
|
|
@ -85,10 +88,13 @@ public class TaskanaEngineImpl implements TaskanaEngine {
|
||||||
protected ConnectionManagementMode mode = ConnectionManagementMode.PARTICIPATE;
|
protected ConnectionManagementMode mode = ConnectionManagementMode.PARTICIPATE;
|
||||||
protected Connection connection = null;
|
protected Connection connection = null;
|
||||||
|
|
||||||
protected TaskanaEngineImpl(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
protected TaskanaEngineImpl(TaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||||
|
throws SQLException {
|
||||||
this.taskanaEngineConfiguration = taskanaEngineConfiguration;
|
this.taskanaEngineConfiguration = taskanaEngineConfiguration;
|
||||||
createTransactionFactory(taskanaEngineConfiguration.getUseManagedTransactions());
|
createTransactionFactory(taskanaEngineConfiguration.getUseManagedTransactions());
|
||||||
this.sessionManager = createSqlSessionManager();
|
this.sessionManager = createSqlSessionManager();
|
||||||
|
initializeDbSchema(taskanaEngineConfiguration);
|
||||||
|
|
||||||
historyEventManager = HistoryEventManager.getInstance(this);
|
historyEventManager = HistoryEventManager.getInstance(this);
|
||||||
taskRoutingManager = TaskRoutingManager.getInstance(this);
|
taskRoutingManager = TaskRoutingManager.getInstance(this);
|
||||||
createTaskPreprocessorManager = CreateTaskPreprocessorManager.getInstance();
|
createTaskPreprocessorManager = CreateTaskPreprocessorManager.getInstance();
|
||||||
|
|
@ -103,7 +109,7 @@ public class TaskanaEngineImpl implements TaskanaEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TaskanaEngine createTaskanaEngine(
|
public static TaskanaEngine createTaskanaEngine(
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
TaskanaEngineConfiguration taskanaEngineConfiguration) throws SQLException {
|
||||||
return new TaskanaEngineImpl(taskanaEngineConfiguration);
|
return new TaskanaEngineImpl(taskanaEngineConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,13 +259,12 @@ public class TaskanaEngineImpl implements TaskanaEngine {
|
||||||
protected SqlSessionManager createSqlSessionManager() {
|
protected SqlSessionManager createSqlSessionManager() {
|
||||||
Environment environment =
|
Environment environment =
|
||||||
new Environment(
|
new Environment(
|
||||||
DEFAULT, this.transactionFactory, taskanaEngineConfiguration.getDatasource());
|
"default", this.transactionFactory, taskanaEngineConfiguration.getDatasource());
|
||||||
Configuration configuration = new Configuration(environment);
|
Configuration configuration = new Configuration(environment);
|
||||||
|
|
||||||
// set databaseId
|
// set databaseId
|
||||||
String databaseProductName;
|
|
||||||
try (Connection con = taskanaEngineConfiguration.getDatasource().getConnection()) {
|
try (Connection con = taskanaEngineConfiguration.getDatasource().getConnection()) {
|
||||||
databaseProductName = con.getMetaData().getDatabaseProductName();
|
String databaseProductName = con.getMetaData().getDatabaseProductName();
|
||||||
String databaseProductId = DB.getDatabaseProductId(databaseProductName);
|
String databaseProductId = DB.getDatabaseProductId(databaseProductName);
|
||||||
configuration.setDatabaseId(databaseProductId);
|
configuration.setDatabaseId(databaseProductId);
|
||||||
|
|
||||||
|
|
@ -292,6 +297,23 @@ public class TaskanaEngineImpl implements TaskanaEngine {
|
||||||
return SqlSessionManager.newInstance(localSessionFactory);
|
return SqlSessionManager.newInstance(localSessionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeDbSchema(TaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||||
|
throws SQLException {
|
||||||
|
DbSchemaCreator dbSchemaCreator =
|
||||||
|
new DbSchemaCreator(
|
||||||
|
taskanaEngineConfiguration.getDatasource(), taskanaEngineConfiguration.getSchemaName());
|
||||||
|
dbSchemaCreator.run();
|
||||||
|
|
||||||
|
if (!dbSchemaCreator.isValidSchemaVersion(TASKANA_SCHEMA_VERSION)) {
|
||||||
|
throw new SystemException(
|
||||||
|
"The Database Schema Version doesn't match the expected minimal version "
|
||||||
|
+ TASKANA_SCHEMA_VERSION);
|
||||||
|
}
|
||||||
|
new SecurityVerifier(
|
||||||
|
taskanaEngineConfiguration.getDatasource(), taskanaEngineConfiguration.getSchemaName())
|
||||||
|
.checkSecureAccess(taskanaEngineConfiguration.isSecurityEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates the MyBatis transaction factory.
|
* creates the MyBatis transaction factory.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -710,7 +710,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskQuery orderByClassificationKey(SortDirection sortDirection) {
|
public TaskQuery orderByClassificationKey(SortDirection sortDirection) {
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId())
|
return DB.isDb2(getDatabaseId())
|
||||||
? addOrderCriteria("TCLASSIFICATION_KEY", sortDirection)
|
? addOrderCriteria("TCLASSIFICATION_KEY", sortDirection)
|
||||||
: addOrderCriteria("t.CLASSIFICATION_KEY", sortDirection);
|
: addOrderCriteria("t.CLASSIFICATION_KEY", sortDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -719,7 +719,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
public TaskQuery orderByClassificationName(SortDirection sortDirection) {
|
public TaskQuery orderByClassificationName(SortDirection sortDirection) {
|
||||||
joinWithClassifications = true;
|
joinWithClassifications = true;
|
||||||
addClassificationNameToSelectClauseForOrdering = true;
|
addClassificationNameToSelectClauseForOrdering = true;
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId())
|
return DB.isDb2(getDatabaseId())
|
||||||
? addOrderCriteria("CNAME", sortDirection)
|
? addOrderCriteria("CNAME", sortDirection)
|
||||||
: addOrderCriteria("c.NAME", sortDirection);
|
: addOrderCriteria("c.NAME", sortDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -866,7 +866,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
public TaskQuery orderByAttachmentClassificationKey(SortDirection sortDirection) {
|
public TaskQuery orderByAttachmentClassificationKey(SortDirection sortDirection) {
|
||||||
joinWithAttachments = true;
|
joinWithAttachments = true;
|
||||||
addAttachmentColumnsToSelectClauseForOrdering = true;
|
addAttachmentColumnsToSelectClauseForOrdering = true;
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId())
|
return DB.isDb2(getDatabaseId())
|
||||||
? addOrderCriteria("ACLASSIFICATION_KEY", sortDirection)
|
? addOrderCriteria("ACLASSIFICATION_KEY", sortDirection)
|
||||||
: addOrderCriteria("a.CLASSIFICATION_KEY", sortDirection);
|
: addOrderCriteria("a.CLASSIFICATION_KEY", sortDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -875,7 +875,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
public TaskQuery orderByAttachmentClassificationName(SortDirection sortDirection) {
|
public TaskQuery orderByAttachmentClassificationName(SortDirection sortDirection) {
|
||||||
joinWithAttachments = true;
|
joinWithAttachments = true;
|
||||||
addAttachmentClassificationNameToSelectClauseForOrdering = true;
|
addAttachmentClassificationNameToSelectClauseForOrdering = true;
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId())
|
return DB.isDb2(getDatabaseId())
|
||||||
? addOrderCriteria("ACNAME", sortDirection)
|
? addOrderCriteria("ACNAME", sortDirection)
|
||||||
: addOrderCriteria("ac.NAME", sortDirection);
|
: addOrderCriteria("ac.NAME", sortDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -884,7 +884,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
public TaskQuery orderByAttachmentClassificationId(SortDirection sortDirection) {
|
public TaskQuery orderByAttachmentClassificationId(SortDirection sortDirection) {
|
||||||
joinWithAttachments = true;
|
joinWithAttachments = true;
|
||||||
addAttachmentColumnsToSelectClauseForOrdering = true;
|
addAttachmentColumnsToSelectClauseForOrdering = true;
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId())
|
return DB.isDb2(getDatabaseId())
|
||||||
? addOrderCriteria("ACLASSIFICATION_ID", sortDirection)
|
? addOrderCriteria("ACLASSIFICATION_ID", sortDirection)
|
||||||
: addOrderCriteria("a.CLASSIFICATION_ID", sortDirection);
|
: addOrderCriteria("a.CLASSIFICATION_ID", sortDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -1059,7 +1059,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
// optimized query for db2 can't be used for now in case of selectAndClaim because of temporary
|
// optimized query for db2 can't be used for now in case of selectAndClaim because of temporary
|
||||||
// tables and the "for update" clause clashing in db2
|
// tables and the "for update" clause clashing in db2
|
||||||
public String getLinkToMapperScript() {
|
public String getLinkToMapperScript() {
|
||||||
if (DB.DB2.dbProductId.equals(getDatabaseId()) && !selectAndClaim) {
|
if (DB.isDb2(getDatabaseId()) && !selectAndClaim) {
|
||||||
return LINK_TO_MAPPER_DB2;
|
return LINK_TO_MAPPER_DB2;
|
||||||
} else {
|
} else {
|
||||||
return LINK_TO_MAPPER;
|
return LINK_TO_MAPPER;
|
||||||
|
|
@ -1067,7 +1067,7 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLinkToCounterTaskScript() {
|
public String getLinkToCounterTaskScript() {
|
||||||
return DB.DB2.dbProductId.equals(getDatabaseId()) ? LINK_TO_COUNTER_DB2 : LINK_TO_COUNTER;
|
return DB.isDb2(getDatabaseId()) ? LINK_TO_COUNTER_DB2 : LINK_TO_COUNTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseDistinctKeyword() {
|
public boolean isUseDistinctKeyword() {
|
||||||
|
|
|
||||||
|
|
@ -1068,7 +1068,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
Map<String, TaskSummaryImpl> taskSummaryMap =
|
Map<String, TaskSummaryImpl> taskSummaryMap =
|
||||||
getTasksToChange(taskIds).stream()
|
getTasksToChange(taskIds).stream()
|
||||||
.collect(Collectors.toMap(TaskSummary::getId, e -> (TaskSummaryImpl) e));
|
.collect(Collectors.toMap(TaskSummary::getId, TaskSummaryImpl.class::cast));
|
||||||
return taskIds.stream()
|
return taskIds.stream()
|
||||||
.map(id -> Pair.of(id, taskSummaryMap.get(id)))
|
.map(id -> Pair.of(id, taskSummaryMap.get(id)))
|
||||||
.filter(
|
.filter(
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
|
@ -25,10 +25,10 @@ class TaskanaSecurityConfigAccTest {
|
||||||
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
||||||
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
||||||
|
|
||||||
SampleDataGenerator sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
|
||||||
sampleDataGenerator.dropDb();
|
|
||||||
DbSchemaCreator dbSchemaCreator = new DbSchemaCreator(dataSource, schemaName);
|
DbSchemaCreator dbSchemaCreator = new DbSchemaCreator(dataSource, schemaName);
|
||||||
dbSchemaCreator.run();
|
dbSchemaCreator.run();
|
||||||
|
SampleDataGenerator sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
||||||
|
sampleDataGenerator.clearDb();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -37,17 +37,7 @@ class TaskanaSecurityConfigAccTest {
|
||||||
|
|
||||||
setSecurityFlag(true);
|
setSecurityFlag(true);
|
||||||
|
|
||||||
ThrowingCallable createUnsecuredTaskanaEngineConfiguration =
|
assertThatThrownBy(() -> createTaskanaEngine(false))
|
||||||
() -> {
|
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration =
|
|
||||||
new TaskanaEngineConfiguration(
|
|
||||||
TaskanaEngineTestConfiguration.getDataSource(),
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
TaskanaEngineTestConfiguration.getSchemaName());
|
|
||||||
};
|
|
||||||
|
|
||||||
assertThatThrownBy(createUnsecuredTaskanaEngineConfiguration)
|
|
||||||
.isInstanceOf(SystemException.class)
|
.isInstanceOf(SystemException.class)
|
||||||
.hasMessageContaining("Secured TASKANA mode is enforced, can't start in unsecured mode");
|
.hasMessageContaining("Secured TASKANA mode is enforced, can't start in unsecured mode");
|
||||||
}
|
}
|
||||||
|
|
@ -58,17 +48,8 @@ class TaskanaSecurityConfigAccTest {
|
||||||
|
|
||||||
setSecurityFlag(false);
|
setSecurityFlag(false);
|
||||||
|
|
||||||
ThrowingCallable createUnsecuredTaskanaEngineConfiguration =
|
|
||||||
() -> {
|
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration =
|
|
||||||
new TaskanaEngineConfiguration(
|
|
||||||
TaskanaEngineTestConfiguration.getDataSource(),
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
TaskanaEngineTestConfiguration.getSchemaName());
|
|
||||||
};
|
|
||||||
|
|
||||||
assertThatCode(createUnsecuredTaskanaEngineConfiguration).doesNotThrowAnyException();
|
assertThatCode(() -> createTaskanaEngine(false)).doesNotThrowAnyException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -77,17 +58,7 @@ class TaskanaSecurityConfigAccTest {
|
||||||
|
|
||||||
assertThat(retrieveSecurityFlag()).isNull();
|
assertThat(retrieveSecurityFlag()).isNull();
|
||||||
|
|
||||||
ThrowingCallable createUnsecuredTaskanaEngineConfiguration =
|
assertThatCode(() -> createTaskanaEngine(false)).doesNotThrowAnyException();
|
||||||
() -> {
|
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration =
|
|
||||||
new TaskanaEngineConfiguration(
|
|
||||||
TaskanaEngineTestConfiguration.getDataSource(),
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
TaskanaEngineTestConfiguration.getSchemaName());
|
|
||||||
};
|
|
||||||
|
|
||||||
assertThatCode(createUnsecuredTaskanaEngineConfiguration).doesNotThrowAnyException();
|
|
||||||
|
|
||||||
assertThat(retrieveSecurityFlag()).isFalse();
|
assertThat(retrieveSecurityFlag()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
@ -98,21 +69,20 @@ class TaskanaSecurityConfigAccTest {
|
||||||
|
|
||||||
assertThat(retrieveSecurityFlag()).isNull();
|
assertThat(retrieveSecurityFlag()).isNull();
|
||||||
|
|
||||||
ThrowingCallable createSecuredTaskanaEngineConfiguration =
|
assertThatCode(() -> createTaskanaEngine(true)).doesNotThrowAnyException();
|
||||||
() -> {
|
|
||||||
TaskanaEngineConfiguration taskanaEngineConfiguration =
|
|
||||||
new TaskanaEngineConfiguration(
|
|
||||||
TaskanaEngineTestConfiguration.getDataSource(),
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
TaskanaEngineTestConfiguration.getSchemaName());
|
|
||||||
};
|
|
||||||
|
|
||||||
assertThatCode(createSecuredTaskanaEngineConfiguration).doesNotThrowAnyException();
|
|
||||||
|
|
||||||
assertThat(retrieveSecurityFlag()).isTrue();
|
assertThat(retrieveSecurityFlag()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createTaskanaEngine(boolean securityEnabled) throws SQLException {
|
||||||
|
new TaskanaEngineConfiguration(
|
||||||
|
TaskanaEngineTestConfiguration.getDataSource(),
|
||||||
|
false,
|
||||||
|
securityEnabled,
|
||||||
|
TaskanaEngineTestConfiguration.getSchemaName())
|
||||||
|
.buildTaskanaEngine();
|
||||||
|
}
|
||||||
|
|
||||||
private Boolean retrieveSecurityFlag() throws Exception {
|
private Boolean retrieveSecurityFlag() throws Exception {
|
||||||
|
|
||||||
try (Connection connection = TaskanaEngineTestConfiguration.getDataSource().getConnection()) {
|
try (Connection connection = TaskanaEngineTestConfiguration.getDataSource().getConnection()) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import acceptance.AbstractAccTest;
|
import acceptance.AbstractAccTest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
|
@ -105,15 +106,16 @@ class TaskCleanupJobAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(30);
|
assertThat(jobsToRun).hasSize(30);
|
||||||
|
|
||||||
|
List<ScheduledJob> taskCleanupJobs =
|
||||||
|
jobsToRun.stream()
|
||||||
|
.filter(scheduledJob -> scheduledJob.getType().equals(Type.TASKCLEANUPJOB))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
TaskCleanupJob.initializeSchedule(taskanaEngine);
|
TaskCleanupJob.initializeSchedule(taskanaEngine);
|
||||||
|
|
||||||
jobsToRun = getJobMapper().findJobsToRun();
|
jobsToRun = getJobMapper().findJobsToRun();
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(20);
|
assertThat(jobsToRun).doesNotContainAnyElementsOf(taskCleanupJobs);
|
||||||
|
|
||||||
assertThat(jobsToRun)
|
|
||||||
.extracting(ScheduledJob::getType)
|
|
||||||
.containsOnly(Type.CLASSIFICATIONCHANGEDJOB, Type.UPDATETASKSJOB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task createAndCompleteTask() throws Exception {
|
private Task createAndCompleteTask() throws Exception {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import acceptance.AbstractAccTest;
|
import acceptance.AbstractAccTest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
|
@ -105,15 +106,16 @@ class WorkbasketCleanupJobAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(30);
|
assertThat(jobsToRun).hasSize(30);
|
||||||
|
|
||||||
|
List<ScheduledJob> workbasketCleanupJobs =
|
||||||
|
jobsToRun.stream()
|
||||||
|
.filter(scheduledJob -> scheduledJob.getType().equals(Type.WORKBASKETCLEANUPJOB))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
WorkbasketCleanupJob.initializeSchedule(taskanaEngine);
|
WorkbasketCleanupJob.initializeSchedule(taskanaEngine);
|
||||||
|
|
||||||
jobsToRun = getJobMapper().findJobsToRun();
|
jobsToRun = getJobMapper().findJobsToRun();
|
||||||
|
|
||||||
assertThat(jobsToRun).hasSize(20);
|
assertThat(jobsToRun).doesNotContainAnyElementsOf(workbasketCleanupJobs);
|
||||||
|
|
||||||
assertThat(jobsToRun)
|
|
||||||
.extracting(ScheduledJob::getType)
|
|
||||||
.containsOnly(Type.CLASSIFICATIONCHANGEDJOB, Type.UPDATETASKSJOB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getNumberTaskNotCompleted(String workbasketId) {
|
private long getNumberTaskNotCompleted(String workbasketId) {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class GetWorkbasketAccTest extends AbstractAccTest {
|
||||||
assertThat(workbasket.getName()).isEqualTo("PPK User 2 KSC 1");
|
assertThat(workbasket.getName()).isEqualTo("PPK User 2 KSC 1");
|
||||||
assertThat(workbasket.getKey()).isEqualTo("USER-1-2");
|
assertThat(workbasket.getKey()).isEqualTo("USER-1-2");
|
||||||
assertThat(workbasket.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
assertThat(workbasket.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
||||||
assertThat(workbasket.getOwner()).isEqualTo("Peter Maier");
|
assertThat(workbasket.getOwner()).isEqualTo("user-1-2");
|
||||||
assertThat(workbasket.getOrgLevel1()).isEqualTo("versicherung");
|
assertThat(workbasket.getOrgLevel1()).isEqualTo("versicherung");
|
||||||
assertThat(workbasket.getOrgLevel2()).isEqualTo("abteilung");
|
assertThat(workbasket.getOrgLevel2()).isEqualTo("abteilung");
|
||||||
assertThat(workbasket.getOrgLevel3()).isEqualTo("projekt");
|
assertThat(workbasket.getOrgLevel3()).isEqualTo("projekt");
|
||||||
|
|
@ -64,7 +64,7 @@ class GetWorkbasketAccTest extends AbstractAccTest {
|
||||||
WORKBASKET_SERVICE.getWorkbasket("WBI:100000000000000000000000000000000007");
|
WORKBASKET_SERVICE.getWorkbasket("WBI:100000000000000000000000000000000007");
|
||||||
|
|
||||||
assertThat(retrievedWorkbasket).isNotNull();
|
assertThat(retrievedWorkbasket).isNotNull();
|
||||||
assertThat(retrievedWorkbasket.getOwner()).isEqualTo("Peter Maier");
|
assertThat(retrievedWorkbasket.getOwner()).isEqualTo("user-1-2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(user = "admin")
|
@WithAccessId(user = "admin")
|
||||||
|
|
@ -75,7 +75,7 @@ class GetWorkbasketAccTest extends AbstractAccTest {
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
Workbasket retrievedWorkbasket = WORKBASKET_SERVICE.getWorkbasket("USER-1-2", "DOMAIN_A");
|
Workbasket retrievedWorkbasket = WORKBASKET_SERVICE.getWorkbasket("USER-1-2", "DOMAIN_A");
|
||||||
assertThat(retrievedWorkbasket.getOwner()).isEqualTo("Peter Maier");
|
assertThat(retrievedWorkbasket.getOwner()).isEqualTo("user-1-2");
|
||||||
|
|
||||||
assertThat(retrievedWorkbasket).isNotNull();
|
assertThat(retrievedWorkbasket).isNotNull();
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ class GetWorkbasketAccTest extends AbstractAccTest {
|
||||||
assertThat(workbasket.getDescription()).isEqualTo("PPK User 2 KSC 1");
|
assertThat(workbasket.getDescription()).isEqualTo("PPK User 2 KSC 1");
|
||||||
assertThat(workbasket.getName()).isEqualTo("PPK User 2 KSC 1");
|
assertThat(workbasket.getName()).isEqualTo("PPK User 2 KSC 1");
|
||||||
assertThat(workbasket.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
assertThat(workbasket.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
||||||
assertThat(workbasket.getOwner()).isEqualTo("Peter Maier");
|
assertThat(workbasket.getOwner()).isEqualTo("user-1-2");
|
||||||
assertThat(workbasket.getOrgLevel1()).isEqualTo("versicherung");
|
assertThat(workbasket.getOrgLevel1()).isEqualTo("versicherung");
|
||||||
assertThat(workbasket.getOrgLevel2()).isEqualTo("abteilung");
|
assertThat(workbasket.getOrgLevel2()).isEqualTo("abteilung");
|
||||||
assertThat(workbasket.getOrgLevel3()).isEqualTo("projekt");
|
assertThat(workbasket.getOrgLevel3()).isEqualTo("projekt");
|
||||||
|
|
@ -135,7 +135,7 @@ class GetWorkbasketAccTest extends AbstractAccTest {
|
||||||
assertThat(workbasketSummary.getName()).isEqualTo("PPK User 2 KSC 1");
|
assertThat(workbasketSummary.getName()).isEqualTo("PPK User 2 KSC 1");
|
||||||
assertThat(workbasketSummary.getKey()).isEqualTo("USER-1-2");
|
assertThat(workbasketSummary.getKey()).isEqualTo("USER-1-2");
|
||||||
assertThat(workbasketSummary.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
assertThat(workbasketSummary.getType()).isEqualTo(WorkbasketType.PERSONAL);
|
||||||
assertThat(workbasketSummary.getOwner()).isEqualTo("Peter Maier");
|
assertThat(workbasketSummary.getOwner()).isEqualTo("user-1-2");
|
||||||
assertThat(workbasketSummary.getOrgLevel1()).isEqualTo("versicherung");
|
assertThat(workbasketSummary.getOrgLevel1()).isEqualTo("versicherung");
|
||||||
assertThat(workbasketSummary.getOrgLevel2()).isEqualTo("abteilung");
|
assertThat(workbasketSummary.getOrgLevel2()).isEqualTo("abteilung");
|
||||||
assertThat(workbasketSummary.getOrgLevel3()).isEqualTo("projekt");
|
assertThat(workbasketSummary.getOrgLevel3()).isEqualTo("projekt");
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ class QueryWorkbasketAccTest extends AbstractAccTest {
|
||||||
List<WorkbasketSummary> results =
|
List<WorkbasketSummary> results =
|
||||||
WORKBASKET_SERVICE
|
WORKBASKET_SERVICE
|
||||||
.createWorkbasketQuery()
|
.createWorkbasketQuery()
|
||||||
.ownerLike("%an%", "%te%")
|
.ownerLike("%1-2%")
|
||||||
.orderByOwner(ASCENDING)
|
.orderByOwner(ASCENDING)
|
||||||
.list();
|
.list();
|
||||||
assertThat(results).hasSize(1);
|
assertThat(results).hasSize(1);
|
||||||
|
|
@ -344,14 +344,14 @@ class QueryWorkbasketAccTest extends AbstractAccTest {
|
||||||
List<WorkbasketSummary> results =
|
List<WorkbasketSummary> results =
|
||||||
WORKBASKET_SERVICE
|
WORKBASKET_SERVICE
|
||||||
.createWorkbasketQuery()
|
.createWorkbasketQuery()
|
||||||
.ownerIn("owner0815")
|
.ownerIn("teamlead-1")
|
||||||
.orderByDomain(DESCENDING)
|
.orderByDomain(DESCENDING)
|
||||||
.list();
|
.list();
|
||||||
|
|
||||||
assertThat(results)
|
assertThat(results)
|
||||||
.extracting(WorkbasketSummary::getId)
|
.extracting(WorkbasketSummary::getId)
|
||||||
.containsExactly(
|
.containsExactly(
|
||||||
"WBI:100000000000000000000000000000000015", "WBI:100000000000000000000000000000000001");
|
"WBI:100000000000000000000000000000000001");
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithAccessId(user = "teamlead-1")
|
@WithAccessId(user = "teamlead-1")
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,12 @@ class PojoTest {
|
||||||
javaClass ->
|
javaClass ->
|
||||||
!javaClass.getSimpleName().equals("TaskHistoryEvent")
|
!javaClass.getSimpleName().equals("TaskHistoryEvent")
|
||||||
&& !javaClass.getSimpleName().equals("WorkbasketHistoryEvent")
|
&& !javaClass.getSimpleName().equals("WorkbasketHistoryEvent")
|
||||||
&& !javaClass.getSimpleName().equals("ClassificationHistoryEvent"))
|
&& !javaClass.getSimpleName().equals("ClassificationHistoryEvent")
|
||||||
|
&& !javaClass.getSimpleName().equals("ComparableVersion")
|
||||||
|
&& !javaClass.getSimpleName().equals("StringItem")
|
||||||
|
&& !javaClass.getSimpleName().equals("BigIntegerItem")
|
||||||
|
&& !javaClass.getSimpleName().equals("IntItem")
|
||||||
|
&& !javaClass.getSimpleName().equals("LongItem"))
|
||||||
.map(JavaClass::reflect)
|
.map(JavaClass::reflect)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class ClassificationServiceImplIntAutoCommitTest {
|
||||||
private ClassificationService classificationService;
|
private ClassificationService classificationService;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void beforeAll() throws Exception {
|
static void beforeAll() {
|
||||||
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
||||||
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
||||||
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
||||||
|
|
@ -41,7 +41,7 @@ class ClassificationServiceImplIntAutoCommitTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setup() {
|
void setup() throws Exception {
|
||||||
TaskanaEngine taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
TaskanaEngine taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
classificationService = taskanaEngine.getClassificationService();
|
classificationService = taskanaEngine.getClassificationService();
|
||||||
TaskanaEngineImpl taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
TaskanaEngineImpl taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public final class TaskanaEngineTestConfiguration {
|
||||||
private static final Logger LOGGER =
|
private static final Logger LOGGER =
|
||||||
LoggerFactory.getLogger(TaskanaEngineTestConfiguration.class);
|
LoggerFactory.getLogger(TaskanaEngineTestConfiguration.class);
|
||||||
private static final int POOL_TIME_TO_WAIT = 50;
|
private static final int POOL_TIME_TO_WAIT = 50;
|
||||||
private static DataSource dataSource;
|
private static final DataSource DATA_SOURCE;
|
||||||
private static String schemaName = null;
|
private static String schemaName = null;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
@ -25,9 +25,9 @@ public final class TaskanaEngineTestConfiguration {
|
||||||
String propertiesFileName = userHomeDirectroy + "/taskanaUnitTest.properties";
|
String propertiesFileName = userHomeDirectroy + "/taskanaUnitTest.properties";
|
||||||
File f = new File(propertiesFileName);
|
File f = new File(propertiesFileName);
|
||||||
if (f.exists() && !f.isDirectory()) {
|
if (f.exists() && !f.isDirectory()) {
|
||||||
dataSource = createDataSourceFromProperties(propertiesFileName);
|
DATA_SOURCE = createDataSourceFromProperties(propertiesFileName);
|
||||||
} else {
|
} else {
|
||||||
dataSource = createDefaultDataSource();
|
DATA_SOURCE = createDefaultDataSource();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ public final class TaskanaEngineTestConfiguration {
|
||||||
* @return dataSource for unit test
|
* @return dataSource for unit test
|
||||||
*/
|
*/
|
||||||
public static DataSource getDataSource() {
|
public static DataSource getDataSource() {
|
||||||
return dataSource;
|
return DATA_SOURCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class TaskServiceImplIntAutocommitTest {
|
||||||
private WorkbasketService workbasketService;
|
private WorkbasketService workbasketService;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void beforeAll() throws Exception {
|
static void beforeAll() {
|
||||||
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
DataSource dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
||||||
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
||||||
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
||||||
|
|
@ -63,7 +63,7 @@ class TaskServiceImplIntAutocommitTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setup() {
|
void setup() throws Exception {
|
||||||
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||||
taskanaEngineImpl.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
taskanaEngineImpl.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-lib-parent</artifactId>
|
<artifactId>taskana-lib-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,13 @@ public class TaskanaConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SpringTaskanaEngineConfiguration taskanaEngineConfiguration(DataSource dataSource)
|
public SpringTaskanaEngineConfiguration taskanaEngineConfiguration(DataSource dataSource) {
|
||||||
throws SQLException {
|
|
||||||
return new SpringTaskanaEngineConfiguration(dataSource, true, false, schemaName);
|
return new SpringTaskanaEngineConfiguration(dataSource, true, false, schemaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public TaskanaEngine taskanaEngine(SpringTaskanaEngineConfiguration taskanaEngineConfiguration) {
|
public TaskanaEngine taskanaEngine(SpringTaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||||
|
throws SQLException {
|
||||||
return taskanaEngineConfiguration.buildTaskanaEngine();
|
return taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-lib-parent</artifactId>
|
<artifactId>taskana-lib-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@ public class SpringTaskanaEngineConfiguration extends TaskanaEngineConfiguration
|
||||||
DataSource dataSource,
|
DataSource dataSource,
|
||||||
boolean useManagedTransactions,
|
boolean useManagedTransactions,
|
||||||
boolean securityEnabled,
|
boolean securityEnabled,
|
||||||
String schemaName)
|
String schemaName) {
|
||||||
throws SQLException {
|
|
||||||
super(dataSource, useManagedTransactions, securityEnabled, schemaName);
|
super(dataSource, useManagedTransactions, securityEnabled, schemaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,8 +23,7 @@ public class SpringTaskanaEngineConfiguration extends TaskanaEngineConfiguration
|
||||||
boolean securityEnabled,
|
boolean securityEnabled,
|
||||||
String propertiesFileName,
|
String propertiesFileName,
|
||||||
String propertiesSeparator,
|
String propertiesSeparator,
|
||||||
String schemaName)
|
String schemaName) {
|
||||||
throws SQLException {
|
|
||||||
super(
|
super(
|
||||||
dataSource,
|
dataSource,
|
||||||
useManagedTransactions,
|
useManagedTransactions,
|
||||||
|
|
@ -41,7 +39,7 @@ public class SpringTaskanaEngineConfiguration extends TaskanaEngineConfiguration
|
||||||
* @return the TaskanaEngine
|
* @return the TaskanaEngine
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TaskanaEngine buildTaskanaEngine() {
|
public TaskanaEngine buildTaskanaEngine() throws SQLException {
|
||||||
this.useManagedTransactions = true;
|
this.useManagedTransactions = true;
|
||||||
return new SpringTaskanaEngineImpl(this);
|
return new SpringTaskanaEngineImpl(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package pro.taskana.common.internal;
|
package pro.taskana.common.internal;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
|
import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
|
||||||
|
|
||||||
|
|
@ -8,7 +9,8 @@ import pro.taskana.SpringTaskanaEngineConfiguration;
|
||||||
/** This class configures the TaskanaEngine for spring. */
|
/** This class configures the TaskanaEngine for spring. */
|
||||||
public class SpringTaskanaEngineImpl extends TaskanaEngineImpl {
|
public class SpringTaskanaEngineImpl extends TaskanaEngineImpl {
|
||||||
|
|
||||||
public SpringTaskanaEngineImpl(SpringTaskanaEngineConfiguration taskanaEngineConfiguration) {
|
public SpringTaskanaEngineImpl(SpringTaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||||
|
throws SQLException {
|
||||||
super(taskanaEngineConfiguration);
|
super(taskanaEngineConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
8
pom.xml
8
pom.xml
|
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-parent</artifactId>
|
<artifactId>taskana-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
<version.json>20201115</version.json>
|
<version.json>20201115</version.json>
|
||||||
|
|
||||||
<!-- build dependencies -->
|
<!-- build dependencies -->
|
||||||
<version.checkstyle>8.38</version.checkstyle>
|
<version.checkstyle>8.39</version.checkstyle>
|
||||||
<version.maven.checkstyle>3.1.1</version.maven.checkstyle>
|
<version.maven.checkstyle>3.1.1</version.maven.checkstyle>
|
||||||
<version.maven.jar>3.2.0</version.maven.jar>
|
<version.maven.jar>3.2.0</version.maven.jar>
|
||||||
<version.maven.compiler>3.8.1</version.maven.compiler>
|
<version.maven.compiler>3.8.1</version.maven.compiler>
|
||||||
|
|
@ -63,8 +63,8 @@
|
||||||
<version.arquillian.managed.wildfly>3.0.1.Final</version.arquillian.managed.wildfly>
|
<version.arquillian.managed.wildfly>3.0.1.Final</version.arquillian.managed.wildfly>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
<version.archunit>0.14.1</version.archunit>
|
<version.archunit>0.15.0</version.archunit>
|
||||||
<version.equalsverifier>3.5</version.equalsverifier>
|
<version.equalsverifier>3.5.1</version.equalsverifier>
|
||||||
<version.openpojo>0.8.13</version.openpojo>
|
<version.openpojo>0.8.13</version.openpojo>
|
||||||
<version.jacoco>0.8.6</version.jacoco>
|
<version.jacoco>0.8.6</version.jacoco>
|
||||||
<version.slf4j-test>1.2.0</version.slf4j-test>
|
<version.slf4j-test>1.2.0</version.slf4j-test>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-parent</artifactId>
|
<artifactId>taskana-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-parent</artifactId>
|
<artifactId>taskana-rest-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-parent</artifactId>
|
<artifactId>taskana-rest-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,19 +132,6 @@ ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 1
|
||||||
cn: Elena Faul
|
cn: Elena Faul
|
||||||
userPassword: user-1-3
|
userPassword: user-1-3
|
||||||
|
|
||||||
dn: uid=Max,cn=users,OU=Test,O=TASKANA
|
|
||||||
objectclass: inetorgperson
|
|
||||||
objectclass: organizationalperson
|
|
||||||
objectclass: person
|
|
||||||
objectclass: top
|
|
||||||
givenName: Max
|
|
||||||
description: desc
|
|
||||||
uid: Max
|
|
||||||
sn: Mustermann
|
|
||||||
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 1
|
|
||||||
cn: Max Mustermann
|
|
||||||
userPassword: Max
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Users KSC 2
|
# Users KSC 2
|
||||||
########################
|
########################
|
||||||
|
|
@ -182,9 +169,9 @@ objectclass: top
|
||||||
givenName: Tim
|
givenName: Tim
|
||||||
description: desc
|
description: desc
|
||||||
uid: user-2-2
|
uid: user-2-2
|
||||||
sn: Schläfrig
|
sn:: U2NobMOkZnJpZw==
|
||||||
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
cn: Tim Schläfrig
|
cn:: VGltIFNjaGzDpGZyaWc=
|
||||||
userPassword: user-2-1
|
userPassword: user-2-1
|
||||||
|
|
||||||
dn: uid=user-2-3,cn=users,OU=Test,O=TASKANA
|
dn: uid=user-2-3,cn=users,OU=Test,O=TASKANA
|
||||||
|
|
@ -291,19 +278,6 @@ ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
||||||
cn: Johannes Renz
|
cn: Johannes Renz
|
||||||
userPassword: user-2-10
|
userPassword: user-2-10
|
||||||
|
|
||||||
dn: uid=owner0815,cn=users,OU=Test,O=TASKANA
|
|
||||||
objectclass: inetorgperson
|
|
||||||
objectclass: organizationalperson
|
|
||||||
objectclass: person
|
|
||||||
objectclass: top
|
|
||||||
givenName: Hans
|
|
||||||
description: desc
|
|
||||||
uid: owner0815
|
|
||||||
sn: Hafer
|
|
||||||
ou: Organisationseinheit/Organisationseinheit KSC/Organisationseinheit KSC 2
|
|
||||||
cn: Hans Hafer
|
|
||||||
userPassword: owner0815
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# Users Domäne B
|
# Users Domäne B
|
||||||
########################
|
########################
|
||||||
|
|
@ -373,6 +347,8 @@ objectclass: top
|
||||||
######################
|
######################
|
||||||
dn: cn=Organisationseinheit KSC,cn=organisation,OU=Test,O=TASKANA
|
dn: cn=Organisationseinheit KSC,cn=organisation,OU=Test,O=TASKANA
|
||||||
cn: Organisationseinheit KSC
|
cn: Organisationseinheit KSC
|
||||||
|
uniquemember: cn=Organisationseinheit KSC 1,cn=Organisationseinheit KSC,cn=organisation,OU=Test,O=TASKANA
|
||||||
|
uniquemember: cn=Organisationseinheit KSC 2,cn=Organisationseinheit KSC,cn=organisation,OU=Test,O=TASKANA
|
||||||
objectclass: groupofuniquenames
|
objectclass: groupofuniquenames
|
||||||
objectclass: top
|
objectclass: top
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-parent</artifactId>
|
<artifactId>taskana-rest-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import pro.taskana.workbasket.rest.models.WorkbasketSummaryRepresentationModel;
|
||||||
@TaskanaSpringBootTest
|
@TaskanaSpringBootTest
|
||||||
public class AbstractAccTest {
|
public class AbstractAccTest {
|
||||||
|
|
||||||
protected static final String DEPENDENCY_VERSION = "4.2.1-SNAPSHOT";
|
|
||||||
|
|
||||||
protected RestHelper restHelper = new RestHelper(8080);
|
protected RestHelper restHelper = new RestHelper(8080);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class TaskanaWildflyWithHistoryLoggerEnabledTest extends AbstractAccTest
|
||||||
MavenCoordinates.createCoordinate(
|
MavenCoordinates.createCoordinate(
|
||||||
"pro.taskana.history",
|
"pro.taskana.history",
|
||||||
"taskana-loghistory-provider",
|
"taskana-loghistory-provider",
|
||||||
DEPENDENCY_VERSION,
|
"${project.version}",
|
||||||
PackagingType.JAR,
|
PackagingType.JAR,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class TaskanaWildflyWithSimpleHistoryAndHistoryLoggerEnabledTest extends
|
||||||
MavenCoordinates.createCoordinate(
|
MavenCoordinates.createCoordinate(
|
||||||
"pro.taskana.history",
|
"pro.taskana.history",
|
||||||
"taskana-simplehistory-rest-spring",
|
"taskana-simplehistory-rest-spring",
|
||||||
DEPENDENCY_VERSION,
|
"${project.version}",
|
||||||
PackagingType.JAR,
|
PackagingType.JAR,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class TaskanaWildflyWithSimpleHistoryAndHistoryLoggerEnabledTest extends
|
||||||
MavenCoordinates.createCoordinate(
|
MavenCoordinates.createCoordinate(
|
||||||
"pro.taskana.history",
|
"pro.taskana.history",
|
||||||
"taskana-loghistory-provider",
|
"taskana-loghistory-provider",
|
||||||
DEPENDENCY_VERSION,
|
"${project.version}",
|
||||||
PackagingType.JAR,
|
PackagingType.JAR,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class TaskanaWildflyWithSimpleHistoryEnabledTest extends AbstractAccTest
|
||||||
MavenCoordinates.createCoordinate(
|
MavenCoordinates.createCoordinate(
|
||||||
"pro.taskana.history",
|
"pro.taskana.history",
|
||||||
"taskana-simplehistory-rest-spring",
|
"taskana-simplehistory-rest-spring",
|
||||||
DEPENDENCY_VERSION,
|
"${project.version}",
|
||||||
PackagingType.JAR,
|
PackagingType.JAR,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-parent</artifactId>
|
<artifactId>taskana-rest-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,14 +53,14 @@ public class RestConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public TaskanaEngine getTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
public TaskanaEngine getTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration)
|
||||||
|
throws SQLException {
|
||||||
return taskanaEngineConfiguration.buildTaskanaEngine();
|
return taskanaEngineConfiguration.buildTaskanaEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(TaskanaEngineConfiguration.class)
|
@ConditionalOnMissingBean(TaskanaEngineConfiguration.class)
|
||||||
public TaskanaEngineConfiguration taskanaEngineConfiguration(DataSource dataSource)
|
public TaskanaEngineConfiguration taskanaEngineConfiguration(DataSource dataSource) {
|
||||||
throws SQLException {
|
|
||||||
return new SpringTaskanaEngineConfiguration(dataSource, true, true, schemaName);
|
return new SpringTaskanaEngineConfiguration(dataSource, true, true, schemaName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package pro.taskana.common.rest;
|
package pro.taskana.common.rest;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assumptions.assumeThat;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
|
@ -8,11 +9,11 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.assertj.core.api.Assumptions;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import pro.taskana.SpringTaskanaEngineConfiguration;
|
|
||||||
import pro.taskana.common.internal.configuration.DB;
|
import pro.taskana.common.internal.configuration.DB;
|
||||||
import pro.taskana.common.test.rest.TaskanaSpringBootTest;
|
import pro.taskana.common.test.rest.TaskanaSpringBootTest;
|
||||||
import pro.taskana.sampledata.SampleDataGenerator;
|
import pro.taskana.sampledata.SampleDataGenerator;
|
||||||
|
|
@ -29,23 +30,26 @@ class SchemaNameCustomizableTest {
|
||||||
void resetDb() throws SQLException {
|
void resetDb() throws SQLException {
|
||||||
SampleDataGenerator sampleDataGenerator;
|
SampleDataGenerator sampleDataGenerator;
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
String databaseProductName = connection.getMetaData().getDatabaseProductName();
|
String databaseProductId =
|
||||||
isPostgres = DB.POSTGRESS.dbProductname.equals(databaseProductName);
|
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
||||||
|
|
||||||
if (isPostgres) {
|
if (DB.isPostgres(databaseProductId)) {
|
||||||
schemaName = schemaName.toLowerCase(Locale.ENGLISH);
|
schemaName = schemaName.toLowerCase(Locale.ENGLISH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new SpringTaskanaEngineConfiguration(dataSource, true, true, schemaName);
|
|
||||||
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
sampleDataGenerator = new SampleDataGenerator(dataSource, schemaName);
|
||||||
sampleDataGenerator.generateSampleData();
|
sampleDataGenerator.generateSampleData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@BeforeEach
|
||||||
void checkCustomSchemaNameIsDefined_Postgres() throws SQLException {
|
void setup() throws Exception {
|
||||||
resetDb();
|
resetDb();
|
||||||
Assumptions.assumeThat(isPostgres).isTrue();
|
}
|
||||||
;
|
|
||||||
|
@Disabled("sampledatagenerator cannot handle a different schema")
|
||||||
|
@Test
|
||||||
|
void checkCustomSchemaNameIsDefined_Postgres() throws Exception {
|
||||||
|
assumeThat(isPostgres).isTrue();
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
|
|
||||||
try (PreparedStatement preparedStatement =
|
try (PreparedStatement preparedStatement =
|
||||||
|
|
@ -64,10 +68,10 @@ class SchemaNameCustomizableTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Disabled("sampledatagenerator cannot handle a different schema")
|
||||||
@Test
|
@Test
|
||||||
void checkCustomSchemaNameIsDefined_OtherDb() throws SQLException {
|
void checkCustomSchemaNameIsDefined_OtherDb() throws Exception {
|
||||||
resetDb();
|
assumeThat(isPostgres).isTrue();
|
||||||
Assumptions.assumeThat(isPostgres).isTrue();
|
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
|
|
||||||
try (PreparedStatement preparedStatement =
|
try (PreparedStatement preparedStatement =
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ context('TASKANA Workbaskets', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
cy.get('[placeholder="Filter owner"]')
|
cy.get('[placeholder="Filter owner"]')
|
||||||
.type('owner0815')
|
.type('user-1-2')
|
||||||
.type('{enter}')
|
.type('{enter}')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// Length equal to 2 because the empty starting element of the list, only one ListEntry with values added
|
// Length equal to 2 because the empty starting element of the list, only one ListEntry with values added
|
||||||
|
|
@ -94,7 +94,7 @@ context('TASKANA Workbaskets', () => {
|
||||||
cy.saveWorkbaskets();
|
cy.saveWorkbaskets();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('should be possible to add new access', () => {
|
it('should be possible to add new access', () => {
|
||||||
cy.visitTestWorkbasket();
|
cy.visitTestWorkbasket();
|
||||||
cy.visitWorkbasketsAccessPage();
|
cy.visitWorkbasketsAccessPage();
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ context('TASKANA Workbaskets', () => {
|
||||||
cy.wait('@workbasketsDistributionTargets');
|
cy.wait('@workbasketsDistributionTargets');
|
||||||
cy.get('#dual-list-right > .dual-list.list-left > .infinite-scroll > .list-group').should('have.length', 1);
|
cy.get('#dual-list-right > .dual-list.list-left > .infinite-scroll > .list-group').should('have.length', 1);
|
||||||
cy.get('#dual-list-right > .dual-list.list-left > .infinite-scroll > .list-group')
|
cy.get('#dual-list-right > .dual-list.list-left > .infinite-scroll > .list-group')
|
||||||
.contains('owner0815')
|
.contains('user-1-3')
|
||||||
.should('exist');
|
.should('exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-parent</artifactId>
|
<artifactId>taskana-rest-parent</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.3.1-SNAPSHOT</version>
|
||||||
<relativePath>../rest/pom.xml</relativePath>
|
<relativePath>../rest/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue