• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LocalTaskImpl类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.intellij.tasks.impl.LocalTaskImpl的典型用法代码示例。如果您正苦于以下问题:Java LocalTaskImpl类的具体用法?Java LocalTaskImpl怎么用?Java LocalTaskImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LocalTaskImpl类属于com.intellij.tasks.impl包,在下文中一共展示了LocalTaskImpl类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testSetTimeSpend

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testSetTimeSpend() throws Exception {
  // only REST API 2.0 supports this feature
  myRepository.setUrl(JIRA_5_TEST_SERVER_URL);
  final String issueId = createIssueViaRestApi("BTTTU", "Test issue for time tracking updates (" + SHORT_TIMESTAMP_FORMAT.format(new Date()) + ")");
  final Task task = myRepository.findTask(issueId);
  assertNotNull("Test task not found", task);

  // timestamp as comment
  final String comment = "Timestamp: " + TaskUtil.formatDate(new Date());

  // semi-unique duration as timeSpend
  // should be no longer than 8 hours in total, because it's considered as one full day
  final int minutes = (int)(System.currentTimeMillis() % 240) + 1;
  final String duration = String.format("%dh %dm", minutes / 60, minutes % 60);
  myRepository.updateTimeSpent(new LocalTaskImpl(task), duration, comment);

  final GetMethod request = new GetMethod(myRepository.getRestUrl("issue", task.getId(), "worklog"));
  final String response = myRepository.executeMethod(request);
  final JsonObject object = new Gson().fromJson(response, JsonObject.class);
  final JsonArray worklogs = object.get("worklogs").getAsJsonArray();
  final JsonObject last = worklogs.get(worklogs.size() - 1).getAsJsonObject();

  assertEquals(comment, last.get("comment").getAsString());
  // don't depend on concrete response format: zero hours stripping, zero padding and so on
  assertEquals(minutes * 60, last.get("timeSpentSeconds").getAsInt());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:27,
代码来源:JiraIntegrationTest.java

示例2: testIssuesCacheSurvival

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testIssuesCacheSurvival() throws Exception {
  final Ref<Boolean> stopper = new Ref<Boolean>(Boolean.FALSE);
  TestRepository repository = new TestRepository(new LocalTaskImpl("foo", "bar")) {
    @Override
    public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
      if (stopper.get()) throw new Exception();
      return super.getIssues(query, max, since);
    }
  };
  ((TaskManagerImpl)myTaskManager).setRepositories(Collections.singletonList(repository));

  List<Task> issues = myTaskManager.getIssues("");
  assertEquals(1, issues.size());

  stopper.set(Boolean.TRUE);
  issues = myTaskManager.getIssues("");
  assertEquals(1, issues.size());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:19,
代码来源:TaskManagerTest.java

示例3: doTest

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
private void doTest(String text, final String after) {
  configureFile(text);
  final TestRepository repository = configureRepository();
  repository.setTasks(new LocalTaskImpl("TEST-001", "Test task") {
    @Override
    public TaskRepository getRepository() {
      return repository;
    }

    @Override
    public boolean isIssue() {
      return true;
    }
  });
  myFixture.completeBasic();
  myFixture.checkResult(after);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:18,
代码来源:TaskCompletionTest.java

示例4: testProjectWithDash

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testProjectWithDash() throws Exception {
  LocalTaskImpl task = new LocalTaskImpl("foo-bar-001", "summary") {
    @Override
    public TaskRepository getRepository() {
      return myRepository;
    }

    @Override
    public boolean isIssue() {
      return true;
    }
  };
  assertEquals("foo-bar", task.getProject());
  assertEquals("001", task.getNumber());
  String name = myTaskManager.getChangelistName(task);
  assertEquals("foo-bar-001 summary", name);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:18,
代码来源:TaskVcsTest.java

示例5: testBranchBloating

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testBranchBloating() throws Exception {
  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));
  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));
  assertEquals(1, defaultTask.getBranches().size());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:18,
代码来源:TaskBranchesTest.java

示例6: testCleanupRemovedBranch

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testCleanupRemovedBranch() throws InterruptedException {
  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));
  assertEquals(2, localTask.getBranches().size());
  assertEquals(1, defaultTask.getBranches().size());

  // let's add non-existing branch
  BranchInfo info = new BranchInfo();
  info.name = "non-existing";
  info.repository = defaultTask.getBranches().get(0).repository;
  defaultTask.addBranch(info);
  assertEquals("foo", repository.getCurrentBranchName());
  myTaskManager.activateTask(defaultTask, false);
  assertEquals(getDefaultBranchName(), repository.getCurrentBranchName());
  // do not re-create "non-existing"
  assertEquals(2, getNumberOfBranches(repository));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:23,
代码来源:TaskBranchesTest.java

示例7: testIssuesCacheSurvival

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testIssuesCacheSurvival() throws Exception {
  final Ref<Boolean> stopper = new Ref<Boolean>(Boolean.FALSE);
  TestRepository repository = new TestRepository(new LocalTaskImpl("foo", "bar")) {
    @Override
    public Task[] getIssues(@Nullable String query, int max, long since) throws Exception {
      if (stopper.get()) throw new Exception();
      return super.getIssues(query, max, since);
    }
  };
  myTaskManager.setRepositories(Collections.singletonList(repository));

  List<Task> issues = myTaskManager.getIssues("");
  assertEquals(1, issues.size());

  stopper.set(Boolean.TRUE);
  issues = myTaskManager.getIssues("");
  assertEquals(1, issues.size());
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:19,
代码来源:TaskManagerTest.java

示例8: testRestoreChangelist

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRestoreChangelist() throws Exception {
  final LocalTaskImpl task = new LocalTaskImpl("foo", "bar");
  activateAndCreateChangelist(task);
  activateAndCreateChangelist(new LocalTaskImpl("next", ""));

  final String changelistName = myTaskManager.getChangelistName(task);
  myChangeListManager.removeChangeList(changelistName);

  myChangeListManager.invokeAfterUpdate(new Runnable() {
    @Override
    public void run() {
      assertTrue(myTaskManager.isLocallyClosed(task));
      activateAndCreateChangelist(task);
      assertNotNull(myChangeListManager.findChangeList(changelistName));
    }
  }, InvokeAfterUpdateMode.SYNCHRONOUS_NOT_CANCELLABLE, "foo", ModalityState.NON_MODAL);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:18,
代码来源:TaskVcsTest.java

示例9: testRestoreChangelist

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRestoreChangelist() throws Exception {
  final LocalTaskImpl task = new LocalTaskImpl("foo", "bar");
  myTaskManager.activateTask(task, true);
  myTaskManager.activateTask(new LocalTaskImpl("next", ""), true);

  final String changelistName = myTaskManager.getChangelistName(task);
  myChangeListManager.removeChangeList(changelistName);

  myChangeListManager.invokeAfterUpdate(new Runnable() {
    @Override
    public void run() {
      assertTrue(myTaskManager.isLocallyClosed(task));
      myTaskManager.activateTask(task, true);
      assertNotNull(myChangeListManager.findChangeList(changelistName));
    }
  }, InvokeAfterUpdateMode.SYNCHRONOUS_NOT_CANCELLABLE, "foo", ModalityState.NON_MODAL);

}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:19,
代码来源:TaskVcsTest.java

示例10: doTest

点赞 3

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
private void doTest(String text, final String after)
{
	configureFile(text);
	final TestRepository repository = configureRepository();
	repository.setTasks(new LocalTaskImpl("TEST-001", "Test task")
	{
		@Override
		public TaskRepository getRepository()
		{
			return repository;
		}

		@Override
		public boolean isIssue()
		{
			return true;
		}
	});
	myFixture.completeBasic();
	myFixture.checkResult(after);
}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:22,
代码来源:TaskCompletionTest.java

示例11: actionPerformed

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  Project project = getEventProject(e);
  if (project != null) {
    LocalTaskImpl task = (LocalTaskImpl)TaskManager.getManager(project).getActiveTask();
    new EditTaskDialog(project, task).show();
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:9,
代码来源:EditTaskAction.java

示例12: testNumberCompletion

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testNumberCompletion() throws Exception {
  configureFile("TEST-0<caret>");
  configureRepository(new LocalTaskImpl("TEST-001", "Test task"), new LocalTaskImpl("TEST-002", "Test task 2"));
  LookupElement[] elements = myFixture.complete(CompletionType.BASIC);
  assertNotNull(elements);
  assertEquals(2, elements.length);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:8,
代码来源:TaskCompletionTest.java

示例13: testKeepOrder

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testKeepOrder() throws Exception {
    configureFile("<caret>");
    configureRepository(new LocalTaskImpl("TEST-002", "Test task 2"),
                        new LocalTaskImpl("TEST-003", "Test task 1"),
                        new LocalTaskImpl("TEST-001", "Test task 1"),
                        new LocalTaskImpl("TEST-004", "Test task 1")
    );

    getManager().updateIssues(null);
    List<Task> issues = getManager().getCachedIssues();
//    assertEquals("TEST-002", issues.get(0).getSummary());

    myFixture.complete(CompletionType.BASIC);
    assertEquals(Arrays.asList("TEST-002", "TEST-003", "TEST-001", "TEST-004"), myFixture.getLookupElementStrings());
  }
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:16,
代码来源:TaskCompletionTest.java

示例14: configureRepository

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
private TestRepository configureRepository(LocalTaskImpl... tasks) {
  TaskManagerImpl manager = getManager();
  TestRepository repository = new TestRepository(tasks);
  manager.setRepositories(Arrays.asList(repository));
  manager.getState().updateEnabled = false;
  return repository;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:8,
代码来源:TaskCompletionTest.java

示例15: testAddChangeListViaCreateChangeListAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaCreateChangeListAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  myTaskManager.createChangeList(defaultTask, "Default (1)");
  myChangeListManager.waitUntilRefreshed();

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListActive);
  assertTrue(defaultChangeListActive.isDefault());
  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals("Default (1)", defaultChangeListActive.getName());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals(LocalChangeList.DEFAULT_NAME, defaultChangeListInactive.getName());

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals("TEST-001 Summary", anotherChangeList.getName());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:39,
代码来源:TaskVcsTest.java

示例16: testRemoveChangelistViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRemoveChangelistViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);

  LocalChangeList defaultChangeList = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeList);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);
  removeChangeList(anotherChangeList);

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(1, defaultTask.getChangeLists().size());
  assertEquals(1, myChangeListManager.getChangeListsCopy().size());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeList));
  assertEquals(LocalChangeList.DEFAULT_NAME, defaultChangeList.getName());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:29,
代码来源:TaskVcsTest.java

示例17: testAddChangeListViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  addChangeList("Default (1)", "");

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListActive);
  assertTrue(myChangeListManager.getDefaultListName(), defaultChangeListActive.isDefault());

  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals(LocalChangeList.DEFAULT_NAME, defaultChangeListActive.getName());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals("Default (1)", defaultChangeListInactive.getName());

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals("TEST-001 Summary", anotherChangeList.getName());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:39,
代码来源:TaskVcsTest.java

示例18: testRestoreChangelist

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRestoreChangelist() throws Exception {
  final LocalTaskImpl task = new LocalTaskImpl("foo", "bar");
  activateAndCreateChangelist(task);
  activateAndCreateChangelist(new LocalTaskImpl("next", ""));

  final String changelistName = myTaskManager.getChangelistName(task);
  myChangeListManager.removeChangeList(changelistName);

  myChangeListManager.invokeAfterUpdate(() -> {
    assertTrue(myTaskManager.isLocallyClosed(task));
    activateAndCreateChangelist(task);
    assertNotNull(myChangeListManager.findChangeList(changelistName));
  }, InvokeAfterUpdateMode.SYNCHRONOUS_NOT_CANCELLABLE, "foo", ModalityState.NON_MODAL);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:15,
代码来源:TaskVcsTest.java

示例19: testSuggestBranchName

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testSuggestBranchName() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  assertTrue(task.isIssue());
  assertEquals("TEST-001", myTaskManager.suggestBranchName(task));

  LocalTaskImpl simple = new LocalTaskImpl("1", "simple");
  assertEquals("simple", myTaskManager.suggestBranchName(simple));

  LocalTaskImpl strange = new LocalTaskImpl("1", "very long and strange summary");
  assertEquals("very-long", myTaskManager.suggestBranchName(strange));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:13,
代码来源:TaskVcsTest.java

示例20: testTaskManager

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
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));
  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));
  assertEquals("foo", repository.getCurrentBranchName());
  commitChanges(repository);

  myTaskManager.mergeBranch(localTask);
  assertEquals(defaultBranchName, repository.getCurrentBranchName());
  assertEquals(1, getNumberOfBranches(repository));

  myTaskManager.activateTask(defaultTask, false);
  myTaskManager.activateTask(foo, false);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:34,
代码来源:TaskBranchesTest.java

示例21: testCommit

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
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));
  commitChanges(repository);
  myTaskManager.mergeBranch(localTask);

  assertEquals(getDefaultBranchName(), repository.getCurrentBranchName());
  assertEquals(1, getNumberOfBranches(repository));
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:13,
代码来源:TaskBranchesTest.java

示例22: testOpenTaskDialog

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testOpenTaskDialog() throws Exception {
  initRepository("foo");
  String defaultBranchName = getDefaultBranchName();
  LocalTaskImpl task = myTaskManager.createLocalTask("foo");
  OpenTaskDialog dialog = new OpenTaskDialog(getProject(), task);
  Disposer.register(myTestRootDisposable, dialog.getDisposable());
  dialog.createTask();
  assertEquals("foo", myTaskManager.getActiveTask().getSummary());
  List<BranchInfo> branches = task.getBranches(true);
  assertEquals(1, branches.size());
  assertEquals(defaultBranchName, branches.get(0).name);
  branches = task.getBranches(false);
  assertEquals(1, branches.size());
  assertEquals("foo", branches.get(0).name);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:16,
代码来源:TaskBranchesTest.java

示例23: testAddChangeListViaCreateChangeListAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaCreateChangeListAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  myTaskManager.createChangeList(defaultTask, "Default (1)");
  myChangeListManager.waitUntilRefreshed();

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListActive);
  assertTrue(defaultChangeListActive.isDefault());
  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals(defaultChangeListActive.getName(), "Default (1)");

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals(defaultChangeListInactive.getName(), LocalChangeList.DEFAULT_NAME);

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals(anotherChangeList.getName(), "TEST-001 Summary");
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:39,
代码来源:TaskVcsTest.java

示例24: testRemoveChangelistViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRemoveChangelistViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);

  LocalChangeList defaultChangeList = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeList);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);
  removeChangeList(anotherChangeList);

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(1, defaultTask.getChangeLists().size());
  assertEquals(1, myChangeListManager.getChangeListsCopy().size());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeList));
  assertEquals(defaultChangeList.getName(), LocalChangeList.DEFAULT_NAME);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:29,
代码来源:TaskVcsTest.java

示例25: testAddChangeListViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  activateAndCreateChangelist(task);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  activateAndCreateChangelist(defaultTask);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  addChangeList("Default (1)", "");

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListActive);
  assertTrue(defaultChangeListActive.isDefault());
  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals(defaultChangeListActive.getName(), LocalChangeList.DEFAULT_NAME);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals(defaultChangeListInactive.getName(), "Default (1)");

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals(anotherChangeList.getName(), "TEST-001 Summary");
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:38,
代码来源:TaskVcsTest.java

示例26: testTaskManager

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testTaskManager() throws Exception {
  List<GitRepository> 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));

  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);

  GitRepository repository = repositories.get(0);
  assertEquals("master", repository.getCurrentBranch().getName());

  foo = myTaskManager.createLocalTask("foo");
  localTask = myTaskManager.activateTask(foo, false);
  myTaskManager.createBranch(localTask, defaultTask, myTaskManager.suggestBranchName(localTask));
  assertEquals("foo", repository.getCurrentBranch().getName());

  myTaskManager.mergeBranch(localTask);
  repository.update();
  assertEquals("master", repository.getCurrentBranch().getName());
  assertEquals(1, repository.getBranches().getLocalBranches().size());

  myTaskManager.activateTask(defaultTask, false);
  myTaskManager.activateTask(foo, false);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:33,
代码来源:TaskBranchesTest.java

示例27: testAddChangeListViaCreateChangeListAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaCreateChangeListAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  myTaskManager.activateTask(task, true);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  myTaskManager.activateTask(defaultTask, true);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  myTaskManager.createChangeList(defaultTask, "Default (1)");
  myChangeListManager.waitUntilRefreshed();

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListActive);
  assertTrue(defaultChangeListActive.isDefault());
  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals(defaultChangeListActive.getName(), "Default (1)");

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals(defaultChangeListInactive.getName(), LocalChangeList.DEFAULT_NAME);

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals(anotherChangeList.getName(), "TEST-001 Summary");
}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:39,
代码来源:TaskVcsTest.java

示例28: testRemoveChangelistViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testRemoveChangelistViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  myTaskManager.activateTask(task, true);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  myTaskManager.activateTask(defaultTask, true);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);

  LocalChangeList defaultChangeList = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeList);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);
  removeChangeList(anotherChangeList);

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(1, defaultTask.getChangeLists().size());
  assertEquals(1, myChangeListManager.getChangeListsCopy().size());

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeList));
  assertEquals(defaultChangeList.getName(), LocalChangeList.DEFAULT_NAME);
}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:29,
代码来源:TaskVcsTest.java

示例29: testAddChangeListViaVcsAction

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testAddChangeListViaVcsAction() throws Exception {
  Task task = myRepository.findTask("TEST-001");
  assertNotNull(task);
  myTaskManager.activateTask(task, true);
  myChangeListManager.waitUntilRefreshed();

  LocalTask defaultTask = myTaskManager.findTask(LocalTaskImpl.DEFAULT_TASK_ID);
  assertNotNull(defaultTask);
  myTaskManager.activateTask(defaultTask, true);
  myChangeListManager.waitUntilRefreshed();
  assertEquals(defaultTask, myTaskManager.getActiveTask());

  LocalTask anotherTask = myTaskManager.findTask("TEST-001");
  assertNotNull(anotherTask);
  addChangeList("Default (1)", "");

  assertEquals(1, anotherTask.getChangeLists().size());
  assertEquals(2, defaultTask.getChangeLists().size());
  assertEquals(3, myChangeListManager.getChangeListsCopy().size());

  LocalChangeList defaultChangeListActive = myChangeListManager.findChangeList(LocalChangeList.DEFAULT_NAME);
  assertNotNull(defaultChangeListActive);
  assertTrue(defaultChangeListActive.isDefault());
  LocalChangeList defaultChangeListInactive = myChangeListManager.findChangeList("Default (1)");
  assertNotNull(defaultChangeListInactive);
  LocalChangeList anotherChangeList = myChangeListManager.findChangeList("TEST-001 Summary");
  assertNotNull(anotherChangeList);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListActive));
  assertEquals(defaultChangeListActive.getName(), LocalChangeList.DEFAULT_NAME);

  assertEquals(defaultTask, myTaskManager.getAssociatedTask(defaultChangeListInactive));
  assertEquals(defaultChangeListInactive.getName(), "Default (1)");

  assertEquals(anotherTask, myTaskManager.getAssociatedTask(anotherChangeList));
  assertEquals(anotherChangeList.getName(), "TEST-001 Summary");
}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:38,
代码来源:TaskVcsTest.java

示例30: testNumberCompletion

点赞 2

import com.intellij.tasks.impl.LocalTaskImpl; //导入依赖的package包/类
public void testNumberCompletion() throws Exception
{
	configureFile("TEST-0<caret>");
	configureRepository(new LocalTaskImpl("TEST-001", "Test task"), new LocalTaskImpl("TEST-002", "Test task 2"));
	LookupElement[] elements = myFixture.complete(CompletionType.BASIC);
	assertNotNull(elements);
	assertEquals(2, elements.length);
}
 

开发者ID:consulo,
项目名称:consulo-tasks,
代码行数:9,
代码来源:TaskCompletionTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)