summaryrefslogtreecommitdiffstats
path: root/test/bindings/java/org/uscxml/apache
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-08-22 14:53:14 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-08-22 14:53:14 (GMT)
commite5782b214d839fe5d8b2f527ae331a246c6e012f (patch)
tree246e5bf1143b72267791e682b1ac37991d26adbe /test/bindings/java/org/uscxml/apache
parentdb8418fb9f733ca0147cc225ce0988d7866f15cd (diff)
downloaduscxml-e5782b214d839fe5d8b2f527ae331a246c6e012f.zip
uscxml-e5782b214d839fe5d8b2f527ae331a246c6e012f.tar.gz
uscxml-e5782b214d839fe5d8b2f527ae331a246c6e012f.tar.bz2
Progress on the apache-commons wrapper
Diffstat (limited to 'test/bindings/java/org/uscxml/apache')
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/Context.java7
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/Evaluator.java7
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/JexlEvaluator.java19
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/SCXML.java8
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLExecutor.java49
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLReader.java13
-rw-r--r--test/bindings/java/org/uscxml/apache/commons/scxml2/SimpleErrorReporter.java5
7 files changed, 108 insertions, 0 deletions
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/Context.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/Context.java
new file mode 100644
index 0000000..a0208c9
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/Context.java
@@ -0,0 +1,7 @@
+package org.uscxml.apache.commons.scxml2;
+
+import org.uscxml.DataModel;
+
+public class Context {
+ public DataModel dm = null;
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/Evaluator.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/Evaluator.java
new file mode 100644
index 0000000..5bd5642
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/Evaluator.java
@@ -0,0 +1,7 @@
+package org.uscxml.apache.commons.scxml2;
+
+public abstract class Evaluator {
+
+ public abstract Context newContext(Object object);
+
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/JexlEvaluator.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/JexlEvaluator.java
new file mode 100644
index 0000000..e50a259
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/JexlEvaluator.java
@@ -0,0 +1,19 @@
+package org.uscxml.apache.commons.scxml2;
+
+import org.uscxml.Factory;
+import org.uscxml.dm.jexl.JEXLDataModel;
+
+public class JexlEvaluator extends Evaluator {
+
+ public JexlEvaluator() {
+
+ }
+
+ @Override
+ public Context newContext(Object object) {
+ // TODO Auto-generated method stub
+ Context ctx = new Context();
+ ctx.dm = new JEXLDataModel();
+ return ctx;
+ }
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXML.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXML.java
new file mode 100644
index 0000000..67e5b1f
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXML.java
@@ -0,0 +1,8 @@
+package org.uscxml.apache.commons.scxml2;
+
+import java.net.URL;
+
+public class SCXML {
+ public URL url = null;
+
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLExecutor.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLExecutor.java
new file mode 100644
index 0000000..704e897
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLExecutor.java
@@ -0,0 +1,49 @@
+package org.uscxml.apache.commons.scxml2;
+
+import java.net.URL;
+
+import org.uscxml.ActionLanguage;
+import org.uscxml.Factory;
+import org.uscxml.Interpreter;
+import org.uscxml.InterpreterException;
+import org.uscxml.InterpreterState;
+import org.uscxml.helper.TestMonitor;
+
+public class SCXMLExecutor {
+
+ public Interpreter interpreter = null;
+ public URL sourceURL = null;
+ public ActionLanguage al = new ActionLanguage();
+
+ public SCXMLExecutor(Evaluator evaluator, Object object, SimpleErrorReporter simpleErrorReporter) {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void setStateMachine(SCXML scxml) {
+ sourceURL = scxml.url;
+ }
+
+ public void setRootContext(Context rootContext) {
+ al.setDataModel(rootContext.dm);
+ }
+
+ public void go() {
+ try {
+ interpreter = Interpreter.fromURL(sourceURL.toString());
+ interpreter.setActionLanguage(al);
+
+ TestMonitor tm = new TestMonitor();
+ interpreter.addMonitor(tm);
+
+ InterpreterState state = InterpreterState.USCXML_UNDEF;
+ while(state != InterpreterState.USCXML_FINISHED) {
+ interpreter.step();
+ }
+
+ } catch (InterpreterException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLReader.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLReader.java
new file mode 100644
index 0000000..45c2a54
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/SCXMLReader.java
@@ -0,0 +1,13 @@
+package org.uscxml.apache.commons.scxml2;
+
+import java.net.URL;
+
+public class SCXMLReader {
+
+ public static SCXML read(URL scxml) {
+ SCXML foo = new SCXML();
+ foo.url = scxml;
+ return foo;
+ }
+
+}
diff --git a/test/bindings/java/org/uscxml/apache/commons/scxml2/SimpleErrorReporter.java b/test/bindings/java/org/uscxml/apache/commons/scxml2/SimpleErrorReporter.java
new file mode 100644
index 0000000..06187f8
--- /dev/null
+++ b/test/bindings/java/org/uscxml/apache/commons/scxml2/SimpleErrorReporter.java
@@ -0,0 +1,5 @@
+package org.uscxml.apache.commons.scxml2;
+
+public class SimpleErrorReporter {
+
+}