use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class MessageCreatorNoResultTest method noResult.
@Test
public void noResult() throws Exception {
// given
SimpleEvaluationObject seo = new SimpleEvaluationObject("code");
seo.setJupyterMessage(new Message());
seo.finished(OutputCell.HIDDEN);
// when
List<MessageHolder> messages = MessageCreator.createMessage(seo);
// then
messages.forEach(m -> assertThat(JupyterMessages.EXECUTE_RESULT).isNotEqualTo(m.getMessage().type()));
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class NamespaceClientShowProgressReportingTest method updateProgressReporting.
@Test
public void updateProgressReporting() throws Exception {
// given
InternalVariable.setValue(new SimpleEvaluationObject("code"));
// when
namespaceClient.showProgressUpdate("msg1", 20);
namespaceClient.showProgressUpdate("msg2", 40);
// then
assertThat(kernel.getPublishedMessages()).isNotEmpty();
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class CompiledCodeRunner method runCommEvent.
static void runCommEvent(Message message, CommActions action, Widget.ActionPerformed handlerAction) {
if (message.getContent() != null) {
Serializable data = message.getContent().get("data");
if (data != null && data instanceof LinkedHashMap) {
Object contentObject = ((LinkedHashMap) data).get("content");
if (contentObject instanceof LinkedHashMap) {
HashMap content = (LinkedHashMap) contentObject;
if (handlerAction != null) {
final SimpleEvaluationObject seo = initOutput(message);
handlerAction.executeAction(content, message);
seo.clrOutputHandler();
}
}
}
}
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class CompiledCodeRunner method initOutput.
private static SimpleEvaluationObject initOutput(Message message) {
final SimpleEvaluationObject seo = new SimpleEvaluationObject("");
seo.setJupyterMessage(message);
seo.setOutputHandler();
seo.addObserver(KernelManager.get().getExecutionResultSender());
return seo;
}
use of com.twosigma.beakerx.jvm.object.SimpleEvaluationObject in project beakerx by twosigma.
the class InteractiveTest method callInteractWithStringParam.
private void callInteractWithStringParam(String param) throws Exception {
String code = getInteractiveCode(param);
SimpleEvaluationObject seo = new SimpleEvaluationObject(code);
// when
groovyEvaluator.evaluate(seo, code);
}
Aggregations