use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class AbstractInstallExecutor method buildAndInstall.
protected void buildAndInstall(final BuildExecutionContext context, final DeploymentMode mode) {
showBuildMessage();
buildServiceCaller.call((RemoteCallback<BuildResults>) result -> {
if (result.getErrorMessages().isEmpty()) {
notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildAndInstallSuccessful(), NotificationEvent.NotificationType.SUCCESS));
} else {
notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildFailed(), NotificationEvent.NotificationType.ERROR));
}
buildResultsEvent.fire(result);
finish();
}, (ErrorCallback<Message>) (message, throwable) -> handleBuildError(context, message, throwable)).buildAndDeploy(context.getModule(), mode);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class SnapshotBuildAndDeployExecutor method buildDeployWithOneServerTemplate.
@Override
void buildDeployWithOneServerTemplate(final BuildExecutionContext context, final ServerTemplate serverTemplate) {
showBuildMessage();
context.setServerTemplate(serverTemplate);
buildServiceCaller.call((RemoteCallback<BuildResults>) result -> {
if (result.getErrorMessages().isEmpty()) {
GAV gav = context.getModule().getPom().getGav();
settings.addDeployment(gav.getGroupId(), gav.getArtifactId(), serverTemplate.getId());
settings.save();
}
onBuildDeploySuccess(context, result);
}, (ErrorCallback<Message>) (message, e) -> {
finish();
return false;
}).buildAndDeploy(context.getModule(), DeploymentMode.FORCED);
}
use of org.jboss.errai.common.client.api.ErrorCallback in project kie-wb-common by kiegroup.
the class BuildExecutor method start.
@Override
protected void start(final BuildExecutionContext context) {
showBuildMessage();
buildServiceCaller.call((RemoteCallback<BuildResults>) result -> {
if (result.getErrorMessages().isEmpty()) {
notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildSuccessful(), NotificationEvent.NotificationType.SUCCESS));
} else {
notificationEvent.fire(new NotificationEvent(CONSTANTS.BuildFailed(), NotificationEvent.NotificationType.ERROR));
}
buildResultsEvent.fire(result);
finish();
}, (ErrorCallback<Message>) (message, throwable) -> {
finish();
return false;
}).build(context.getModule());
}
use of org.jboss.errai.common.client.api.ErrorCallback in project drools-wb by kiegroup.
the class ScenarioSimulationEditorBusinessCentralWrapperTest method getDMNMetadata.
@Test
public void getDMNMetadata() {
ArgumentCaptor<ErrorCallback> errorCallbackArgumentCaptor = ArgumentCaptor.forClass(ErrorCallback.class);
String dmnPath = "src/test.dmn";
String dmnName = "DMN-NAME";
String dmnNameSpace = "DMN-namespace";
modelLocal.getSettings().setDmnFilePath(dmnPath);
when(dmnTypeServiceMock.getDMNMetadata(eq(pathMock), eq(dmnPath))).thenReturn(new DMNMetadata(dmnName, dmnNameSpace));
scenarioSimulationEditorBusinessClientWrapper.getDMNMetadata();
verify(dmnTypeServiceCaller, times(1)).call(isA(RemoteCallback.class), errorCallbackArgumentCaptor.capture());
verify(dmnTypeServiceMock, times(1)).getDMNMetadata(eq(pathMock), eq(dmnPath));
verify(scenarioSimulationEditorPresenterMock, times(1)).reloadSettingsDock();
assertEquals(dmnName, modelLocal.getSettings().getDmnName());
assertEquals(dmnNameSpace, modelLocal.getSettings().getDmnNamespace());
errorCallbackArgumentCaptor.getValue().error("ERROR", new Throwable());
verify(scenarioSimulationEditorPresenterMock, times(1)).sendNotification(eq("ERROR"), eq(NotificationEvent.NotificationType.ERROR));
}
Aggregations