@Test public void checkConstructContent() { final Path path = mock(Path.class); final Overview overview = mock(Overview.class); when(path.toURI()).thenReturn("file: final GuidedDecisionTableEditorGraphContent content = service.constructContent(path, overview); verify(resourceOpenedEvent, times(1)).fire(any(ResourceOpenedEvent.class)); assertNotNull(content.getModel()); assertEquals(overview, content.getOverview()); }
@Override protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) { final GuidedDecisionTableEditorGraphModel model = load(path); resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo)); return new GuidedDecisionTableEditorGraphContent(model, overview); }
GuidedDecisionTableGraphEditorServiceImpl extends KieService<GuidedDecisionTableEditorGraphContent> implements GuidedDecisionTableGraphEditorService { @Override protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) { final GuidedDecisionTableEditorGraphModel model = load(path); resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo)); return new GuidedDecisionTableEditorGraphContent(model, overview); } }
GuidedDecisionTableGraphEditorServiceImpl extends KieService<GuidedDecisionTableEditorGraphContent> implements GuidedDecisionTableGraphEditorService { @Override protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) { final GuidedDecisionTableEditorGraphModel model = load(path); resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo)); return new GuidedDecisionTableEditorGraphContent(model, overview); } GuidedDecisionTableGraphEditorServiceImpl(); @Inject  GuidedDecisionTableGraphEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                     final CopyService copyService,
                                                     final DeleteService deleteService,
                                                     final RenameService renameService,
                                                     final KieModuleService moduleService,
                                                     final VersionRecordService versionRecordService,
                                                     final GuidedDecisionTableEditorService dtableService,
                                                     final GuidedDecisionTableLinkManager dtableLinkManager,
                                                     final Event<ResourceOpenedEvent> resourceOpenedEvent,
                                                     final CommentedOptionFactory commentedOptionFactory,
                                                     final GuidedDTableResourceTypeDefinition resourceType,
                                                     final DotFileFilter dotFileFilter,
                                                     final SessionInfo sessionInfo); }
GuidedDecisionTableGraphEditorServiceImpl extends KieService<GuidedDecisionTableEditorGraphContent> implements GuidedDecisionTableGraphEditorService { @Override protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) { final GuidedDecisionTableEditorGraphModel model = load(path); resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo)); return new GuidedDecisionTableEditorGraphContent(model, overview); } GuidedDecisionTableGraphEditorServiceImpl(); @Inject  GuidedDecisionTableGraphEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                     final CopyService copyService,
                                                     final DeleteService deleteService,
                                                     final RenameService renameService,
                                                     final KieModuleService moduleService,
                                                     final VersionRecordService versionRecordService,
                                                     final GuidedDecisionTableEditorService dtableService,
                                                     final GuidedDecisionTableLinkManager dtableLinkManager,
                                                     final Event<ResourceOpenedEvent> resourceOpenedEvent,
                                                     final CommentedOptionFactory commentedOptionFactory,
                                                     final GuidedDTableResourceTypeDefinition resourceType,
                                                     final DotFileFilter dotFileFilter,
                                                     final SessionInfo sessionInfo); @Override Path create(final Path context,
                       final String fileName,
                       final GuidedDecisionTableEditorGraphModel model,
                       final String comment); @Override GuidedDecisionTableEditorGraphModel load(final Path path); @Override GuidedDecisionTableEditorGraphContent loadContent(final Path path); @Override Path save(final Path path,
                     final GuidedDecisionTableEditorGraphModel model,
                     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 List<Path> listDecisionTablesInPackage(final Path path); }
GuidedDecisionTableGraphEditorServiceImpl extends KieService<GuidedDecisionTableEditorGraphContent> implements GuidedDecisionTableGraphEditorService { @Override protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) { final GuidedDecisionTableEditorGraphModel model = load(path); resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo)); return new GuidedDecisionTableEditorGraphContent(model, overview); } GuidedDecisionTableGraphEditorServiceImpl(); @Inject  GuidedDecisionTableGraphEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                     final CopyService copyService,
                                                     final DeleteService deleteService,
                                                     final RenameService renameService,
                                                     final KieModuleService moduleService,
                                                     final VersionRecordService versionRecordService,
                                                     final GuidedDecisionTableEditorService dtableService,
                                                     final GuidedDecisionTableLinkManager dtableLinkManager,
                                                     final Event<ResourceOpenedEvent> resourceOpenedEvent,
                                                     final CommentedOptionFactory commentedOptionFactory,
                                                     final GuidedDTableResourceTypeDefinition resourceType,
                                                     final DotFileFilter dotFileFilter,
                                                     final SessionInfo sessionInfo); @Override Path create(final Path context,
                       final String fileName,
                       final GuidedDecisionTableEditorGraphModel model,
                       final String comment); @Override GuidedDecisionTableEditorGraphModel load(final Path path); @Override GuidedDecisionTableEditorGraphContent loadContent(final Path path); @Override Path save(final Path path,
                     final GuidedDecisionTableEditorGraphModel model,
                     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 List<Path> listDecisionTablesInPackage(final Path path);  }