summaryrefslogtreecommitdiffstats
path: root/test/bindings/java/org/uscxml/tests/MonitorExample.java
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-26 10:36:49 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-26 10:36:49 (GMT)
commit6e13c7b6e0888323223afd5d2e36e86243df57af (patch)
treef558fd45fa499c8bc95041554ecad6be1bf788c1 /test/bindings/java/org/uscxml/tests/MonitorExample.java
parentf6714b1484b641ea61053350b7d156d2da760b8b (diff)
downloaduscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.zip
uscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.tar.gz
uscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.tar.bz2
Minor polishing for Java bindings and first draft of JEXL datamodel
Diffstat (limited to 'test/bindings/java/org/uscxml/tests/MonitorExample.java')
-rw-r--r--test/bindings/java/org/uscxml/tests/MonitorExample.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/bindings/java/org/uscxml/tests/MonitorExample.java b/test/bindings/java/org/uscxml/tests/MonitorExample.java
new file mode 100644
index 0000000..2f0689a
--- /dev/null
+++ b/test/bindings/java/org/uscxml/tests/MonitorExample.java
@@ -0,0 +1,46 @@
+package org.uscxml.tests;
+
+import org.uscxml.Interpreter;
+import org.uscxml.InterpreterException;
+import org.uscxml.InterpreterState;
+import org.uscxml.tests.helper.TestMonitor;
+
+
+public class MonitorExample {
+
+ public static void main(String[] args) {
+
+ String uSCXMLLibPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava.jnilib";
+ if (System.getenv().containsKey("USCXML_JAVA_LIB")) {
+ uSCXMLLibPath = System.getenv("USCXML_JAVA_LIB");
+ }
+
+ System.load(uSCXMLLibPath);
+
+ 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);
+ InterpreterState state = InterpreterState.USCXML_UNDEF;
+ while((state = scxml.step()) != InterpreterState.USCXML_FINISHED) {
+ switch (state) {
+ case USCXML_FINISHED:
+ case USCXML_UNDEF:
+ case USCXML_IDLE:
+ case USCXML_INITIALIZED:
+ case USCXML_INSTANTIATED:
+ case USCXML_MICROSTEPPED:
+ case USCXML_MACROSTEPPED:
+ case USCXML_CANCELLED:
+ break;
+ default:
+ break;
+ }
+ }
+
+ } catch (InterpreterException e) {
+ e.printStackTrace();
+ }
+ }
+
+}