use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class TableDisplayActionsTest method actionDetailsShouldHaveDetails.
@Test
public void actionDetailsShouldHaveDetails() throws Exception {
// given
Message message = actionDetailsMessage();
// when
commMsgHandler.handle(message);
// then
assertThat(tableDisplay.getDetails()).isNotNull();
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class TestWidgetUtils method verifyInternalOpenCommMsgWitLayout.
public static void verifyInternalOpenCommMsgWitLayout(List<Message> messages, String modelNameValue, String viewNameValue, String modelModule, String viewModule) {
Message widget = SearchMessages.getListWidgetsByViewName(messages, viewNameValue).get(0);
Message layout = SearchMessages.getLayoutForWidget(messages, widget);
verifyTypeMsg(widget, COMM_OPEN);
Map data = getState(widget);
assertThat(data.get(Layout.LAYOUT)).isEqualTo(Layout.IPY_MODEL + layout.getContent().get(Comm.COMM_ID));
assertThat(data.get(Widget.MODEL_NAME)).isEqualTo(modelNameValue);
assertThat(data.get(Widget.VIEW_NAME)).isEqualTo(viewNameValue);
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class AccordionTest method setTitle_shouldSendCommMessage.
@Test
public void setTitle_shouldSendCommMessage() throws Exception {
int index = 1;
// given
Accordion accordion = new Accordion(children);
// when
accordion.set_title(index, "first");
// then
Message titlesMessage = SearchMessages.getListMessagesByType(kernel.getPublishedMessages(), JupyterMessages.COMM_MSG).get(0);
Map titles = (Map) getValueForProperty(titlesMessage, Accordion.TITLES, Object.class);
Assertions.assertThat(titles.get(index)).isEqualTo("first");
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class CommOpenHandlerTest method handleMessage_sentMessageHasTargetModule.
@Test
public void handleMessage_sentMessageHasTargetModule() throws Exception {
// given
String expectedTargetModule = (String) message.getContent().get(TARGET_MODULE);
// when
commOpenHandler.handle(message);
// then
Assertions.assertThat(kernel.getSentMessages()).isNotEmpty();
Message sendMessage = kernel.getSentMessages().get(0);
Assertions.assertThat(sendMessage.getContent().get(TARGET_MODULE)).isEqualTo(expectedTargetModule);
}
use of com.twosigma.beakerx.message.Message in project beakerx by twosigma.
the class CommOpenHandlerTest method handleMessage_sentMessageHasParentHeader.
@Test
public void handleMessage_sentMessageHasParentHeader() throws Exception {
// given
String expectedHeader = message.getHeader().asJson();
// when
commOpenHandler.handle(message);
// then
Assertions.assertThat(kernel.getSentMessages()).isNotEmpty();
Message sendMessage = kernel.getSentMessages().get(0);
Assertions.assertThat(sendMessage.getParentHeader().asJson()).isEqualTo(expectedHeader);
}
Aggregations