use of org.eclipse.che.api.vfs.watcher.FileWatcherManager in project che by eclipse.
the class WsAgentTestBase method setUp.
public void setUp() throws Exception {
if (workspaceHolder == null)
workspaceHolder = new TestWorkspaceHolder();
if (root == null)
root = new File(FS_PATH);
if (root.exists()) {
IoUtil.deleteRecursive(root);
}
root.mkdir();
File indexDir = new File(INDEX_PATH);
if (indexDir.exists()) {
IoUtil.deleteRecursive(indexDir);
}
indexDir.mkdir();
Set<PathMatcher> filters = new HashSet<>();
filters.add(path -> true);
FSLuceneSearcherProvider sProvider = new FSLuceneSearcherProvider(indexDir, filters);
vfsProvider = new LocalVirtualFileSystemProvider(root, sProvider);
projectTypeRegistry = new ProjectTypeRegistry(new HashSet<>());
projectTypeRegistry.registerProjectType(new PT1());
projectHandlerRegistry = new ProjectHandlerRegistry(new HashSet<>());
this.eventService = new EventService();
projectRegistry = new ProjectRegistry(workspaceHolder, vfsProvider, projectTypeRegistry, projectHandlerRegistry, eventService);
projectRegistry.initProjects();
this.importerRegistry = new ProjectImporterRegistry(new HashSet<>());
fileWatcherNotificationHandler = new DefaultFileWatcherNotificationHandler(vfsProvider);
fileTreeWatcher = new FileTreeWatcher(root, new HashSet<>(), fileWatcherNotificationHandler);
fileWatcherManager = mock(FileWatcherManager.class);
TestWorkspaceHolder wsHolder = new TestWorkspaceHolder();
pm = new ProjectManager(vfsProvider, projectTypeRegistry, projectRegistry, projectHandlerRegistry, importerRegistry, fileWatcherNotificationHandler, fileTreeWatcher, wsHolder, fileWatcherManager);
pm.initWatcher();
}
Aggregations