Esempio n. 1
0
 protected void readProjects(VirtualFile... files) {
   List<MavenProject> projects = new ArrayList<MavenProject>();
   for (VirtualFile each : files) {
     projects.add(myProjectsManager.findProject(each));
   }
   myProjectsManager.forceUpdateProjects(projects);
   waitForReadingCompletion();
 }
Esempio n. 2
0
 protected void resolveFoldersAndImport() {
   myProjectsManager.scheduleFoldersResolveForAllProjects();
   myProjectsManager.waitForFoldersResolvingCompletion();
   UIUtil.invokeAndWaitIfNeeded(
       new Runnable() {
         @Override
         public void run() {
           myProjectsManager.performScheduledImportInTests();
         }
       });
 }
Esempio n. 3
0
 @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();
 }
Esempio n. 4
0
 @Override
 protected void setUpInWriteAction() throws Exception {
   super.setUpInWriteAction();
   myProjectsManager = MavenProjectsManager.getInstance(myProject);
   removeFromLocalRepository("test");
   if (useJps()) {
     CompilerTestUtil.enableExternalCompiler(myProject);
   } else {
     CompilerTestUtil.disableExternalCompiler(myProject);
   }
 }
Esempio n. 5
0
  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];
  }
Esempio n. 6
0
 protected void performPostImportTasks() {
   myProjectsManager.waitForPostImportTasksCompletion();
 }
Esempio n. 7
0
 protected void downloadArtifacts() {
   downloadArtifacts(myProjectsManager.getProjects(), null);
 }
Esempio n. 8
0
 protected void resolvePlugins() {
   myProjectsManager.waitForPluginsResolvingCompletion();
 }
Esempio n. 9
0
 protected void readProjects() {
   readProjects(myProjectsManager.getProjectsFiles());
 }
Esempio n. 10
0
 protected void scheduleResolveAll() {
   myProjectsManager.scheduleResolveAllInTests();
 }
Esempio n. 11
0
 protected void initProjectsManager(boolean enableEventHandling) {
   myProjectsManager.initForTests();
   myProjectsTree = myProjectsManager.getProjectsTreeForTests();
   if (enableEventHandling) myProjectsManager.listenForExternalChanges();
 }
Esempio n. 12
0
 protected void updateProjectsAndImport(VirtualFile... files) {
   readProjects(files);
   myProjectsManager.performScheduledImportInTests();
 }
Esempio n. 13
0
 protected void readProjects(List<VirtualFile> files, String... profiles) {
   myProjectsManager.resetManagedFilesAndProfilesInTests(files, Arrays.asList(profiles));
   waitForReadingCompletion();
 }