Search in sources :

Example 6 with ServerInstance

use of org.kie.server.controller.api.model.runtime.ServerInstance 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 ServerInstance

use of org.kie.server.controller.api.model.runtime.ServerInstance 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)

Example 8 with ServerInstance

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

the class ConvertTest method testToKey.

@Test
public void testToKey() {
    final String serverTemplateId = "serverTemplateId";
    final String serverName = "serverName";
    final String serverInstanceId = "serverInstanceId";
    final String url = "url";
    ServerInstance serverInstance = new ServerInstance(serverTemplateId, serverName, serverInstanceId, url, "version", new ArrayList<Message>(), new ArrayList<Container>());
    ServerInstanceKey key = Convert.toKey(serverInstance);
    assertEquals(serverTemplateId, key.getServerTemplateId());
    assertEquals(serverName, key.getServerName());
    assertEquals(serverInstanceId, key.getServerInstanceId());
    assertEquals(url, key.getUrl());
}
Also used : Container(org.kie.server.controller.api.model.runtime.Container) Message(org.kie.server.api.model.Message) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerInstance(org.kie.server.controller.api.model.runtime.ServerInstance) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)8 ServerInstance (org.kie.server.controller.api.model.runtime.ServerInstance)8 ServerInstanceUpdated (org.kie.server.controller.api.model.events.ServerInstanceUpdated)7 Container (org.kie.server.controller.api.model.runtime.Container)3 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 Message (org.kie.server.api.model.Message)1 ReleaseId (org.kie.server.api.model.ReleaseId)1 ServerInstanceDeleted (org.kie.server.controller.api.model.events.ServerInstanceDeleted)1 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)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