Search in sources :

Example 6 with ServerInstanceUpdated

use of org.kie.server.controller.api.model.events.ServerInstanceUpdated in project kie-wb-common by kiegroup.

the class RemotePresenterTest method testOnInstanceUpdate.

@Test
public void testOnInstanceUpdate() {
    final ServerInstance serverInstance = new ServerInstance("templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
    presenter.onSelect(new ServerInstanceSelected(serverInstance));
    presenter.onInstanceUpdate(new ServerInstanceUpdated(serverInstance));
    verify(view, times(2)).clear();
    verify(view, times(2)).setServerName(serverInstance.getServerName());
    verify(view, times(2)).setServerURL(serverInstance.getUrl());
    verify(view, times(2)).setEmptyView(remoteEmptyPresenter.getView());
}
Also used : ServerInstanceUpdated(org.kie.server.controller.api.model.events.ServerInstanceUpdated) ServerInstance(org.kie.server.controller.api.model.runtime.ServerInstance) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Example 7 with ServerInstanceUpdated

use of org.kie.server.controller.api.model.events.ServerInstanceUpdated in project kie-wb-common by kiegroup.

the class RemotePresenterTest method testOnInstanceUpdateDifferentServer.

@Test
public void testOnInstanceUpdateDifferentServer() {
    final ServerInstance serverInstance = new ServerInstance("templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
    presenter.onSelect(new ServerInstanceSelected(serverInstance));
    final ServerInstance serverInstance2 = new ServerInstance("templateId2", "serverName2", "serverInstanceId2", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList());
    presenter.onInstanceUpdate(new ServerInstanceUpdated(serverInstance2));
    verify(view).clear();
    verify(view).setServerName(serverInstance.getServerName());
    verify(view).setServerURL(serverInstance.getUrl());
    verify(view).setEmptyView(remoteEmptyPresenter.getView());
}
Also used : ServerInstanceUpdated(org.kie.server.controller.api.model.events.ServerInstanceUpdated) ServerInstance(org.kie.server.controller.api.model.runtime.ServerInstance) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 ServerInstanceUpdated (org.kie.server.controller.api.model.events.ServerInstanceUpdated)7 ServerInstance (org.kie.server.controller.api.model.runtime.ServerInstance)7 Container (org.kie.server.controller.api.model.runtime.Container)2 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)2 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)2 ContainerCardPresenter (org.kie.workbench.common.screens.server.management.client.container.status.card.ContainerCardPresenter)2 ServerInstanceSelected (org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected)2 Command (org.uberfire.mvp.Command)2 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)2 ReleaseId (org.kie.server.api.model.ReleaseId)1 ServerInstanceDeleted (org.kie.server.controller.api.model.events.ServerInstanceDeleted)1 Capability (org.kie.server.controller.api.model.spec.Capability)1 ContainerConfig (org.kie.server.controller.api.model.spec.ContainerConfig)1 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)1 RemoteEmptyView (org.kie.workbench.common.screens.server.management.client.remote.empty.RemoteEmptyView)1