use of com.canoo.dp.impl.server.legacy.ServerConnector in project dolphin-platform by canoo.
the class DefaultOpenDolphinFactoryTest method testDolphinCreation.
@Test
public void testDolphinCreation() {
final ServerModelStore modelStore = new ServerModelStore();
final ServerConnector serverConnector = new ServerConnector();
serverConnector.setCodec(OptimizedJsonCodec.getInstance());
serverConnector.setServerModelStore(modelStore);
final DefaultServerDolphin serverDolphin = new DefaultServerDolphin(modelStore, serverConnector);
serverDolphin.getServerConnector().registerDefaultActions();
assertNotNull(serverDolphin);
assertNotNull(serverDolphin.getModelStore());
assertNotNull(serverDolphin.getServerConnector());
assertNotNull(serverDolphin.getModelStore());
assertNotNull(serverDolphin.getServerConnector().getCodec());
assertEquals(OptimizedJsonCodec.class, serverDolphin.getServerConnector().getCodec().getClass());
assertEquals(serverDolphin.getServerConnector().getRegistry().getActions().size(), 4);
assertTrue(serverDolphin.getServerConnector().getRegistry().getActions().containsKey(ValueChangedCommand.class));
assertTrue(serverDolphin.getServerConnector().getRegistry().getActions().containsKey(CreatePresentationModelCommand.class));
assertTrue(serverDolphin.getServerConnector().getRegistry().getActions().containsKey(ChangeAttributeMetadataCommand.class));
assertTrue(serverDolphin.getServerConnector().getRegistry().getActions().containsKey(PresentationModelDeletedCommand.class));
assertEquals(serverDolphin.getModelStore().listPresentationModelIds().size(), 0);
}
Aggregations