Package org.uscxml.tests

Source Code of org.uscxml.tests.TestExceptions

package org.uscxml.tests;

import org.uscxml.Interpreter;
import org.uscxml.InterpreterException;

public class TestExceptions {

  public static void main(String[] args) throws InterpreterException {
    System.load("/Users/sradomski/Documents/TK/Code/uscxml/build/cli/lib/libuscxmlNativeJava64.jnilib");
   
    String xml =
    "<scxml datamodel=\"ecmascript\">" +
    "  <state id=\"start\">" +
    "    <transition target=\"done\" />" +
    " </state>" +
    " <final id=\"done\" />" +
    "</scxml>";

    if (false) {
      // datamodel not available before first step -> dies with segfault
      Interpreter interpreter = Interpreter.fromXML(xml);
      System.out.println(interpreter.getDataModel().evalAsString("'FOO'"));
    }

    if (false) {
      // datamodel is available but syntactic ecmascript exception is not propagated
      Interpreter interpreter = Interpreter.fromXML(xml);
      interpreter.step();
      System.out.println(interpreter.getDataModel().evalAsString("'FOO' / qwer"));
    }

   
   
  }

}
TOP

Related Classes of org.uscxml.tests.TestExceptions

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.