use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testSingleTemplate.
@Test
public void testSingleTemplate() {
context = new BuildExecutionContext(CONTAINER3, CONTAINER3, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.SINGLE_SERVER, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER3), eq(true));
verify(view).initContainerAlias(eq(CONTAINER3), eq(true));
verify(view).initStartContainer(eq(true), eq(true));
verify(view, never()).initServerTemplates(any(), any());
verify(view).disableServerTemplates();
initViewWithValues(context.getContainerId(), context.getContainerAlias(), context.isStartContainer(), template1.getId());
popup.onOk();
verify(view).clearValidations();
verify(view).hide();
verify(callback).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testMultipleTemplate.
@Test
public void testMultipleTemplate() {
context = new BuildExecutionContext(CONTAINER3, CONTAINER3, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER3), eq(true));
verify(view).initContainerAlias(eq(CONTAINER3), eq(true));
verify(view).initStartContainer(eq(true), eq(true));
verify(view).initServerTemplates(any(), any());
verify(view, never()).disableServerTemplates();
initViewWithValues(context.getContainerId(), context.getContainerAlias(), context.isStartContainer(), template1.getId());
popup.onOk();
verify(view).clearValidations();
verify(view).hide();
verify(callback).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class DeploymentPopupTest method testSingleTemplateWithValidationFailure.
@Test
public void testSingleTemplateWithValidationFailure() {
context = new BuildExecutionContext(CONTAINER3, CONTAINER3, null);
context.setServerTemplate(template1);
DefaultDeploymentPopupDriver driver = new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.SINGLE_SERVER, () -> templates, callback, cancelCallback);
popup.show(driver);
verify(view).initContainerId(eq(CONTAINER3), eq(true));
verify(view).initContainerAlias(eq(CONTAINER3), eq(true));
verify(view).initStartContainer(eq(true), eq(true));
verify(view, never()).initServerTemplates(any(), any());
verify(view).disableServerTemplates();
popup.onOk();
verify(view).clearValidations();
verify(view).invalidateContainerId(any());
verify(view).invalidateContainerAlias(any());
verify(view, never()).hide();
verify(callback, never()).execute();
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class SnapshotBuildAndDeployExecutor method buildDeployWithMultipleServerTemplates.
@Override
void buildDeployWithMultipleServerTemplates(BuildExecutionContext context, List<ServerTemplate> serverTemplates) {
GAV gav = context.getModule().getPom().getGav();
Optional<SnapshotDeployment> optional = settings.getDeployment(gav.getGroupId(), gav.getArtifactId());
if (optional.isPresent()) {
SnapshotDeployment previousDeployment = optional.get();
Optional<ServerTemplate> serverOptional = serverTemplates.stream().filter(s -> s.getId().equals(previousDeployment.getServer())).findFirst();
if (serverOptional.isPresent()) {
buildDeployWithOneServerTemplate(context, serverOptional.get());
return;
}
}
context.setServerTemplate(serverTemplates.get(0));
deploymentPopup.show(new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER_FORCED, () -> serverTemplates, () -> buildDeployWithOneServerTemplate(context, context.getServerTemplate()), () -> finish()));
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testSnapshotBuild.
@Test
public void testSnapshotBuild() {
module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
buildExecutor.triggerBuild();
verify(buildExecutionManager).execute(eq(BuildType.BUILD), contextCaptor.capture());
BuildExecutionContext context = contextCaptor.getValue();
Assertions.assertThat(context).returns(buildExecutor.defaultContainerId(), BuildExecutionContext::getContainerId).returns(buildExecutor.defaultContainerAlias(), BuildExecutionContext::getContainerAlias).returns(module, BuildExecutionContext::getModule);
}
Aggregations