use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class JavaKernelInfoHandlerTest method handle_sentMessageHasLanguageInfo.
@Test
public void handle_sentMessageHasLanguageInfo() throws Exception {
// when
handler.handle(message);
// then
Message sentMessage = kernel.getSentMessages().get(0);
Map<String, Serializable> map = sentMessage.getContent();
Assertions.assertThat(map).isNotNull();
Assertions.assertThat(map.get("language_info")).isNotNull();
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class JavaKernelInfoHandlerTest method handle_messageContentHasJavaLabel.
@Test
public void handle_messageContentHasJavaLabel() throws Exception {
// when
handler.handle(message);
// then
Message sentMessage = kernel.getSentMessages().get(0);
Map<String, Serializable> map = sentMessage.getContent();
Assertions.assertThat(map).isNotNull();
Assertions.assertThat(map.get("implementation")).isEqualTo("java");
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class GroovyEasyFormTest method evaluateEasyForm.
@Test
public void evaluateEasyForm() throws Exception {
// given
String code = "" + "f = new EasyForm(\"Form and Run\")\n" + "f.addTextField(\"first\", 250)\n" + "f['first'] = \"First\"\n" + "f.addTextField(\"last\", 250)\n" + "f['last'] = \"Last\"\n" + "f.addButton(\"Go!\", \"run\")\n" + "f";
Message message = getExecuteRequestMessage(code);
// when
kernelSocketsService.handleMsg(message);
Optional<Message> idleMessage = waitForIdleMessage(kernelSocketsService.getKernelSockets());
// then
assertThat(idleMessage).isPresent();
assertMessageExists("Easy form widget was not found.", EasyFormView.VIEW_NAME_VALUE);
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class GroovyMapLikeTableTest method runTest.
private void runTest(String code) throws InterruptedException {
Message message = getExecuteRequestMessage(code);
// when
kernelSocketsService.handleMsg(message);
Optional<Message> idleMessage = waitForIdleMessage(kernelSocketsService.getKernelSockets());
// then
assertThat(idleMessage).isPresent();
assertMessageExists("TableDisplay widget was not found.", TableDisplay.VIEW_NAME_VALUE);
}
use of com.twosigma.beakerx.message.Message 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);
}
Aggregations