summaryrefslogtreecommitdiffstats
path: root/embedding/java/src/org/uscxml/tests/datamodel/TestJavaScriptDataModel.java
blob: 7cfa793e68f995869e46affcf931650285e0eb15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.uscxml.tests.datamodel;

import org.uscxml.Factory;
import org.uscxml.Interpreter;
import org.uscxml.InterpreterException;
import org.uscxml.datamodel.ecmascript.ECMAScriptDataModel;

public class TestJavaScriptDataModel {

	public static void main(String[] args) throws InterpreterException {
		// load JNI library from build directory
		System.load("/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava64.jnilib");

		// register java datamodel at factory
		ECMAScriptDataModel datamodel = new ECMAScriptDataModel();
		Factory.getInstance().registerDataModel(datamodel);

		// instantiate interpreter with document from file
		Interpreter interpreter = Interpreter
				.fromURI("/Users/sradomski/Documents/TK/Code/uscxml/test/uscxml/java/test-ecmascript-datamodel.scxml");

		// wait until interpreter has finished
		while (true)
			interpreter.interpret();
	}

}