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");
}
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);
}
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");
}
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"));
}
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");
}
Aggregations