WorkItemsEditorServiceImpl extends KieService<WorkItemsModelContent> implements WorkItemsEditorService { @Override public List<ValidationMessage> validate(final Path path) { try { final String content = ioService.readAllString(Paths.convert(path)); return validate(path, content); } catch (Exception e) { throw ExceptionUtilities.handleException(e); } } WorkItemsEditorServiceImpl(); @Inject  WorkItemsEditorServiceImpl(final SessionInfo sessionInfo); @PostConstruct void setupWorkItemDefinitionElements(); @Override Path create(final Path context,
                       final String fileName,
                       final String content,
                       final String comment); @Override String load(final Path path); @Override WorkItemsModelContent loadContent(final Path path); @Override WorkItemDefinitionElements loadDefinitionElements(); @Override Path save(final Path resource,
                     final String content,
                     final Metadata metadata,
                     final String comment); @Override void delete(final Path path,
                       final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final Path targetDirectory,
                     final String comment); @Override boolean accepts(final Path path); @Override List<ValidationMessage> validate(final Path path); @Override List<ValidationMessage> validate(final Path path,
                                            final String content); @Override Set<PortableWorkDefinition> loadWorkItemDefinitions(final Path path); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final Metadata metadata,
                              final String content,
                              final String comment);  }
@Test public void testValidWid() throws Exception { assertEquals(0, service.validate(path, loadFile("validWorkItemDefinition.wid")).size()); }
@Test public void testMissingCustomDataType() throws Exception { List<ValidationMessage> messages = service.validate(path, loadFile("missingCustomDataTypeDefinition.wid")); assertEquals(1, messages.size()); assertTrue("Expected error about missing import", messages.get(0).getText().contains("Error: could not resolve class: MyCustomDataType")); }