use of com.canoo.dp.impl.server.legacy.ServerPresentationModel in project dolphin-platform by canoo.
the class StoreAttributeActionTests method testChangeAttributeMetadata.
@Test
public void testChangeAttributeMetadata() {
StoreAttributeAction action = new StoreAttributeAction();
action.setServerModelStore(serverModelStore);
action.registerIn(registry);
ServerAttribute attribute = new ServerAttribute("newAttribute", "");
serverModelStore.add(new ServerPresentationModel("model", Collections.singletonList(attribute), serverModelStore));
registry.getActionsFor(ChangeAttributeMetadataCommand.class).get(0).handleCommand(new ChangeAttributeMetadataCommand(attribute.getId(), "value", "newValue"), Collections.emptyList());
Assert.assertEquals("newValue", attribute.getValue());
}
use of com.canoo.dp.impl.server.legacy.ServerPresentationModel 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);
}
use of com.canoo.dp.impl.server.legacy.ServerPresentationModel 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.legacy.ServerPresentationModel 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.legacy.ServerPresentationModel 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");
}
Aggregations