Skip to content

Commit

Permalink
Bump h2 from 1.4.197 to 2.2.220 (kiegroup#2302)
Browse files Browse the repository at this point in the history
* Bump h2 from 1.4.197 to 2.2.220
- remove MVCC

* [bump to h2-220]: add param NON_KEYWORDS=VALUE

* [bump h2 220] Fix container tests

* [bump h2-220] Parameterize drop script for other dbs

* [bump h2-220] Changes after review

---------

Co-authored-by: Gonzalo Muñoz <[email protected]>
  • Loading branch information
2 people authored and fjtirado committed Sep 15, 2023
1 parent 4633812 commit d9bde80
Show file tree
Hide file tree
Showing 31 changed files with 352 additions and 366 deletions.
4 changes: 3 additions & 1 deletion jbpm-audit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<properties>
<java.module.name>org.jbpm.process.audit</java.module.name>

<maven.jdbc.url>jdbc:h2:mem:bamTest;MVCC=TRUE</maven.jdbc.url>
<!-- appending ;MODE=LEGACY;OLD_INFORMATION_SCHEMA=TRUE to the jdbc url is necessary to workaround the problem reported at -->
<!-- https://github.com/h2database/h2database/issues/3325 -->
<maven.jdbc.url>jdbc:h2:mem:bamTest;MODE=LEGACY;NON_KEYWORDS=VALUE</maven.jdbc.url>
</properties>

<dependencies>
Expand Down
9 changes: 5 additions & 4 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import org.jbpm.workflow.instance.node.DynamicUtils;
import org.jbpm.workflow.instance.node.WorkItemNodeInstance;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand Down Expand Up @@ -115,8 +115,8 @@ public ActivityTest(boolean persistence) throws Exception {
super(persistence);
}

@BeforeClass
public static void setup() throws Exception {
@Before
public void setup() throws Exception {
setUpDataSource();
}

Expand All @@ -128,6 +128,7 @@ public void dispose() {
ksession = null;
}
if (ksession2 != null) {
abortProcessInstances(ksession2);
ksession2.dispose();
ksession2 = null;
}
Expand Down Expand Up @@ -687,7 +688,7 @@ public void testCallActivityMIWrongInputTypeStrictDisabled() throws Exception {
VariableScope.setVariableStrictOption(true);
}
}

@Test
public void testCallActivityMISequential() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-CallActivityMISequential.bpmn2",
Expand Down
23 changes: 12 additions & 11 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/CompensationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void prepare() {
@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand All @@ -118,7 +119,7 @@ public void dispose() {

@Test
public void compensationViaIntermediateThrowEventProcess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -135,7 +136,7 @@ public void compensationViaIntermediateThrowEventProcess() throws Exception {

@Test
public void compensationTwiceViaSignal() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -155,7 +156,7 @@ public void compensationTwiceViaSignal() throws Exception {

@Test
public void subprocessLevelCompensationViaEventSubProcess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -171,7 +172,7 @@ public void subprocessLevelCompensationViaEventSubProcess() throws Exception {

@Test
public void processLevelCompensationViaEventSubProcess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess2.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-EventSubProcess2.bpmn2");

Map<String, Object> params = new HashMap<String, Object>();
params.put("x", "0");
Expand All @@ -182,7 +183,7 @@ public void processLevelCompensationViaEventSubProcess() throws Exception {

@Test
public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-UserTaskBeforeAssociatedActivity.bpmn2");
ksession.addEventListener(LOGGING_EVENT_LISTENER);
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);
Expand All @@ -204,7 +205,7 @@ public void compensationOnlyAfterAssociatedActivityHasCompleted() throws Excepti

@Test
public void orderedCompensation() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ParallelOrderedCompensation-IntermediateThrowEvent.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand Down Expand Up @@ -242,7 +243,7 @@ public void orderedCompensation() throws Exception {

@Test
public void compensationInSubSubProcesses() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-InSubSubProcess.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-InSubSubProcess.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -263,7 +264,7 @@ public void compensationInSubSubProcesses() throws Exception {

@Test
public void specificCompensationOfASubProcess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-ThrowSpecificForSubProcess.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -286,7 +287,7 @@ public void specificCompensationOfASubProcess() throws Exception {
@Test
@Ignore
public void compensationViaCancellation() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-Compensation-IntermediateThrowEvent.bpmn2");
TestWorkItemHandler workItemHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", workItemHandler);

Expand All @@ -304,7 +305,7 @@ public void compensationViaCancellation() throws Exception {

@Test
public void compensationInvokingSubProcess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-UserTaskCompensation.bpmn2");
ksession = createKnowledgeSession("compensation/BPMN2-UserTaskCompensation.bpmn2");
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());

Map<String, Object> params = new HashMap<String, Object>();
Expand All @@ -323,7 +324,7 @@ public void compensationInvokingSubProcess() throws Exception {
*/
@Test
public void compensationWithReusableSubprocess() throws Exception {
KieSession ksession = createKnowledgeSession("compensation/BPMN2-Booking.bpmn2",
ksession = createKnowledgeSession("compensation/BPMN2-Booking.bpmn2",
"compensation/BPMN2-BookResource.bpmn2", "compensation/BPMN2-CancelResource.bpmn2");
ProcessInstance processInstance = ksession.startProcess("Booking");
assertProcessInstanceCompleted(processInstance.getId(), ksession);
Expand Down
1 change: 1 addition & 0 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/DataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public static void setup() throws Exception {
@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand Down
1 change: 1 addition & 0 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/EndEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public static void setup() throws Exception {
@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand Down
3 changes: 2 additions & 1 deletion jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ErrorEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ public ErrorEventTest(boolean persistence) {
public static void setup() throws Exception {
setUpDataSource();
}

@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static void setup() throws Exception {
@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand Down
1 change: 1 addition & 0 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static void setup() throws Exception {
@After
public void dispose() {
if (ksession != null) {
abortProcessInstances(ksession);
ksession.dispose();
ksession = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,6 @@ protected void abortProcessInstances(KieSession ksession) {
logService.findActiveProcessInstances().forEach(pi -> ksession.abortProcessInstance(pi.getId()));

} catch(Exception e) {

}
}
}
Expand Down
Loading

0 comments on commit d9bde80

Please sign in to comment.