Search in sources :

Example 16 with ReleaseId

use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.

the class InfoTitlePresenterTest method testSetup.

@Test
public void testSetup() {
    final ReleaseId releaseId = new ReleaseId("com.company", "artifact-id", "1.0.0");
    presenter.setup(releaseId);
    verify(view).setup(releaseId.getGroupId(), releaseId.getArtifactId());
}
Also used : ReleaseId(org.kie.server.api.model.ReleaseId) Test(org.junit.Test)

Example 17 with ReleaseId

use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.

the class NewContainerFormPresenterTest method testNewContainerStarted.

@Test
public void testNewContainerStarted() {
    final String path = "org:kie:1.0";
    final GAV gav = new GAV(path);
    when(m2RepoService.loadGAVFromJar(path)).thenReturn(gav);
    when(view.getContainerName()).thenReturn("containerName");
    when(view.getContainerAlias()).thenReturn("containerAlias");
    when(view.getGroupId()).thenReturn(gav.getGroupId());
    when(view.getArtifactId()).thenReturn(gav.getArtifactId());
    when(view.getVersion()).thenReturn(gav.getVersion());
    when(view.isStartContainer()).thenReturn(true);
    presenter.asWidget();
    final ContainerSpec containerSpec = presenter.buildContainerSpec("templateId", Collections.<Capability, ContainerConfig>emptyMap());
    assertEquals(new ReleaseId(gav.getGroupId(), gav.getArtifactId(), gav.getVersion()), containerSpec.getReleasedId());
    assertEquals(KieContainerStatus.STARTED, containerSpec.getStatus());
    assertEquals("containerAlias", containerSpec.getContainerName());
    assertEquals("containerName", containerSpec.getId());
}
Also used : ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) Matchers.anyString(org.mockito.Matchers.anyString) ReleaseId(org.kie.server.api.model.ReleaseId) GAV(org.guvnor.common.services.project.model.GAV) Test(org.junit.Test)

Example 18 with ReleaseId

use of org.kie.server.api.model.ReleaseId in project kie-wb-common by kiegroup.

the class NewContainerFormPresenterTest method testOnDependencyPathSelectedEvent.

@Test
public void testOnDependencyPathSelectedEvent() {
    final String path = "org:kie:1.0";
    final GAV gav = new GAV(path);
    when(m2RepoService.loadGAVFromJar(path)).thenReturn(gav);
    when(view.getContainerName()).thenReturn("containerName");
    when(view.getContainerAlias()).thenReturn("containerAlias");
    when(view.getGroupId()).thenReturn(gav.getGroupId());
    when(view.getArtifactId()).thenReturn(gav.getArtifactId());
    when(view.getVersion()).thenReturn(gav.getVersion());
    presenter.asWidget();
    presenter.onDependencyPathSelectedEvent(new DependencyPathSelectedEvent(artifactListWidgetPresenter, path));
    verify(m2RepoService).loadGAVFromJar(path);
    verify(view).setGroupId(gav.getGroupId());
    verify(view).setArtifactId(gav.getArtifactId());
    verify(view).setVersion(gav.getVersion());
    verify(wizardPageStatusChangeEvent).fire(any(WizardPageStatusChangeEvent.class));
    final ContainerSpec containerSpec = presenter.buildContainerSpec("templateId", Collections.<Capability, ContainerConfig>emptyMap());
    assertEquals(new ReleaseId(gav.getGroupId(), gav.getArtifactId(), gav.getVersion()), containerSpec.getReleasedId());
    assertEquals(KieContainerStatus.STOPPED, containerSpec.getStatus());
    assertEquals("containerAlias", containerSpec.getContainerName());
    assertEquals("containerName", containerSpec.getId());
}
Also used : ContainerSpec(org.kie.server.controller.api.model.spec.ContainerSpec) Matchers.anyString(org.mockito.Matchers.anyString) WizardPageStatusChangeEvent(org.uberfire.ext.widgets.core.client.wizards.WizardPageStatusChangeEvent) ReleaseId(org.kie.server.api.model.ReleaseId) GAV(org.guvnor.common.services.project.model.GAV) DependencyPathSelectedEvent(org.kie.workbench.common.screens.server.management.client.events.DependencyPathSelectedEvent) Test(org.junit.Test)

Aggregations

ReleaseId (org.kie.server.api.model.ReleaseId)18 Test (org.junit.Test)12 ContainerSpec (org.kie.server.controller.api.model.spec.ContainerSpec)12 ServerTemplateKey (org.kie.server.controller.api.model.spec.ServerTemplateKey)8 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)7 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)7 Container (org.kie.server.controller.api.model.runtime.Container)6 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)4 Before (org.junit.Before)3 Capability (org.kie.server.controller.api.model.spec.Capability)3 ContainerConfig (org.kie.server.controller.api.model.spec.ContainerConfig)3 ProcessConfig (org.kie.server.controller.api.model.spec.ProcessConfig)3 RuleConfig (org.kie.server.controller.api.model.spec.RuleConfig)3 Command (org.uberfire.mvp.Command)3 HashMap (java.util.HashMap)2 GAV (org.guvnor.common.services.project.model.GAV)2 Message (org.kie.server.api.model.Message)2 ContainerSpecKey (org.kie.server.controller.api.model.spec.ContainerSpecKey)2 ServerTemplateMigration (org.kie.workbench.common.screens.server.management.backend.storage.migration.ServerTemplateMigration)2 ContainerSpecSelected (org.kie.workbench.common.screens.server.management.client.events.ContainerSpecSelected)2