Search in sources :

Example 51 with ServerModelStore

use of com.canoo.dp.impl.server.legacy.ServerModelStore in project dolphin-platform by canoo.

the class ServerEventDispatcherTest method testLocalSystemIdentifier.

@Test
public void testLocalSystemIdentifier() {
    // given:
    ServerModelStore serverModelStore = new ServerModelStore();
    ServerEventDispatcher dispatcher = new ServerEventDispatcher(serverModelStore);
    // then:
    assertEquals(dispatcher.getLocalSystemIdentifier(), RemotingConstants.SOURCE_SYSTEM_SERVER);
}
Also used : ServerEventDispatcher(com.canoo.dp.impl.server.model.ServerEventDispatcher) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test)

Example 52 with ServerModelStore

use of com.canoo.dp.impl.server.legacy.ServerModelStore in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderFactoryTest method testSimpleCreation.

@Test
public void testSimpleCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilderFactory factory = new ServerPresentationModelBuilderFactory(serverModelStore);
    PresentationModelBuilder<ServerPresentationModel> builder = factory.createBuilder();
    assertNotNull(builder);
}
Also used : ServerPresentationModel(com.canoo.dp.impl.server.legacy.ServerPresentationModel) ServerPresentationModelBuilderFactory(com.canoo.dp.impl.server.model.ServerPresentationModelBuilderFactory) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test) AbstractDolphinBasedTest(com.canoo.impl.server.util.AbstractDolphinBasedTest)

Example 53 with ServerModelStore

use of com.canoo.dp.impl.server.legacy.ServerModelStore in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderTest method testWithFilledAttributeCreation.

@Test
public void testWithFilledAttributeCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilder builder = new ServerPresentationModelBuilder(serverModelStore);
    ServerPresentationModel model = builder.withAttribute("testName", "testValue").create();
    assertNotNull(model);
    assertEquals(model.getAttributes().size(), 2);
    assertNotNull(model.getAttribute(RemotingConstants.SOURCE_SYSTEM));
    assertNotNull(model.getAttribute("testName"));
    assertEquals(model.getAttribute("testName").getValue(), "testValue");
}
Also used : ServerPresentationModel(com.canoo.dp.impl.server.legacy.ServerPresentationModel) ServerPresentationModelBuilder(com.canoo.dp.impl.server.model.ServerPresentationModelBuilder) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test) AbstractDolphinBasedTest(com.canoo.impl.server.util.AbstractDolphinBasedTest)

Example 54 with ServerModelStore

use of com.canoo.dp.impl.server.legacy.ServerModelStore in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderTest method testSimpleCreation.

@Test
public void testSimpleCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilder builder = new ServerPresentationModelBuilder(serverModelStore);
    ServerPresentationModel model = builder.create();
    assertNotNull(model);
    assertEquals(model.getAttributes().size(), 1);
    assertEquals(model.getAttributes().get(0).getPropertyName(), RemotingConstants.SOURCE_SYSTEM);
    assertEquals(model.getAttributes().get(0).getValue(), RemotingConstants.SOURCE_SYSTEM_SERVER);
}
Also used : ServerPresentationModel(com.canoo.dp.impl.server.legacy.ServerPresentationModel) ServerPresentationModelBuilder(com.canoo.dp.impl.server.model.ServerPresentationModelBuilder) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test) AbstractDolphinBasedTest(com.canoo.impl.server.util.AbstractDolphinBasedTest)

Example 55 with ServerModelStore

use of com.canoo.dp.impl.server.legacy.ServerModelStore in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderTest method testWithTypeCreation.

@Test
public void testWithTypeCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilder builder = new ServerPresentationModelBuilder(serverModelStore);
    ServerPresentationModel model = builder.withType("testType").create();
    assertNotNull(model);
    assertEquals(model.getPresentationModelType(), "testType");
}
Also used : ServerPresentationModel(com.canoo.dp.impl.server.legacy.ServerPresentationModel) ServerPresentationModelBuilder(com.canoo.dp.impl.server.model.ServerPresentationModelBuilder) ServerModelStore(com.canoo.dp.impl.server.legacy.ServerModelStore) Test(org.testng.annotations.Test) AbstractDolphinBasedTest(com.canoo.impl.server.util.AbstractDolphinBasedTest)

Aggregations

ServerModelStore (com.canoo.dp.impl.server.legacy.ServerModelStore)103 Test (org.testng.annotations.Test)100 AbstractDolphinBasedTest (com.canoo.impl.server.util.AbstractDolphinBasedTest)97 BeanManager (com.canoo.platform.remoting.BeanManager)91 ServerPresentationModel (com.canoo.dp.impl.server.legacy.ServerPresentationModel)88 PresentationModel (com.canoo.dp.impl.remoting.legacy.core.PresentationModel)66 ListReferenceModel (com.canoo.impl.server.util.ListReferenceModel)65 SimpleTestModel (com.canoo.impl.server.util.SimpleTestModel)18 BeanRepository (com.canoo.dp.impl.remoting.BeanRepository)14 EventDispatcher (com.canoo.dp.impl.remoting.EventDispatcher)14 Attribute (com.canoo.dp.impl.remoting.legacy.core.Attribute)8 ServerAttribute (com.canoo.dp.impl.server.legacy.ServerAttribute)7 ServerPresentationModelBuilder (com.canoo.dp.impl.server.model.ServerPresentationModelBuilder)5 SimpleAnnotatedTestModel (com.canoo.impl.server.util.SimpleAnnotatedTestModel)5 Command (com.canoo.dp.impl.remoting.legacy.communication.Command)4 ChildModel (com.canoo.impl.server.util.ChildModel)4 SingleReferenceModel (com.canoo.impl.server.util.SingleReferenceModel)4 ValueChangeEvent (com.canoo.platform.remoting.ValueChangeEvent)4 ValueChangeListener (com.canoo.platform.remoting.ValueChangeListener)4 Subscription (com.canoo.platform.core.functional.Subscription)3