Search in sources :

Example 6 with LocalTaskImpl

use of com.intellij.tasks.impl.LocalTaskImpl in project intellij-community by JetBrains.

the class RedmineIntegrationTest method testCommitMessageFormat.

public void testCommitMessageFormat() throws Exception {
    myRepository.setCommitMessageFormat("{project} {number} {id} {summary}");
    myRepository.setShouldFormatCommitMessage(true);
    LocalTaskImpl localTask = new LocalTaskImpl(myRepository.findTask(String.valueOf(7)));
    assertEquals("prj-1 7 7 Summary contains 'baz'", TaskUtil.getChangeListComment(localTask));
}
Also used : LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl)

Example 7 with LocalTaskImpl

use of com.intellij.tasks.impl.LocalTaskImpl in project intellij-community by JetBrains.

the class YouTrackIntegrationTest method testTimeTracking.

// IDEA-101238
public void testTimeTracking() throws Exception {
    final HttpClient client = myRepository.getHttpClient();
    authenticate(client);
    final String issueId = createIssue(client);
    final Task task = myRepository.findTask(issueId);
    assertNotNull(task);
    final Couple<Integer> duration = generateWorkItemDuration();
    final String spentTime = formatDuration(duration.getFirst(), duration.getSecond());
    myRepository.updateTimeSpent(new LocalTaskImpl(task), spentTime, "Foo Bar");
    checkSpentTime(client, issueId, spentTime);
}
Also used : Task(com.intellij.tasks.Task) LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl) HttpClient(org.apache.commons.httpclient.HttpClient)

Example 8 with LocalTaskImpl

use of com.intellij.tasks.impl.LocalTaskImpl in project intellij-community by JetBrains.

the class TaskBranchesTest method testBranchBloating.

public void testBranchBloating() throws Exception {
    Repository repository = initRepository("foo");
    LocalTask defaultTask = myTaskManager.getActiveTask();
    assertNotNull(defaultTask);
    assertEquals(0, defaultTask.getBranches().size());
    LocalTaskImpl foo = myTaskManager.createLocalTask("foo");
    LocalTask localTask = myTaskManager.activateTask(foo, false);
    myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask), null);
    repository.update();
    assertEquals(2, localTask.getBranches().size());
    assertEquals(1, defaultTask.getBranches().size());
    myTaskManager.activateTask(localTask, false);
    LocalTaskImpl bar = myTaskManager.createLocalTask("bar");
    LocalTask barTask = myTaskManager.activateTask(bar, false);
    myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(barTask), null);
    repository.update();
    assertEquals(1, defaultTask.getBranches().size());
}
Also used : Repository(com.intellij.dvcs.repo.Repository) LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl) LocalTask(com.intellij.tasks.LocalTask)

Example 9 with LocalTaskImpl

use of com.intellij.tasks.impl.LocalTaskImpl in project intellij-community by JetBrains.

the class TaskBranchesTest method testTaskManager.

public void testTaskManager() throws Exception {
    List<Repository> repositories = initRepositories("community", "idea");
    LocalTask defaultTask = myTaskManager.getActiveTask();
    assertNotNull(defaultTask);
    LocalTaskImpl foo = myTaskManager.createLocalTask("foo");
    LocalTask localTask = myTaskManager.activateTask(foo, false);
    myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask), null);
    String defaultBranchName = getDefaultBranchName();
    assertEquals(4, localTask.getBranches().size());
    assertEquals(2, localTask.getBranches(true).size());
    assertEquals(2, localTask.getBranches(false).size());
    assertEquals(2, defaultTask.getBranches().size());
    myTaskManager.activateTask(defaultTask, false);
    Repository repository = repositories.get(0);
    assertEquals(defaultBranchName, repository.getCurrentBranchName());
    foo = myTaskManager.createLocalTask("foo");
    localTask = myTaskManager.activateTask(foo, false);
    myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask), null);
    assertEquals("foo", repository.getCurrentBranchName());
    createAndCommitChanges(repository);
    myTaskManager.mergeBranch(localTask);
    repository.update();
    assertEquals(defaultBranchName, repository.getCurrentBranchName());
    assertEquals(1, getNumberOfBranches(repository));
    myTaskManager.activateTask(defaultTask, false);
    myTaskManager.activateTask(foo, false);
}
Also used : Repository(com.intellij.dvcs.repo.Repository) LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl) LocalTask(com.intellij.tasks.LocalTask)

Example 10 with LocalTaskImpl

use of com.intellij.tasks.impl.LocalTaskImpl in project intellij-community by JetBrains.

the class TaskBranchesTest method testCommit.

public void testCommit() throws Exception {
    Repository repository = initRepository("foo");
    LocalTask defaultTask = myTaskManager.getActiveTask();
    LocalTaskImpl foo = myTaskManager.createLocalTask("foo");
    final LocalTask localTask = myTaskManager.activateTask(foo, false);
    myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask), null);
    createAndCommitChanges(repository);
    myTaskManager.mergeBranch(localTask);
    repository.update();
    assertEquals(getDefaultBranchName(), repository.getCurrentBranchName());
    assertEquals(1, getNumberOfBranches(repository));
}
Also used : Repository(com.intellij.dvcs.repo.Repository) LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl) LocalTask(com.intellij.tasks.LocalTask)

Aggregations

LocalTaskImpl (com.intellij.tasks.impl.LocalTaskImpl)20 LocalTask (com.intellij.tasks.LocalTask)5 Repository (com.intellij.dvcs.repo.Repository)4 BranchInfo (com.intellij.tasks.BranchInfo)2 Gson (com.google.gson.Gson)1 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 Project (com.intellij.openapi.project.Project)1 Ref (com.intellij.openapi.util.Ref)1 Task (com.intellij.tasks.Task)1 TaskManager (com.intellij.tasks.TaskManager)1 OpenTaskDialog (com.intellij.tasks.actions.OpenTaskDialog)1 GitlabTask (com.intellij.tasks.gitlab.GitlabTask)1 GitlabIssue (com.intellij.tasks.gitlab.model.GitlabIssue)1 GitlabProject (com.intellij.tasks.gitlab.model.GitlabProject)1 TaskManagerImpl (com.intellij.tasks.impl.TaskManagerImpl)1 SimpleActionGroup (com.intellij.tools.SimpleActionGroup)1 HttpClient (org.apache.commons.httpclient.HttpClient)1 GetMethod (org.apache.commons.httpclient.methods.GetMethod)1