use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class GroovyEvaluatorMagicCommandsTest method runCode.
private TryResult runCode(String code) throws InterruptedException {
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
Message message = new Message();
seo.setJupyterMessage(message);
return groovyEvaluator.evaluate(seo, code);
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class ScalaEvaluatorTest method incompleteInput_shouldBeDetected.
@Test
public void incompleteInput_shouldBeDetected() throws Exception {
// given
String code = "1 to 10 map { i => i * 2";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult evaluate = scalaEvaluator.evaluate(seo, code);
// then
assertThat(evaluate.error()).contains("incomplete");
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class ScalaEvaluatorTest method displayTable.
@Test
public void displayTable() throws Exception {
// given
String code = "val table = new TableDisplay(new CSV().readFile(\"src/test/resources/tableRowsTest.csv\"))\n" + "table";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult evaluate = scalaEvaluator.evaluate(seo, code);
// then
assertThat(evaluate.result() instanceof DisplayableWidget).isTrue();
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class MessageCreatorTest method setUp.
@Before
public void setUp() throws Exception {
kernel = new KernelTest("id1");
seo = new SimpleEvaluationObject("code");
seo.setJupyterMessage(new Message());
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class CommTest method submitCodeToExecution.
private Message submitCodeToExecution() {
SimpleEvaluationObject value = new SimpleEvaluationObject("ok");
Message jupyterMessage = new Message();
value.setJupyterMessage(jupyterMessage);
InternalVariable.setValue(value);
return jupyterMessage;
}
Aggregations