Search in sources :

Example 1 with ServerInstanceSelected

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());
}
Also used : ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Example 2 with ServerInstanceSelected

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));
}
Also used : NotificationEvent(org.uberfire.workbench.events.NotificationEvent) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Example 3 with ServerInstanceSelected

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());
}
Also used : Container(org.kie.server.controller.api.model.runtime.Container) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Example 4 with ServerInstanceSelected

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());
}
Also used : Command(org.uberfire.mvp.Command) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected)

Example 5 with ServerInstanceSelected

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));
        }
    });
}
Also used : ParameterizedCommand(org.uberfire.mvp.ParameterizedCommand) Command(org.uberfire.mvp.Command) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected)

Aggregations

ServerInstanceSelected (org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected)11 Test (org.junit.Test)9 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)7 Command (org.uberfire.mvp.Command)3 ServerInstanceUpdated (org.kie.server.controller.api.model.events.ServerInstanceUpdated)2 Container (org.kie.server.controller.api.model.runtime.Container)2 ServerInstance (org.kie.server.controller.api.model.runtime.ServerInstance)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2 Message (org.kie.server.api.model.Message)1 ReleaseId (org.kie.server.api.model.ReleaseId)1 RemotePresenter (org.kie.workbench.common.screens.server.management.client.remote.RemotePresenter)1 CardPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.CardPresenter)1 BodyPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.body.BodyPresenter)1 FooterPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.footer.FooterPresenter)1 LinkTitlePresenter (org.kie.workbench.common.screens.server.management.client.widget.card.title.LinkTitlePresenter)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1