Search in sources :

Example 1 with PlainJavaProjectType

use of org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaProjectType in project che by eclipse.

the class BaseTest method initProjectApi.

@BeforeClass
protected void initProjectApi() throws Exception {
    JavaPlugin javaPlugin = new JavaPlugin(wsPath + "/set", null, null);
    EventService eventService = new EventService();
    TestWorkspaceHolder workspaceHolder = new TestWorkspaceHolder();
    if (root == null)
        root = new File(wsPath);
    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 projectTypeRegistry = new ProjectTypeRegistry(new HashSet<>());
    projectTypeRegistry.registerProjectType(new JavaProjectType(new JavaValueProviderFactory()));
    projectTypeRegistry.registerProjectType(new PlainJavaProjectType(new PlainJavaValueProviderFactory()));
    ProjectHandlerRegistry projectHandlerRegistry = new ProjectHandlerRegistry(new HashSet<>());
    projectRegistry = new ProjectRegistry(workspaceHolder, vfsProvider, projectTypeRegistry, projectHandlerRegistry, eventService);
    projectRegistry.initProjects();
    ProjectImporterRegistry importerRegistry = new ProjectImporterRegistry(new HashSet<>());
    FileWatcherNotificationHandler fileWatcherNotificationHandler = new DefaultFileWatcherNotificationHandler(vfsProvider);
    FileTreeWatcher fileTreeWatcher = new FileTreeWatcher(root, new HashSet<>(), fileWatcherNotificationHandler);
    projectManager = new ProjectManager(vfsProvider, projectTypeRegistry, projectRegistry, projectHandlerRegistry, importerRegistry, fileWatcherNotificationHandler, fileTreeWatcher, new TestWorkspaceHolder(new ArrayList<>()), mock(FileWatcherManager.class));
    ResourcesPlugin plugin = new ResourcesPlugin("target/index", wsPath, () -> projectRegistry, () -> projectManager);
    plugin.start();
    javaPlugin.start();
}
Also used : ProjectTypeRegistry(org.eclipse.che.api.project.server.type.ProjectTypeRegistry) ProjectHandlerRegistry(org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry) PlainJavaProjectType(org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaProjectType) JavaValueProviderFactory(org.eclipse.che.plugin.java.server.projecttype.JavaValueProviderFactory) PlainJavaValueProviderFactory(org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaValueProviderFactory) FileWatcherNotificationHandler(org.eclipse.che.api.vfs.impl.file.FileWatcherNotificationHandler) DefaultFileWatcherNotificationHandler(org.eclipse.che.api.vfs.impl.file.DefaultFileWatcherNotificationHandler) ProjectImporterRegistry(org.eclipse.che.api.project.server.importer.ProjectImporterRegistry) JavaPlugin(org.eclipse.jdt.internal.ui.JavaPlugin) LocalVirtualFileSystemProvider(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystemProvider) EventService(org.eclipse.che.api.core.notification.EventService) ProjectManager(org.eclipse.che.api.project.server.ProjectManager) PathMatcher(java.nio.file.PathMatcher) DefaultFileWatcherNotificationHandler(org.eclipse.che.api.vfs.impl.file.DefaultFileWatcherNotificationHandler) ResourcesPlugin(org.eclipse.core.resources.ResourcesPlugin) PlainJavaValueProviderFactory(org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaValueProviderFactory) ProjectRegistry(org.eclipse.che.api.project.server.ProjectRegistry) FileTreeWatcher(org.eclipse.che.api.vfs.impl.file.FileTreeWatcher) File(java.io.File) JavaProjectType(org.eclipse.che.plugin.java.server.projecttype.JavaProjectType) PlainJavaProjectType(org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaProjectType) HashSet(java.util.HashSet) FSLuceneSearcherProvider(org.eclipse.che.api.vfs.search.impl.FSLuceneSearcherProvider) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

File (java.io.File)1 PathMatcher (java.nio.file.PathMatcher)1 HashSet (java.util.HashSet)1 EventService (org.eclipse.che.api.core.notification.EventService)1 ProjectManager (org.eclipse.che.api.project.server.ProjectManager)1 ProjectRegistry (org.eclipse.che.api.project.server.ProjectRegistry)1 ProjectHandlerRegistry (org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry)1 ProjectImporterRegistry (org.eclipse.che.api.project.server.importer.ProjectImporterRegistry)1 ProjectTypeRegistry (org.eclipse.che.api.project.server.type.ProjectTypeRegistry)1 DefaultFileWatcherNotificationHandler (org.eclipse.che.api.vfs.impl.file.DefaultFileWatcherNotificationHandler)1 FileTreeWatcher (org.eclipse.che.api.vfs.impl.file.FileTreeWatcher)1 FileWatcherNotificationHandler (org.eclipse.che.api.vfs.impl.file.FileWatcherNotificationHandler)1 LocalVirtualFileSystemProvider (org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystemProvider)1 FSLuceneSearcherProvider (org.eclipse.che.api.vfs.search.impl.FSLuceneSearcherProvider)1 PlainJavaProjectType (org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaProjectType)1 PlainJavaValueProviderFactory (org.eclipse.che.plugin.java.plain.server.projecttype.PlainJavaValueProviderFactory)1 JavaProjectType (org.eclipse.che.plugin.java.server.projecttype.JavaProjectType)1 JavaValueProviderFactory (org.eclipse.che.plugin.java.server.projecttype.JavaValueProviderFactory)1 ResourcesPlugin (org.eclipse.core.resources.ResourcesPlugin)1 JavaPlugin (org.eclipse.jdt.internal.ui.JavaPlugin)1