Package org.eclipse.egit.ui.common

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


  @Test
  public void testCommitSingleFile() throws Exception {
    setContent("I have changed this");

    StagingViewTester stagingViewTester = StagingViewTester
        .openStagingView();

    stagingViewTester.stageFile(FILE1_PATH);

    stagingViewTester.setAuthor(TestUtil.TESTAUTHOR);
    stagingViewTester.setCommitter(TestUtil.TESTCOMMITTER);
    stagingViewTester.setCommitMessage("The new commit");
    stagingViewTester.commit();
    TestUtil.checkHeadCommit(repository, TestUtil.TESTAUTHOR,
        TestUtil.TESTCOMMITTER, "The new commit");
  }
View Full Code Here


    RevCommit headCommit = TestUtil.getHeadCommit(repository);
    ObjectId headCommitId = headCommit.getId();
    String changeId = CommitMessageUtil.extractChangeId(headCommit
        .getFullMessage());
    setContent("Changes over changes");
    StagingViewTester stagingViewTester = StagingViewTester
        .openStagingView();
    stagingViewTester.stageFile(FILE1_PATH);
    stagingViewTester.setAmend(true);
    assertTrue(stagingViewTester.getCommitMessage().indexOf("Change-Id") > 0);
    assertTrue(stagingViewTester.getCommitMessage()
        .indexOf("Signed-off-by") > 0);
    assertTrue(stagingViewTester.getSignedOff());
    assertTrue(stagingViewTester.getInsertChangeId());
    stagingViewTester.commit();
    headCommit = TestUtil.getHeadCommit(repository);
    if (headCommitId.equals(headCommit.getId()))
      fail("There is no new commit");
    assertEquals(oldHeadCommit, headCommit.getParent(0));
    assertTrue(headCommit.getFullMessage().indexOf(changeId) > 0);
View Full Code Here

    commitOneFileChange("on master");

    git.merge().include(repository.getRef("side")).call();
    assertEquals(RepositoryState.MERGING, repository.getRepositoryState());

    StagingViewTester stagingView = StagingViewTester
        .openStagingView();
    assertEquals("", stagingView.getCommitMessage());
    stagingView.assertCommitEnabled(false);

    setContent("resolved");
    stagingView.stageFile(FILE1_PATH);
    assertEquals(RepositoryState.MERGING_RESOLVED,
        repository.getRepositoryState());
    String expectedMessage = "Merge branch 'side'";
    assertThat(stagingView.getCommitMessage(), startsWith(expectedMessage));

    stagingView.commit();
    assertEquals(RepositoryState.SAFE, repository.getRepositoryState());

    assertEquals(expectedMessage, TestUtil.getHeadCommit(repository)
        .getShortMessage());
  }
View Full Code Here

  }

  private void commitOneFileChange(String fileContent) throws Exception {
    setContent(fileContent);

    StagingViewTester stagingViewTester = StagingViewTester
        .openStagingView();
    stagingViewTester.stageFile(FILE1_PATH);
    stagingViewTester.setAuthor(TestUtil.TESTAUTHOR);
    stagingViewTester.setCommitter(TestUtil.TESTCOMMITTER);
    stagingViewTester.setCommitMessage("Commit message");
    stagingViewTester.setInsertChangeId(true);
    stagingViewTester.setSignedOff(true);
    String commitMessage = stagingViewTester.getCommitMessage();
    assertTrue(commitMessage.indexOf("Change-Id") > 0);
    assertTrue(commitMessage.indexOf("Signed-off-by") > 0);
    stagingViewTester.commit();
  }
View Full Code Here

TOP

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

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.