use of com.canoo.dp.impl.server.legacy.communication.ActionRegistry in project dolphin-platform by canoo.
the class DolphinServerActionTests method setUp.
@BeforeMethod
protected void setUp() throws Exception {
action = new DolphinServerAction() {
@Override
public void registerIn(ActionRegistry registry) {
}
};
action.setDolphinResponse(new ArrayList());
}
use of com.canoo.dp.impl.server.legacy.communication.ActionRegistry in project dolphin-platform by canoo.
the class StoreAttributeActionTests method setUp.
@BeforeMethod
public void setUp() throws Exception {
serverModelStore = new ServerModelStore();
serverModelStore.setCurrentResponse(new ArrayList<Command>());
registry = new ActionRegistry();
}
use of com.canoo.dp.impl.server.legacy.communication.ActionRegistry in project dolphin-platform by canoo.
the class TestDolphinCommandHandler method testInvocation.
@Test
public void testInvocation() throws Exception {
// Given:
final DolphinTestConfiguration configuration = createDolphinTestConfiguration();
final ServerModelStore serverModelStore = configuration.getServerModelStore();
final ClientModelStore clientModelStore = configuration.getClientModelStore();
final DolphinCommandHandler dolphinCommandHandler = new DolphinCommandHandler(configuration.getClientConnector());
final String modelId = UUID.randomUUID().toString();
clientModelStore.createModel(modelId, null, new ClientAttribute("myAttribute", "UNKNOWN"));
configuration.getServerConnector().register(new DolphinServerAction() {
@Override
public void registerIn(ActionRegistry registry) {
registry.register(TestChangeCommand.class, new CommandHandler() {
@Override
public void handleCommand(Command command, List response) {
serverModelStore.findPresentationModelById(modelId).getAttribute("myAttribute").setValue("Hello World");
}
});
}
});
// When:
dolphinCommandHandler.invokeDolphinCommand(new TestChangeCommand()).get();
// Then:
assertEquals(clientModelStore.findPresentationModelById(modelId).getAttribute("myAttribute").getValue(), "Hello World");
}
Aggregations