Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-5921 Support For OracleDB Peristence #1612

Merged
merged 20 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ static List<String> getQueryFromFile(final String dbType, final String scriptNam
if (stream == null) {
throw new IllegalStateException(String.format("Impossible to find %s", fileName));
}
byte[] buffer = new byte[stream.available()];
int count = 0;
while ((count = stream.read(buffer)) > 0) {
}
byte[] buffer = stream.readAllBytes();
String[] statements = new String(buffer).split(";");
Scuilion marked this conversation as resolved.
Show resolved Hide resolved
return List.of(statements);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static Stream<DataSource> datasources() {
public static SecurityPolicy securityPolicy = SecurityPolicy.of(IdentityProviders.of("john"));

public static final String TEST_ID = "02ac3854-46ee-42b7-8b63-5186c9889d96";
private static final String ORACLE_TIMEZONE_PROPERTY = "oracle.jdbc.timezoneAsRegion";

@BeforeAll
public static void startContainerAndPublicPortIsAvailable() {
Expand All @@ -66,12 +67,14 @@ public static void startContainerAndPublicPortIsAvailable() {

ORACLE_CONTAINER.start();
ORACLE_DATA_SOURCE = getOracleDataSource(ORACLE_CONTAINER);
System.setProperty(ORACLE_TIMEZONE_PROPERTY, "false");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to have this for now, but there's another solution for such use cases: https://www.baeldung.com/java-system-rules-junit#working-with-system-properties

}

@AfterAll
public static void close() {
PG_CONTAINER.stop();
ORACLE_CONTAINER.stop();
System.clearProperty(ORACLE_TIMEZONE_PROPERTY);
}

public static BpmnProcess createProcess(TestProcessInstancesFactory factory, ProcessConfig config, String fileName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public KogitoOracleSqlContainer() {
withLogConsumer(getLogger());
withLogConsumer(new Slf4jLogConsumer(LOGGER));
withStartupTimeout(Constants.CONTAINER_START_TIMEOUT);
System.setProperty("oracle.jdbc.timezoneAsRegion", "false");
}

private Consumer<OutputFrame> getLogger() {
Expand Down