@Test public void validatingAnAlreadyInvalidAssetShouldReportErrors() throws Exception { final Path path = resourcePath("/BuilderExampleBrokenSyntax/src/main/resources/rule1.drl"); final URL urlToValidate = this.getClass().getResource("/BuilderExampleBrokenSyntax/src/main/resources/rule1.drl"); final List<ValidationMessage> errors1 = validator.validate(path, Resources.toString(urlToValidate, Charset.forName("UTF-8"))); final List<ValidationMessage> errors2 = validator.validate(path, Resources.toString(urlToValidate, Charset.forName("UTF-8"))); assertFalse(errors1.isEmpty()); assertFalse(errors2.isEmpty()); assertEquals(errors1.size(), errors2.size()); }
public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); }
DefaultGenericKieValidator implements GenericValidator { public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); } }
DefaultGenericKieValidator implements GenericValidator { public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); } DefaultGenericKieValidator(); @Inject  DefaultGenericKieValidator(final ValidatorBuildService validatorBuildService); }
DefaultGenericKieValidator implements GenericValidator { public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); } DefaultGenericKieValidator(); @Inject  DefaultGenericKieValidator(final ValidatorBuildService validatorBuildService); List<ValidationMessage> validate(final Path path,
                                            final String content); List<ValidationMessage> validate(final Path path); }
DefaultGenericKieValidator implements GenericValidator { public List<ValidationMessage> validate(final Path path, final String content) { return validatorBuildService.validate(path, content) .stream() .filter(fromValidatedPath(path)) .collect(Collectors.toList()); } DefaultGenericKieValidator(); @Inject  DefaultGenericKieValidator(final ValidatorBuildService validatorBuildService); List<ValidationMessage> validate(final Path path,
                                            final String content); List<ValidationMessage> validate(final Path path);  }