Search in sources :

Example 1 with DefaultServerDolphin

use of com.canoo.dp.impl.server.legacy.DefaultServerDolphin 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);
}
Also used : ServerConnector(com.canoo.dp.impl.server.legacy.ServerConnector) PresentationModelDeletedCommand(com.canoo.dp.impl.remoting.legacy.communication.PresentationModelDeletedCommand) DefaultServerDolphin(com.canoo.dp.impl.server.legacy.DefaultServerDolphin) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) ChangeAttributeMetadataCommand(com.canoo.dp.impl.remoting.legacy.communication.ChangeAttributeMetadataCommand) CreatePresentationModelCommand(com.canoo.dp.impl.remoting.legacy.communication.CreatePresentationModelCommand) ValueChangedCommand(com.canoo.dp.impl.remoting.legacy.communication.ValueChangedCommand) Test(org.testng.annotations.Test)

Aggregations

ChangeAttributeMetadataCommand (com.canoo.dp.impl.remoting.legacy.communication.ChangeAttributeMetadataCommand)1 CreatePresentationModelCommand (com.canoo.dp.impl.remoting.legacy.communication.CreatePresentationModelCommand)1 PresentationModelDeletedCommand (com.canoo.dp.impl.remoting.legacy.communication.PresentationModelDeletedCommand)1 ValueChangedCommand (com.canoo.dp.impl.remoting.legacy.communication.ValueChangedCommand)1 DefaultServerDolphin (com.canoo.dp.impl.server.legacy.DefaultServerDolphin)1 ServerConnector (com.canoo.dp.impl.server.legacy.ServerConnector)1 ServerModelStore (com.canoo.dp.impl.server.legacy.ServerModelStore)1 Test (org.testng.annotations.Test)1