Search in sources :

Example 1 with SimpleLayoutManager

use of com.twosigma.beakerx.jvm.object.SimpleLayoutManager in project beakerx by twosigma.

the class OutputContainerCellSerializerTest method serializeLayoutManager_resultJsonHasLayoutManager.

@Test
public void serializeLayoutManager_resultJsonHasLayoutManager() throws IOException {
    // given
    outputContainerCell.setLayoutManager(new SimpleLayoutManager());
    // when
    JsonNode actualObj = helper.serializeObject(outputContainerCell);
    // then
    Assertions.assertThat(actualObj.has("layout")).isTrue();
}
Also used : SimpleLayoutManager(com.twosigma.beakerx.jvm.object.SimpleLayoutManager) JsonNode(com.fasterxml.jackson.databind.JsonNode) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 2 with SimpleLayoutManager

use of com.twosigma.beakerx.jvm.object.SimpleLayoutManager in project beakerx by twosigma.

the class SimpleLayoutManagerDeserializerTest method deserialize_resultObjectHasBorderDisplayed.

@Test
public void deserialize_resultObjectHasBorderDisplayed() throws Exception {
    // given
    ObjectMapper mapper = new ObjectMapper();
    JsonNode actualObj = mapper.readTree(json);
    SimpleLayoutManagerDeserializer deserializer = new SimpleLayoutManagerDeserializer(new BasicObjectSerializer());
    // when
    SimpleLayoutManager layoutManager = (SimpleLayoutManager) deserializer.deserialize(actualObj, mapper);
    // then
    Assertions.assertThat(layoutManager).isNotNull();
    Assertions.assertThat(layoutManager.isBorderDisplayed()).isEqualTo(borderDisplayed);
}
Also used : SimpleLayoutManager(com.twosigma.beakerx.jvm.object.SimpleLayoutManager) JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 3 with SimpleLayoutManager

use of com.twosigma.beakerx.jvm.object.SimpleLayoutManager in project beakerx by twosigma.

the class SimpleLayoutManagerSerializerTest method setUp.

@Before
public void setUp() throws Exception {
    KernelManager.register(new KernelTest());
    layoutManager = new SimpleLayoutManager();
}
Also used : SimpleLayoutManager(com.twosigma.beakerx.jvm.object.SimpleLayoutManager) KernelTest(com.twosigma.beakerx.KernelTest) Before(org.junit.Before)

Aggregations

SimpleLayoutManager (com.twosigma.beakerx.jvm.object.SimpleLayoutManager)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 KernelTest (com.twosigma.beakerx.KernelTest)2 Test (org.junit.Test)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Before (org.junit.Before)1