Search in sources :

Example 36 with EmptyProgressIndicator

use of com.intellij.openapi.progress.EmptyProgressIndicator in project intellij-community by JetBrains.

the class SvnNativeClientAuthTest method updateSimple.

private void updateSimple(File wc1) {
    Assert.assertTrue(wc1.isDirectory());
    final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1);
    final UpdatedFiles files = UpdatedFiles.create();
    final UpdateSession session = myVcs.getUpdateEnvironment().updateDirectories(new FilePath[] { VcsUtil.getFilePath(vf) }, files, new EmptyProgressIndicator(), new Ref<>());
    Assert.assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
    Assert.assertTrue(!session.isCanceled());
    if (myIsSecure) {
        ++myExpectedCreds;
        ++myExpectedCert;
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) UpdateSession(com.intellij.openapi.vcs.update.UpdateSession) UpdatedFiles(com.intellij.openapi.vcs.update.UpdatedFiles)

Example 37 with EmptyProgressIndicator

use of com.intellij.openapi.progress.EmptyProgressIndicator in project intellij-community by JetBrains.

the class SvnProtocolsTest method testUpdateImpl.

// todo this test writes to repository - so it's disabled for now - while admins are preparing a server
/*
  @Test
  public void testUpdateAndCommit() throws Exception {
    for (String url : ourTestURL) {
      final File wc1 = testCheckoutImpl(url);
      final File wc2 = testCheckoutImpl(url);

      final File file = testCommitImpl(wc1);
      System.out.println("Committed file: " + file.getPath());
      testUpdateImpl(wc2, file);
    }
  }*/
private void testUpdateImpl(File wc1, final File created) {
    Assert.assertTrue(wc1.isDirectory());
    final VirtualFile vf = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wc1);
    final UpdatedFiles files = UpdatedFiles.create();
    final UpdateSession session = myVcs.getUpdateEnvironment().updateDirectories(new FilePath[] { VcsUtil.getFilePath(vf) }, files, new EmptyProgressIndicator(), new Ref<>());
    Assert.assertTrue(session.getExceptions() == null || session.getExceptions().isEmpty());
    Assert.assertTrue(!session.isCanceled());
    Assert.assertTrue(!files.getGroupById(FileGroup.CREATED_ID).getFiles().isEmpty());
    final String path = files.getGroupById(FileGroup.CREATED_ID).getFiles().iterator().next();
    final String name = path.substring(path.lastIndexOf(File.separator) + 1);
    Assert.assertEquals(created.getName(), name);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) UpdateSession(com.intellij.openapi.vcs.update.UpdateSession) UpdatedFiles(com.intellij.openapi.vcs.update.UpdatedFiles)

Example 38 with EmptyProgressIndicator

use of com.intellij.openapi.progress.EmptyProgressIndicator in project intellij-community by JetBrains.

the class MavenImportingTestCase method executeGoal.

protected void executeGoal(String relativePath, String goal) {
    VirtualFile dir = myProjectRoot.findFileByRelativePath(relativePath);
    MavenRunnerParameters rp = new MavenRunnerParameters(true, dir.getPath(), Arrays.asList(goal), Collections.<String>emptyList());
    MavenRunnerSettings rs = new MavenRunnerSettings();
    MavenExecutor e = new MavenExternalExecutor(myProject, rp, getMavenGeneralSettings(), rs, new SoutMavenConsole());
    e.execute(new EmptyProgressIndicator());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator)

Example 39 with EmptyProgressIndicator

use of com.intellij.openapi.progress.EmptyProgressIndicator in project intellij-community by JetBrains.

the class MantisIntegrationTest method testMantis12.

public void testMantis12() throws Exception {
    assertTrue(myRepository.getProjects().size() >= 2);
    final MantisProject mantisProject = myRepository.getProjects().get(1);
    assertEquals(mantisProject.getName(), "Mantis 1.2 project 1");
    myRepository.setCurrentProject(mantisProject);
    assertTrue(mantisProject.getFilters().size() >= 2);
    MantisFilter mantisFilter = null;
    for (MantisFilter filter : mantisProject.getFilters()) {
        if (filter.getName().equals("Mantis 1.2 Filter 1")) {
            mantisFilter = filter;
        }
    }
    assertNotNull(mantisFilter);
    myRepository.setCurrentFilter(mantisFilter);
    final Task[] issues = myRepository.getIssues("", 0, 1, true, new EmptyProgressIndicator());
    assertTrue(issues.length >= 1);
    final Task task = issues[0];
    assertEquals("1", task.getId());
    // not available here, but is defined in practice, after task has been activated and thus updated from server
    //assertEquals("Mantis 1.2 project 1", task.getProject());
    assertEquals("1", task.getNumber());
    assertEquals("M12P1I1", task.getSummary());
    final Task task1 = myRepository.findTask("1");
    assertNotNull(task1);
    assertEquals("1", task1.getId());
    assertEquals("Mantis 1.2 project 1", task1.getProject());
    assertEquals("1", task1.getNumber());
    assertEquals("M12P1I1", task1.getSummary());
    assertEquals(".", task1.getDescription());
    HttpClient client = new HttpClient();
    final GetMethod method = new GetMethod(task1.getIssueUrl());
    client.executeMethod(method);
    assertEquals(method.getStatusCode(), 200);
}
Also used : MantisFilter(com.intellij.tasks.mantis.MantisFilter) Task(com.intellij.tasks.Task) MantisProject(com.intellij.tasks.mantis.MantisProject) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) HttpClient(org.apache.commons.httpclient.HttpClient) GetMethod(org.apache.commons.httpclient.methods.GetMethod)

Example 40 with EmptyProgressIndicator

use of com.intellij.openapi.progress.EmptyProgressIndicator in project intellij-community by JetBrains.

the class ArchetypesTest method testGenerating.

public void testGenerating() throws Exception {
    if (!hasMavenInstallation())
        return;
    File dir = new File(myDir.getPath(), "generated");
    dir.mkdirs();
    MavenRunnerParameters params = new MavenRunnerParameters(false, dir.getPath(), Arrays.asList("org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate"), Collections.<String>emptyList());
    MavenRunnerSettings settings = new MavenRunnerSettings();
    Map<String, String> props = new THashMap<>();
    props.put("archetypeGroupId", "org.apache.maven.archetypes");
    props.put("archetypeArtifactId", "maven-archetype-quickstart");
    props.put("archetypeVersion", "1.0");
    props.put("interactiveMode", "false");
    props.put("groupId", "foo");
    props.put("groupId", "foo");
    props.put("artifactId", "bar");
    settings.setMavenProperties(props);
    MavenExecutor exec;
    settings.setJreName(MavenRunnerSettings.USE_INTERNAL_JAVA);
    exec = new MavenExternalExecutor(myProject, params, getMavenGeneralSettings(), settings, NULL_MAVEN_CONSOLE);
    exec.execute(new EmptyProgressIndicator());
    assertTrue(new File(dir, "bar/pom.xml").exists());
}
Also used : MavenRunnerSettings(org.jetbrains.idea.maven.execution.MavenRunnerSettings) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) THashMap(gnu.trove.THashMap) MavenExecutor(org.jetbrains.idea.maven.execution.MavenExecutor) File(java.io.File) MavenExternalExecutor(org.jetbrains.idea.maven.execution.MavenExternalExecutor) MavenRunnerParameters(org.jetbrains.idea.maven.execution.MavenRunnerParameters)

Aggregations

EmptyProgressIndicator (com.intellij.openapi.progress.EmptyProgressIndicator)46 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)14 NotNull (org.jetbrains.annotations.NotNull)14 VirtualFile (com.intellij.openapi.vfs.VirtualFile)9 IOException (java.io.IOException)6 ProgressManager (com.intellij.openapi.progress.ProgressManager)5 Test (org.junit.Test)5 StudioProgressIndicatorAdapter (com.android.tools.idea.sdk.progress.StudioProgressIndicatorAdapter)4 Processor (com.intellij.util.Processor)4 File (java.io.File)4 UpdatedFiles (com.intellij.openapi.vcs.update.UpdatedFiles)3 DiffLog (com.intellij.psi.impl.source.text.DiffLog)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Future (java.util.concurrent.Future)3 Nullable (org.jetbrains.annotations.Nullable)3 Disposable (com.intellij.openapi.Disposable)2 ApplicationManager (com.intellij.openapi.application.ApplicationManager)2 Logger (com.intellij.openapi.diagnostic.Logger)2 PluginId (com.intellij.openapi.extensions.PluginId)2