summaryrefslogtreecommitdiffstats
path: root/test/bindings/java
diff options
context:
space:
mode:
Diffstat (limited to 'test/bindings/java')
-rw-r--r--test/bindings/java/org/uscxml/examples/MonitorExample.java9
-rw-r--r--test/bindings/java/org/uscxml/helper/TestMonitor.java5
-rw-r--r--test/bindings/java/org/uscxml/tests/JexlDataModelTest.java2
3 files changed, 9 insertions, 7 deletions
diff --git a/test/bindings/java/org/uscxml/examples/MonitorExample.java b/test/bindings/java/org/uscxml/examples/MonitorExample.java
index 3e3781c..dc4cffa 100644
--- a/test/bindings/java/org/uscxml/examples/MonitorExample.java
+++ b/test/bindings/java/org/uscxml/examples/MonitorExample.java
@@ -3,6 +3,7 @@ package org.uscxml.examples;
import org.uscxml.Interpreter;
import org.uscxml.InterpreterException;
import org.uscxml.InterpreterState;
+import org.uscxml.StringVector;
import org.uscxml.helper.TestMonitor;
@@ -20,7 +21,7 @@ public class MonitorExample {
try {
TestMonitor tm = new TestMonitor();
Interpreter scxml = Interpreter.fromURL("https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/null/test436.scxml");
- scxml.setMonitor(tm);
+ scxml.addMonitor(tm);
InterpreterState state = InterpreterState.USCXML_UNDEF;
while((state = scxml.step()) != InterpreterState.USCXML_FINISHED) {
switch (state) {
@@ -29,8 +30,14 @@ public class MonitorExample {
case USCXML_IDLE:
case USCXML_INITIALIZED:
case USCXML_INSTANTIATED:
+ break;
case USCXML_MICROSTEPPED:
case USCXML_MACROSTEPPED:
+ StringVector states = scxml.getConfiguration();
+ for (int i = 0; i < states.size(); i++) {
+ System.out.print(states.get(i) + " ");
+ }
+ System.out.println();
case USCXML_CANCELLED:
break;
default:
diff --git a/test/bindings/java/org/uscxml/helper/TestMonitor.java b/test/bindings/java/org/uscxml/helper/TestMonitor.java
index f8289bd..2b71d82 100644
--- a/test/bindings/java/org/uscxml/helper/TestMonitor.java
+++ b/test/bindings/java/org/uscxml/helper/TestMonitor.java
@@ -1,6 +1,5 @@
package org.uscxml.helper;
-import org.uscxml.InterpreterIssue;
import org.uscxml.InterpreterMonitor;
import org.uscxml.StringList;
@@ -68,9 +67,5 @@ public class TestMonitor extends InterpreterMonitor {
System.out.println("afterInvoking: " + xpath + " " + invokeid);
}
- @Override
- public void reportIssue(InterpreterIssue issue) {
- System.out.println(issue);
- }
}
diff --git a/test/bindings/java/org/uscxml/tests/JexlDataModelTest.java b/test/bindings/java/org/uscxml/tests/JexlDataModelTest.java
index bb681b0..876feb2 100644
--- a/test/bindings/java/org/uscxml/tests/JexlDataModelTest.java
+++ b/test/bindings/java/org/uscxml/tests/JexlDataModelTest.java
@@ -37,7 +37,7 @@ public class JexlDataModelTest {
System.out.println(testName);
Interpreter scxml = Interpreter.fromURL(testName);
- scxml.setMonitor(tm);
+ scxml.addMonitor(tm);
while (scxml.step() != InterpreterState.USCXML_FINISHED) {
}