Search in sources :

Example 1 with OpenTaskDialog

use of com.intellij.tasks.actions.OpenTaskDialog in project intellij-community by JetBrains.

the class TaskBranchesTest method testOpenTaskDialog.

public void testOpenTaskDialog() throws Exception {
    initRepository("foo");
    String defaultBranchName = getDefaultBranchName();
    LocalTaskImpl task = myTaskManager.createLocalTask("foo");
    OpenTaskDialog dialog = new OpenTaskDialog(getProject(), task);
    Disposer.register(getTestRootDisposable(), dialog.getDisposable());
    try {
        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);
    } finally {
        dialog.close(DialogWrapper.OK_EXIT_CODE);
    }
    UIUtil.dispatchAllInvocationEvents();
}
Also used : OpenTaskDialog(com.intellij.tasks.actions.OpenTaskDialog) LocalTaskImpl(com.intellij.tasks.impl.LocalTaskImpl) BranchInfo(com.intellij.tasks.BranchInfo)

Aggregations

BranchInfo (com.intellij.tasks.BranchInfo)1 OpenTaskDialog (com.intellij.tasks.actions.OpenTaskDialog)1 LocalTaskImpl (com.intellij.tasks.impl.LocalTaskImpl)1