You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "martinweiler (via GitHub)" <gi...@apache.org> on 2024/06/13 20:50:24 UTC

Re: [PR] [incubator-kie-issues-1303] BoundaryEvents v7 support [incubator-kie-kogito-runtimes]

martinweiler commented on code in PR #3549:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3549#discussion_r1638909264


##########
jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java:
##########
@@ -104,6 +111,33 @@ public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
      * TESTS!
      */
 
+    @Test
+    public void testBoundaryTimerCycleCron() {
+        Application app = ProcessTestHelper.newApplication();
+        NodeCountDownProcessEventListener listener = new NodeCountDownProcessEventListener("Send Update", 3);
+        ProcessTestHelper.registerProcessEventListener(app, listener);
+        org.kie.kogito.process.Process<BoundaryTimerCycleCronModel> definition = BoundaryTimerCycleCronProcess.newProcess(app);
+        org.kie.kogito.process.ProcessInstance<BoundaryTimerCycleCronModel> instance = definition.createInstance(definition.createModel());
+        instance.start();
+        listener.waitTillCompleted();
+        ProcessTestHelper.completeWorkItem(instance, "john", Collections.emptyMap());
+        assertThat(instance.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_COMPLETED);
+    }
+
+    @Test
+    public void testBoundaryTimerCycleCronVariable() {
+        Application app = ProcessTestHelper.newApplication();
+        ProcessCompletedCountDownProcessEventListener listener = new ProcessCompletedCountDownProcessEventListener();
+        ProcessTestHelper.registerProcessEventListener(app, listener);
+        org.kie.kogito.process.Process<BoundaryTimerCycleCronVariableModel> definition = BoundaryTimerCycleCronVariableProcess.newProcess(app);
+        BoundaryTimerCycleCronVariableModel model = definition.createModel();
+        model.setCronStr("PT1S");

Review Comment:
   I needed to change this to `R3/PT1S` (similar to the other test), otherwise the test fails with:
   ```
   [ERROR]   IntermediateEventTest.testBoundaryTimerCycleCronVariable:137 
   expected: 2
    but was: 5
   ```
   (I then also needed to add the `completeWorkItem` method to complete the process instance.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org