Пример #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();
 }
Пример #2
0
 protected void resolveFoldersAndImport() {
   myProjectsManager.scheduleFoldersResolveForAllProjects();
   myProjectsManager.waitForFoldersResolvingCompletion();
   UIUtil.invokeAndWaitIfNeeded(
       new Runnable() {
         @Override
         public void run() {
           myProjectsManager.performScheduledImportInTests();
         }
       });
 }
Пример #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();
 }
Пример #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);
   }
 }
Пример #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];
  }
Пример #6
0
 protected void performPostImportTasks() {
   myProjectsManager.waitForPostImportTasksCompletion();
 }
Пример #7
0
 protected void downloadArtifacts() {
   downloadArtifacts(myProjectsManager.getProjects(), null);
 }
Пример #8
0
 protected void resolvePlugins() {
   myProjectsManager.waitForPluginsResolvingCompletion();
 }
Пример #9
0
 protected void readProjects() {
   readProjects(myProjectsManager.getProjectsFiles());
 }
Пример #10
0
 protected void scheduleResolveAll() {
   myProjectsManager.scheduleResolveAllInTests();
 }
Пример #11
0
 protected void initProjectsManager(boolean enableEventHandling) {
   myProjectsManager.initForTests();
   myProjectsTree = myProjectsManager.getProjectsTreeForTests();
   if (enableEventHandling) myProjectsManager.listenForExternalChanges();
 }
Пример #12
0
 protected void updateProjectsAndImport(VirtualFile... files) {
   readProjects(files);
   myProjectsManager.performScheduledImportInTests();
 }
Пример #13
0
 protected void readProjects(List<VirtualFile> files, String... profiles) {
   myProjectsManager.resetManagedFilesAndProfilesInTests(files, Arrays.asList(profiles));
   waitForReadingCompletion();
 }