use of org.eclipse.egit.gitflow.InitParameters in project egit by eclipse.
the class ReleaseFinishOperationTest method testReleaseFinishSingleCommit.
@Test
public void testReleaseFinishSingleCommit() throws Exception {
testRepository.createInitialCommit("testReleaseFinish\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
InitParameters initParameters = new InitParameters();
initParameters.setDevelop(DEVELOP);
initParameters.setMaster(MASTER);
initParameters.setFeature(FEATURE_PREFIX);
initParameters.setRelease(RELEASE_PREFIX);
initParameters.setHotfix(HOTFIX_PREFIX);
initParameters.setVersionTag(MY_VERSION_TAG);
new InitOperation(repository, initParameters).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
RevCommit branchCommit = testRepository.createInitialCommit("testReleaseFinish\n\nbranch commit\n");
new ReleaseFinishOperation(gfRepo).execute(null);
assertEquals(gfRepo.getConfig().getDevelopFull(), repository.getFullBranch());
String branchName = gfRepo.getConfig().getReleaseBranchName(MY_RELEASE);
// tag created?
RevCommit taggedCommit = gfRepo.findCommitForTag(MY_VERSION_TAG + MY_RELEASE);
assertEquals(formatMergeCommitMessage(branchName), taggedCommit.getShortMessage());
// branch removed?
assertEquals(findBranch(repository, branchName), null);
RevCommit developHead = gfRepo.findHead(DEVELOP);
assertNotEquals(branchCommit, developHead);
RevCommit masterHead = gfRepo.findHead(MY_MASTER);
assertEquals(formatMergeCommitMessage(branchName), masterHead.getShortMessage());
}
use of org.eclipse.egit.gitflow.InitParameters in project egit by eclipse.
the class ReleaseFinishOperationTest method testReleaseFinish.
@Test
public void testReleaseFinish() throws Exception {
testRepository.createInitialCommit("testReleaseFinish\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
InitParameters initParameters = new InitParameters();
initParameters.setDevelop(DEVELOP);
initParameters.setMaster(MASTER);
initParameters.setFeature(FEATURE_PREFIX);
initParameters.setRelease(RELEASE_PREFIX);
initParameters.setHotfix(HOTFIX_PREFIX);
initParameters.setVersionTag(MY_VERSION_TAG);
new InitOperation(repository, initParameters).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
addFileAndCommit("foo.txt", "testReleaseFinish\n\nbranch commit 1\n");
addFileAndCommit("bar.txt", "testReleaseFinish\n\nbranch commit 2\n");
ReleaseFinishOperation releaseFinishOperation = new ReleaseFinishOperation(gfRepo);
releaseFinishOperation.execute(null);
assertEquals(gfRepo.getConfig().getDevelopFull(), repository.getFullBranch());
String branchName = gfRepo.getConfig().getReleaseBranchName(MY_RELEASE);
// tag created?
RevCommit taggedCommit = gfRepo.findCommitForTag(MY_VERSION_TAG + MY_RELEASE);
assertEquals(formatMergeCommitMessage(branchName), taggedCommit.getFullMessage());
// branch removed?
assertEquals(findBranch(repository, branchName), null);
}
Aggregations