use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class GuidedDecisionTableEditorServiceImplCDITest method testFunctionFromDrl.
@Test
public void testFunctionFromDrl() throws Exception {
final Path path = getPath("rhba370/src/main/resources/com/sample/dtissuesampleproject/UseFunctionFromDrl.gdst");
final List<ValidationMessage> validationMessages = testedService.validate(path, testedService.load(path));
Assertions.assertThat(validationMessages).isEmpty();
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class BaseGuidedDecisionTableEditorPresenter method onValidate.
@Override
public void onValidate(final GuidedDecisionTableView.Presenter dtPresenter) {
final ObservablePath path = dtPresenter.getCurrentPath();
final GuidedDecisionTable52 model = dtPresenter.getModel();
service.call(new RemoteCallback<List<ValidationMessage>>() {
@Override
public void callback(final List<ValidationMessage> results) {
if (results == null || results.isEmpty()) {
notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemValidatedSuccessfully(), NotificationEvent.NotificationType.SUCCESS));
} else {
showValidationPopup(results);
}
}
}).validate(path, model);
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class EnumServiceImplCDITest method testValidateWrongSyntax.
@Test
public void testValidateWrongSyntax() throws Exception {
final Path path = getPath("enums/src/main/resources/guvnor/feature/enums/personAgeWrongSyntax.enumeration");
final List<ValidationMessage> validationMessages = enumService.validate(path);
Assertions.assertThat(validationMessages).hasSize(3);
Assertions.assertThat(validationMessages.stream().map(message -> message.getText()).filter(messageText -> isOneOfExpectedError(messageText)).count()).isEqualTo(3);
}
use of org.guvnor.common.services.shared.validation.model.ValidationMessage in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method makeNewValidationMessage.
private ValidationMessage makeNewValidationMessage(final Object o) {
final ValidationMessage msg = new ValidationMessage();
msg.setLevel(Level.ERROR);
msg.setText("Uncategorized error " + o);
return msg;
}
Aggregations