protected void readProjects(VirtualFile... files) { List<MavenProject> projects = new ArrayList<MavenProject>(); for (VirtualFile each : files) { projects.add(myProjectsManager.findProject(each)); } myProjectsManager.forceUpdateProjects(projects); waitForReadingCompletion(); }
protected void resolveFoldersAndImport() { myProjectsManager.scheduleFoldersResolveForAllProjects(); myProjectsManager.waitForFoldersResolvingCompletion(); UIUtil.invokeAndWaitIfNeeded( new Runnable() { @Override public void run() { myProjectsManager.performScheduledImportInTests(); } }); }
@Override protected void tearDown() throws Exception { Messages.setTestDialog(TestDialog.DEFAULT); myProjectsManager.projectClosed(); removeFromLocalRepository("test"); if (useJps()) { CompilerTestUtil.disableExternalCompiler(myProject); FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory()); } super.tearDown(); }
@Override protected void setUpInWriteAction() throws Exception { super.setUpInWriteAction(); myProjectsManager = MavenProjectsManager.getInstance(myProject); removeFromLocalRepository("test"); if (useJps()) { CompilerTestUtil.enableExternalCompiler(myProject); } else { CompilerTestUtil.disableExternalCompiler(myProject); } }
protected MavenArtifactDownloader.DownloadResult downloadArtifacts( Collection<MavenProject> projects, List<MavenArtifact> artifacts) { final MavenArtifactDownloader.DownloadResult[] unresolved = new MavenArtifactDownloader.DownloadResult[1]; AsyncResult<MavenArtifactDownloader.DownloadResult> result = new AsyncResult<MavenArtifactDownloader.DownloadResult>(); result.doWhenDone( new Consumer<MavenArtifactDownloader.DownloadResult>() { @Override public void consume(MavenArtifactDownloader.DownloadResult unresolvedArtifacts) { unresolved[0] = unresolvedArtifacts; } }); myProjectsManager.scheduleArtifactsDownloading(projects, artifacts, true, true, result); myProjectsManager.waitForArtifactsDownloadingCompletion(); return unresolved[0]; }
protected void performPostImportTasks() { myProjectsManager.waitForPostImportTasksCompletion(); }
protected void downloadArtifacts() { downloadArtifacts(myProjectsManager.getProjects(), null); }
protected void resolvePlugins() { myProjectsManager.waitForPluginsResolvingCompletion(); }
protected void readProjects() { readProjects(myProjectsManager.getProjectsFiles()); }
protected void scheduleResolveAll() { myProjectsManager.scheduleResolveAllInTests(); }
protected void initProjectsManager(boolean enableEventHandling) { myProjectsManager.initForTests(); myProjectsTree = myProjectsManager.getProjectsTreeForTests(); if (enableEventHandling) myProjectsManager.listenForExternalChanges(); }
protected void updateProjectsAndImport(VirtualFile... files) { readProjects(files); myProjectsManager.performScheduledImportInTests(); }
protected void readProjects(List<VirtualFile> files, String... profiles) { myProjectsManager.resetManagedFilesAndProfilesInTests(files, Arrays.asList(profiles)); waitForReadingCompletion(); }