示例#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();
 }