class ClojureScriptEngine implements ScriptEngine {

  @Override
  public WorkerRunnable createWorkerRunnable() throws EngineException {

    final Object result;

    try {
      result = m_runnerFactory.call();
    }
    catch (final Exception e) {
      throw new ClojureScriptExecutionException(
        "Failed to create test runner function", e);
    }

    if (!(result instanceof Callable<?>)) {
      throw new ClojureScriptExecutionException(
        "The script should return a function that creates a test runner " +
        "function " +
        "[It returned " + describeResult(result) + "]");
    }

    return new ClojureWorkerRunnable((Callable<?>) result);
  }

  public  ClojureScriptEngine(final ScriptLocation script);

}