use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testDefaultInstall.
@Test
public void testDefaultInstall() {
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 BuildExecutorTest method testSnapshotBuildAndDeploy.
@Test
public void testSnapshotBuildAndDeploy() {
module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
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 AbstractBuildAndDeployExecutor method saveContainerSpecAndMaybeStartContainer.
protected void saveContainerSpecAndMaybeStartContainer(final BuildExecutionContext context, final ContainerSpec containerSpec) {
specManagementService.call(ignore -> {
if (!context.isStartContainer()) {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessful(), NotificationEvent.NotificationType.SUCCESS).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return;
}
specManagementService.call(ignore2 -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessfulAndContainerStarted(), NotificationEvent.NotificationType.SUCCESS).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
}, (o, throwable) -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeploySuccessfulButContainerFailedToStart(), NotificationEvent.NotificationType.WARNING).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return false;
}).startContainer(containerSpec);
}, (o, throwable) -> {
notificationEvent.fire(new NotificationEvent(CONSTANTS.DeployFailed(), NotificationEvent.NotificationType.ERROR).setAutoHide(false).setNavigation(CONSTANTS.ViewDeploymentDetails(), new DefaultPlaceRequest(SERVER_MANAGEMENT)));
finish();
return false;
}).saveContainerSpec(context.getServerTemplate().getId(), containerSpec);
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class BuildExecutor method trigger.
private void trigger(final BuildType buildType) {
if (projectContext.getActiveModule().isPresent()) {
Module module = projectContext.getActiveModule().get();
buildExecutionManager.execute(buildType, new BuildExecutionContext(defaultContainerId(), defaultContainerAlias(), module));
}
}
use of org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext in project kie-wb-common by kiegroup.
the class AbstractExecutorTest method getSnapshotContext.
protected BuildExecutionContext getSnapshotContext() {
module.getPom().getGav().setVersion(VERSION + SNAPSHOT);
context = new BuildExecutionContext(ARTIFACT + "_" + VERSION + SNAPSHOT, ARTIFACT, module);
return context;
}
Aggregations