use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class KernelExecutionTest method shouldUnimportDemoClassByMagicCommand.
@Test
public void shouldUnimportDemoClassByMagicCommand() throws Exception {
// given
addDemoJar();
String path = pathToDemoClassFromAddedDemoJar();
Code code = CodeFactory.create(IMPORT + " " + path, new Message(), getKernel());
code.execute(kernel, 1);
// when
Code code2 = CodeFactory.create(UNIMPORT + " " + path, new Message(), getKernel());
code2.execute(kernel, 2);
// then
// assertThat(status).isEqualTo(MagicCommandOutcomeItem.Status.OK);
verifyUnImportedDemoClassByMagicCommand();
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class KernelTest method sendBusyMessage.
@Override
public void sendBusyMessage(Message message) {
Message busyMessage = MessageCreator.createBusyMessage(message);
publish(Collections.singletonList(busyMessage));
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class DisplayTest method verifyText.
private void verifyText() {
Message message = kernel.getPublishedMessages().get(0);
assertThat(message.type()).isEqualTo(JupyterMessages.DISPLAY_DATA);
assertThat(getData(message).get(MIMEContainer.MIME.TEXT_PLAIN)).isEqualTo("Hello");
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class DisplayTest method verifyWidget.
private void verifyWidget() {
Message message = kernel.getPublishedMessages().stream().filter(x -> x.type().equals(JupyterMessages.DISPLAY_DATA)).collect(Collectors.toList()).get(0);
assertThat(getData(message).get(Widget.APPLICATION_VND_JUPYTER_WIDGET_VIEW_JSON)).isNotNull();
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class GroovyKernelTest method shouldNotImportStaticNotStaticPathByMagicCommand.
@Test
public void shouldNotImportStaticNotStaticPathByMagicCommand() throws Exception {
// given
addDemoJar();
String path = "garbage";
// when
Code code = CodeFactory.create(ADD_STATIC_IMPORT + " " + path, new Message(), getKernel());
code.execute(kernel, 1);
// then
verifyNotImportedStaticMagicCommand();
}
Aggregations