Package org.eclipse.egit.ui.common

Examples of org.eclipse.egit.ui.common.CompareEditorTester


    fileNode.select();
    ContextMenuHelper.clickContextMenu(packageExplorer,
        util.getPluginLocalizedValue("TeamMenu.label"),
        util.getPluginLocalizedValue("MergeToolAction.label"));

    CompareEditorTester compareEditor = CompareEditorTester
        .forTitleContaining("Merging");

    String text = compareEditor.getLeftEditor().getText();
    assertThat(text, is("master"));
  }
View Full Code Here


    // when
    launchSynchronization(HEAD, INITIAL_TAG, true);

    // then
    CompareEditorTester compare = getCompareEditorForFileInGitChangeSet(
        FILE1, true);
    assertNotNull(compare);
  }
View Full Code Here

    makeChangesAndCommit(PROJ1);

    // compare HEAD against tag
    launchSynchronization(HEAD, INITIAL_TAG, false);

    CompareEditorTester outgoingCompare = getCompareEditorForFileInGitChangeSet(
        FILE1, false);
    // save left value from compare editor
    String outgoingLeft = outgoingCompare.getLeftEditor().getText();
    // save right value from compare editor
    String outgoingRight = outgoingCompare.getRightEditor().getText();
    outgoingCompare.close();

    assertNotSame("Text from SWTBot widgets was the same", outgoingLeft, outgoingRight);

    // when
    // compare tag against HEAD
    launchSynchronization(INITIAL_TAG, HEAD, false);

    // then
    CompareEditorTester incomingComp = getCompareEditorForFileInGitChangeSet(
        FILE1, false);
    // right side from compare editor should be equal with left
    assertThat(outgoingLeft, equalTo(incomingComp.getRightEditor().getText()));
    // left side from compare editor should be equal with right
    assertThat(outgoingRight, equalTo(incomingComp.getLeftEditor().getText()));
  }
View Full Code Here

    // when
    launchSynchronization(INITIAL_TAG, HEAD, true);

    // then
    CompareEditorTester editor = getCompareEditorForNonWorkspaceFileInGitChangeSet(name);

    String left = editor.getLeftEditor().getText();
    String right = editor.getRightEditor().getText();
    assertEquals(content, left);
    assertEquals("", right);
  }
View Full Code Here

  @Test
  public void shouldStagePartialChangeInCompareEditor() throws Exception {
    // given
    changeFilesInProject();
    launchSynchronization(HEAD, HEAD, true);
    CompareEditorTester compareEditor = getCompareEditorForFileInGitChangeSet(
        FILE1, true);

    // when
    Display.getDefault().syncExec(new Runnable() {
      public void run() {
        CommonUtils.runCommand("org.eclipse.compare.copyLeftToRight",
            null);
      }
    });
    compareEditor.save();


    // then file FILE1 should be in index
    Repository repo = lookupRepository(repositoryFile);
    Status status = new Git(repo).status().call();
View Full Code Here

  @Test
  public void shouldUnStagePartialChangeInCompareEditor() throws Exception {
    // given
    changeFilesInProject();
    launchSynchronization(HEAD, HEAD, true);
    CompareEditorTester compareEditor = getCompareEditorForFileInGitChangeSet(
        FILE1, true);

    // when
    Display.getDefault().syncExec(new Runnable() {
      public void run() {
        CommonUtils.runCommand("org.eclipse.compare.copyRightToLeft",
            null);
      }
    });
    compareEditor.save();

    // then file FILE1 should be unchanged in working tree
    Repository repo = lookupRepository(repositoryFile);
    Status status = new Git(repo).status().call();
    assertThat(Long.valueOf(status.getModified().size()),
View Full Code Here

    // when
    launchSynchronization(HEAD, INITIAL_TAG, true);

    // then
    CompareEditorTester compare = getCompareEditorForFileInWorkspaceModel(FILE1);
    assertNotNull(compare);
  }
View Full Code Here

    // given
    makeChangesAndCommit(PROJ1);

    // compare HEAD against tag
    launchSynchronization(HEAD, INITIAL_TAG, false);
    CompareEditorTester outgoingCompare = getCompareEditorForFileInWorkspaceModel(
        FILE1);
    // save left value from compare editor
    String outgoingLeft = outgoingCompare.getLeftEditor().getText();
    // save right value from compare editor
    String outgoingRight = outgoingCompare.getRightEditor().getText();
    outgoingCompare.close();

    // when
    // compare tag against HEAD
    launchSynchronization(INITIAL_TAG, HEAD, false);

    // then
    CompareEditorTester incomingComp = getCompareEditorForFileInWorkspaceModel(FILE1);
    String incomingLeft = incomingComp.getLeftEditor().getText();
    String incomingRight = incomingComp.getRightEditor().getText();
    // right side from compare editor should be equal with left
    assertThat(outgoingLeft, equalTo(incomingRight));
    // left side from compare editor should be equal with right
    assertThat(outgoingRight, equalTo(incomingLeft));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.common.CompareEditorTester

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.