use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testDefaultBuildAndDeploy.
@Test
public void testDefaultBuildAndDeploy() {
buildExecutor.triggerBuildAndDeploy();
verify(buildExecutionManager).execute(eq(BuildType.DEPLOY), contextCaptor.capture());
BuildExecutionContext context = contextCaptor.getValue();
Assertions.assertThat(context).returns(buildExecutor.defaultContainerId(), BuildExecutionContext::getContainerId).returns(buildExecutor.defaultContainerAlias(), BuildExecutionContext::getContainerAlias).returns(module, BuildExecutionContext::getModule);
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testSnapshotRedeploy.
@Test
public void testSnapshotRedeploy() {
module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
buildExecutor.triggerRedeploy();
verify(buildExecutionManager).execute(eq(BuildType.REDEPLOY), contextCaptor.capture());
BuildExecutionContext context = contextCaptor.getValue();
Assertions.assertThat(context).returns(buildExecutor.defaultContainerId(), BuildExecutionContext::getContainerId).returns(buildExecutor.defaultContainerAlias(), BuildExecutionContext::getContainerAlias).returns(module, BuildExecutionContext::getModule);
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testSnapshotInstall.
@Test
public void testSnapshotInstall() {
module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
buildExecutor.triggerBuildAndInstall();
verify(buildExecutionManager).execute(eq(BuildType.INSTALL), contextCaptor.capture());
BuildExecutionContext context = contextCaptor.getValue();
Assertions.assertThat(context).returns(buildExecutor.defaultContainerId(), BuildExecutionContext::getContainerId).returns(buildExecutor.defaultContainerAlias(), BuildExecutionContext::getContainerAlias).returns(module, BuildExecutionContext::getModule);
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class AbstractBuildAndDeployExecutor method updateContainerSpec.
protected void updateContainerSpec(final BuildExecutionContext context, final ContainerSpec containerSpec) {
ServerTemplate serverTemplate = context.getServerTemplate();
if (serverTemplate.getMode().equals(KieServerMode.DEVELOPMENT)) {
containerSpec.setStatus(serverTemplate.getContainerSpec(containerSpec.getId()).getStatus());
specManagementService.call(ignore -> {
notifyUpdateSuccess();
}, (o, throwable) -> {
notifyUpdateError();
return false;
}).updateContainerSpec(context.getServerTemplate().getId(), containerSpec);
} else {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploymentSkippedCannotUpdateDeploymentsOnProduction(), ERROR).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
}
}
Aggregations