Search in sources :

Example 1 with PlanElement

use of org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement in project egit by eclipse.

the class RebaseInteractivePlanTest method moveDownTestThreeElementsWithOneComment.

@Test
public void moveDownTestThreeElementsWithOneComment() throws Exception {
    PlanElement element1 = createPlanElement(false);
    PlanElement element2 = createPlanElement(true);
    PlanElement element3 = createPlanElement(false);
    toDoElements.add(element1);
    toDoElements.add(element2);
    toDoElements.add(element3);
    moveHelper.moveTodoEntryDown(element1);
    assertEquals(element2, toDoElements.get(0));
    assertEquals(element3, toDoElements.get(1));
    assertEquals(element1, toDoElements.get(2));
}
Also used : PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) Test(org.junit.Test)

Example 2 with PlanElement

use of org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement in project egit by eclipse.

the class RebaseInteractivePlanTest method moveUpTestOneElement.

@Test
public void moveUpTestOneElement() throws Exception {
    PlanElement element1 = createPlanElement(false);
    toDoElements.add(element1);
    moveHelper.moveTodoEntryUp(element1);
    assertEquals(element1, toDoElements.get(0));
}
Also used : PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) Test(org.junit.Test)

Example 3 with PlanElement

use of org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement in project egit by eclipse.

the class RebaseInteractivePlanTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
    testRepository = new TestRepository(gitDir);
    testRepository.connect(project.getProject());
    plan = RebaseInteractivePlan.getPlan(testRepository.getRepository());
    toDoElements = new ArrayList<PlanElement>();
    moveHelper = new RebaseInteractivePlan.MoveHelper(toDoElements, plan);
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) RebaseInteractivePlan(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan) MoveHelper(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.MoveHelper) File(java.io.File) PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) Before(org.junit.Before)

Example 4 with PlanElement

use of org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement in project egit by eclipse.

the class RebaseInteractivePlanTest method moveDownTestTwoElements.

@Test
public void moveDownTestTwoElements() throws Exception {
    PlanElement element1 = createPlanElement(false);
    PlanElement element2 = createPlanElement(false);
    toDoElements.add(element1);
    toDoElements.add(element2);
    moveHelper.moveTodoEntryDown(element1);
    assertEquals(element2, toDoElements.get(0));
    assertEquals(element1, toDoElements.get(1));
    moveHelper.moveTodoEntryDown(element1);
    assertEquals(element2, toDoElements.get(0));
    assertEquals(element1, toDoElements.get(1));
    moveHelper.moveTodoEntryDown(element2);
    assertEquals(element1, toDoElements.get(0));
    assertEquals(element2, toDoElements.get(1));
}
Also used : PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) Test(org.junit.Test)

Example 5 with PlanElement

use of org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement in project egit by eclipse.

the class RebaseInteractivePlanTest method moveUpTestThreeElementsWithOneComment.

@Test
public void moveUpTestThreeElementsWithOneComment() throws Exception {
    PlanElement element1 = createPlanElement(false);
    PlanElement element2 = createPlanElement(true);
    PlanElement element3 = createPlanElement(false);
    toDoElements.add(element1);
    toDoElements.add(element2);
    toDoElements.add(element3);
    moveHelper.moveTodoEntryUp(element3);
    assertEquals(element3, toDoElements.get(0));
    assertEquals(element1, toDoElements.get(1));
    assertEquals(element2, toDoElements.get(2));
}
Also used : PlanElement(org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement) Test(org.junit.Test)

Aggregations

PlanElement (org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.PlanElement)15 Test (org.junit.Test)6 ElementAction (org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.ElementAction)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 ArrayList (java.util.ArrayList)2 RebaseInteractivePlan (org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan)2 ElementType (org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.ElementType)2 File (java.io.File)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 List (java.util.List)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IResource (org.eclipse.core.resources.IResource)1 IPreferenceChangeListener (org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener)1 PreferenceChangeEvent (org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)1 InstanceScope (org.eclipse.core.runtime.preferences.InstanceScope)1 AdapterUtils (org.eclipse.egit.core.AdapterUtils)1 RepositoryUtil (org.eclipse.egit.core.RepositoryUtil)1 MoveHelper (org.eclipse.egit.core.internal.rebase.RebaseInteractivePlan.MoveHelper)1 RepositoryMapping (org.eclipse.egit.core.project.RepositoryMapping)1