throws InterruptedException, ExecutionException, NodeException
{
NodeEnvironment rootEnv = new NodeEnvironment();
rootEnv.setScriptTimeLimit(1, TimeUnit.SECONDS);
NodeScript script = rootEnv.createScript("endlesscpu.js",
new File("./target/test-classes/tests/endlesscpu.js"),
null);
try {
script.execute().get();
assertFalse("Expected a time out exception", true);
} catch (ExecutionException ee) {
assertTrue("Expected a JavaScriptException", ee.getCause() instanceof JavaScriptException);
}
}