use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class KotlinEvaluatorTest method executePlot.
@Test
public void executePlot() throws Exception {
// given
String code = "" + "import com.twosigma.beakerx.chart.xychart.*\n" + "val plot = Plot()";
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult evaluate = evaluator.evaluate(seo, code);
// then
assertThat(evaluate.result()).isNull();
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class SQLEvaluatorTest method insertsShouldReturnOutputCellHIDDEN.
@Test
public void insertsShouldReturnOutputCellHIDDEN() throws Exception {
// given
SimpleEvaluationObject seo = new SimpleEvaluationObject(SQLForColorTable.CREATE);
// when
TryResult evaluate = sqlEvaluator.evaluate(seo, seo.getExpression());
// then
verifyInsertResult(evaluate);
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class BeakerStdOutErrHandlerTest method setUp.
@Before
public void setUp() throws Exception {
BeakerStdOutErrHandler.init();
stdout = new SimpleOutputHandlerTest();
stderr = new SimpleErrHandlerTest();
seo = new SimpleEvaluationObject("code", stdout, stderr);
seo.setOutputHandler();
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class EvaluatorManagerTest method executeCode_callEvaluatorToEvaluate.
@Test
public void executeCode_callEvaluatorToEvaluate() {
String code = "test code";
SimpleEvaluationObject seo = PlainCode.createSimpleEvaluationObject(code, kernel, new Message(), 5);
// when
evaluatorManager.executeCode(code, seo);
// then
Assertions.assertThat(evaluator.getCode()).isEqualTo(code);
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class EvaluatorBaseTest method shouldCreateErrorResultWithArithmeticExceptionWhenDivisionByZero.
@Test
public void shouldCreateErrorResultWithArithmeticExceptionWhenDivisionByZero() throws Exception {
// given
String code = codeForDivisionByZero();
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
TryResult either = evaluator().evaluate(seo, code);
// then
assertThat(either.error()).contains(textAssertionForDivisionByZero());
}
Aggregations