use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.
the class ServerTemplatePresenterTest method testOnServerInstanceSelect.
@Test
public void testOnServerInstanceSelect() {
final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("serverInstanceKeyId", "serverName", "serverInstanceId", "url");
presenter.onServerInstanceSelect(new ServerInstanceSelected(serverInstanceKey));
verify(view).selectServerInstance(serverInstanceKey.getServerTemplateId(), serverInstanceKey.getServerInstanceId());
}
use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.
the class RemotePresenterTest method testRemove.
@Test
public void testRemove() {
final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("templateId", "serverName", "serverInstanceId", "url");
presenter.onSelect(new ServerInstanceSelected(serverInstanceKey));
presenter.remove();
verify(specManagementService).deleteServerInstance(serverInstanceKey);
verify(notification).fire(any(NotificationEvent.class));
}
use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.
the class RemotePresenterTest method testSelectAndRefresh.
@Test
public void testSelectAndRefresh() {
final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("templateId", "serverName", "serverInstanceId", "url");
final Container container = new Container("containerSpecId", "containerName", serverInstanceKey, Collections.<Message>emptyList(), null, null);
final List<Container> containers = Collections.singletonList(container);
when(runtimeManagementService.getContainersByServerInstance(serverInstanceKey.getServerTemplateId(), serverInstanceKey.getServerInstanceId())).thenReturn(containers);
presenter.onSelect(new ServerInstanceSelected(serverInstanceKey));
verify(view).clear();
verify(view).setServerName(serverInstanceKey.getServerName());
verify(view).setServerURL(serverInstanceKey.getUrl());
verify(remoteStatusPresenter).setup(containers);
verify(view).setStatusPresenter(remoteStatusPresenter.getView());
}
use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.
the class ContainerCardPresenter method updateContent.
public void updateContent(final ServerInstanceKey serverInstanceKey, final Container container) {
linkTitlePresenter.setup(serverInstanceKey.getServerName(), new Command() {
@Override
public void execute() {
remoteServerSelectedEvent.fire(new ServerInstanceSelected(serverInstanceKey));
}
});
bodyPresenter.setup(container.getMessages());
footerPresenter.setup(container.getUrl(), container.getResolvedReleasedId().getVersion());
}
use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.
the class ServerTemplatePresenter method addServerInstance.
private void addServerInstance(final ServerInstanceKey serverInstanceKey) {
serverInstances.add(serverInstanceKey.getServerInstanceId());
view.addServerInstance(serverInstanceKey.getServerTemplateId(), serverInstanceKey.getServerInstanceId(), serverInstanceKey.getServerName(), new Command() {
@Override
public void execute() {
serverInstanceSelectedEvent.fire(new ServerInstanceSelected(serverInstanceKey));
}
});
}
Aggregations