use of org.guvnor.common.services.project.builder.model.BuildMessage in project kie-wb-common by kiegroup.
the class BuildHelper method buildExceptionResults.
/**
* When an exception is produced by the builder service, this method is uses to generate an instance of
* <code>org.guvnor.common.services.project.builder.model.BuildResults</code> in generated with the exception details.
* @param e The error exception.
* @param gav
* @return An instance of BuildResults with the exception details.
*/
public BuildResults buildExceptionResults(Exception e, GAV gav) {
BuildResults exceptionResults = new BuildResults(gav);
BuildMessage exceptionMessage = new BuildMessage();
exceptionMessage.setLevel(Level.ERROR);
exceptionMessage.setText(e.getMessage());
exceptionResults.addBuildMessage(exceptionMessage);
return exceptionResults;
}
use of org.guvnor.common.services.project.builder.model.BuildMessage in project kie-wb-common by kiegroup.
the class BuildMessageBuilder method makeWarningMessage.
static BuildMessage makeWarningMessage(final String prefix) {
final BuildMessage buildMessage = new BuildMessage();
buildMessage.setLevel(Level.WARNING);
buildMessage.setText(prefix);
return buildMessage;
}
use of org.guvnor.common.services.project.builder.model.BuildMessage in project kie-wb-common by kiegroup.
the class MessageConverter method convertValidationMessage.
static BuildMessage convertValidationMessage(final ValidationMessage message) {
final BuildMessage m = new BuildMessage();
m.setLevel(message.getLevel());
m.setId(message.getId());
m.setLine(message.getLine());
m.setColumn(message.getColumn());
m.setText(message.getText());
m.setPath(message.getPath());
return m;
}
use of org.guvnor.common.services.project.builder.model.BuildMessage in project kie-wb-common by kiegroup.
the class MessageConverterTest method checkMessageWithKieBase.
@Test
public void checkMessageWithKieBase() {
final MessageImpl m = new MessageImpl(ID, Message.Level.ERROR, FILE, TEXT);
m.setKieBaseName(KIE_BASE_NAME);
final BuildMessage bm = MessageConverter.convertMessage(m, handles);
assertConversion(bm, () -> "[KBase: " + KIE_BASE_NAME + "]: " + TEXT);
}
use of org.guvnor.common.services.project.builder.model.BuildMessage in project kie-wb-common by kiegroup.
the class BuildExecutorTest method testBuildAndDeployCommandFail.
@Test
public void testBuildAndDeployCommandFail() {
BuildMessage message = mock(BuildMessage.class);
List<BuildMessage> messages = new ArrayList<>();
messages.add(message);
BuildResults results = mock(BuildResults.class);
when(results.getErrorMessages()).thenReturn(messages);
when(buildServiceMock.buildAndDeploy(any(KieModule.class), any(DeploymentMode.class))).thenReturn(results);
buildExecutor.triggerBuildAndDeploy();
verifyNotification(ProjectEditorResources.CONSTANTS.BuildFailed(), NotificationEvent.NotificationType.ERROR);
verifyBusyShowHideAnyString(1, 1, ProjectEditorResources.CONSTANTS.Building());
}
Aggregations