summaryrefslogtreecommitdiffstats
path: root/embedding/java/src/org/uscxml/tests/datamodel/TestW3CECMA.java
blob: 89fcddd9c48cae744319a3a22bb840641fd54cd2 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.uscxml.tests.datamodel;

import java.io.File;

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

public class TestW3CECMA {

	public static String testDir = "/Users/sradomski/Documents/TK/Code/uscxml/test/w3c/ecma";
	
	public static void main(String[] args) throws InterpreterException {
		System.load("/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava64.jnilib");

		ECMAScriptDataModel datamodel = new ECMAScriptDataModel();
		Factory.getInstance().registerDataModel(datamodel);

//		while(true) {
//	    	System.out.println("### test235 #####");
//			Interpreter interpreter = Interpreter.fromURI("/Users/sradomski/Documents/TK/Code/uscxml/test/w3c/ecma/test144.scxml");
//			interpreter.interpret();
//		}
		
		File dir = new File(testDir);
		File[] filesList = dir.listFiles();
		for (File file : filesList) {
		    if (file.isFile() && file.getName().endsWith(".scxml")) {
		    	System.out.println("### " + file.getName() + " #####");
		    	Interpreter interpreter = Interpreter.fromURL(file.getAbsolutePath());
		    	interpreter.setCapabilities(1);
		    	interpreter.interpret();
		    }
		}

	}

}