use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class GroovyEvaluatorPassingSimpleEvaluationObjectTest method shouldPassSimpleEvaluationObjectToShell.
@Test
public void shouldPassSimpleEvaluationObjectToShell() throws Exception {
// given
String code = "" + "import com.twosigma.beakerx.evaluator.InternalVariable\n" + "InternalVariable.getParentHeader()";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
Message message = new Message();
seo.setJupyterMessage(message);
// when
TryResult evaluate = groovyEvaluator.evaluate(seo, code);
// then
assertThat(evaluate.result()).isEqualTo(message);
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class GroovyEvaluatorStackTraceTest method arithmeticException.
@Test
public void arithmeticException() throws Exception {
String code = "1/0";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult evaluate = groovyEvaluator.evaluate(seo, code);
// then
assertThat(evaluate.isError()).isTrue();
assertThat(evaluate.error()).contains("at this cell line 1");
}
Aggregations