Search in sources :

Example 1 with ServerPresentationModelBuilder

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilder 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 2 with ServerPresentationModelBuilder

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilder 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 3 with ServerPresentationModelBuilder

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilder 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)

Example 4 with ServerPresentationModelBuilder

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilder in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderTest method testWithAttributeCreation.

@Test
public void testWithAttributeCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilder builder = new ServerPresentationModelBuilder(serverModelStore);
    ServerPresentationModel model = builder.withAttribute("testName").create();
    assertNotNull(model);
    assertEquals(model.getAttributes().size(), 2);
    assertNotNull(model.getAttribute(RemotingConstants.SOURCE_SYSTEM));
    assertNotNull(model.getAttribute("testName"));
}
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 5 with ServerPresentationModelBuilder

use of com.canoo.dp.impl.server.model.ServerPresentationModelBuilder in project dolphin-platform by canoo.

the class ServerPresentationModelBuilderTest method testWithIdCreation.

@Test
public void testWithIdCreation() {
    ServerModelStore serverModelStore = createServerModelStore();
    ServerPresentationModelBuilder builder = new ServerPresentationModelBuilder(serverModelStore);
    ServerPresentationModel model = builder.withId("testId").create();
    assertNotNull(model);
    assertEquals(model.getId(), "testId");
}
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)5 ServerPresentationModel (com.canoo.dp.impl.server.legacy.ServerPresentationModel)5 ServerPresentationModelBuilder (com.canoo.dp.impl.server.model.ServerPresentationModelBuilder)5 AbstractDolphinBasedTest (com.canoo.impl.server.util.AbstractDolphinBasedTest)5 Test (org.testng.annotations.Test)5