SolverValidator { public List<ValidationMessage> validate(final Path resourcePath, final String content) { return validate(resourcePath, content, false); } SolverValidator(); @Inject  SolverValidator(final KieModuleService moduleService,
                           final BuildInfoService buildInfoService,
                           final ValidatorBuildService validatorBuildService); List<ValidationMessage> validate(final Path resourcePath,
                                            final String content); List<ValidationMessage> validateAndRun(final Path resourcePath,
                                                  final String content);  }
@Test public void projectPlannerError() throws Exception { final String url = "/ProjectPlannerError/src/main/resources/cb/my.solver.xml"; org.uberfire.java.nio.file.Path path = testFileSystem.fileSystemProvider.getPath(this.getClass().getResource(url).toURI()); final List<ValidationMessage> messages = solverValidator.validate(Paths.convert(path), loadResource(url)); for (ValidationMessage message : messages) { System.out.println(message.getText()); } assertFalse(messages.isEmpty()); }
@Test public void projectWorks() throws Exception { final String url = "/ProjectWorks/src/main/resources/cb/my.solver.xml"; org.uberfire.java.nio.file.Path path = testFileSystem.fileSystemProvider.getPath(this.getClass().getResource(url).toURI()); final List<ValidationMessage> messages = solverValidator.validate(Paths.convert(path), loadResource(url)); for (ValidationMessage message : messages) { System.out.println(message.getText()); } assertTrue(messages.isEmpty()); }
@Test public void projectBuildError() throws Exception { final String url = "/ProjectBuildError/src/main/resources/cb/my.solver.xml"; org.uberfire.java.nio.file.Path path = testFileSystem.fileSystemProvider.getPath(this.getClass().getResource(url).toURI()); final List<ValidationMessage> messages = solverValidator.validate(Paths.convert(path), loadResource(url)); for (ValidationMessage message : messages) { System.out.println(message.getText()); } assertFalse(messages.isEmpty()); }