use of org.eclipse.egit.gitflow.GitFlowRepository 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.GitFlowRepository 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);
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseStartOperationTest method testReleaseBranchCreated.
@Test
public void testReleaseBranchCreated() throws Exception {
testRepository.createInitialCommit("testReleaseBranchCreated\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
ReleaseStartOperation releaseStartOperation = new ReleaseStartOperation(gfRepo, MY_RELEASE);
releaseStartOperation.execute(null);
assertNull(releaseStartOperation.getSchedulingRule());
assertEquals(gfRepo.getConfig().getFullReleaseBranchName(MY_RELEASE), repository.getFullBranch());
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseStartOperationTest method testReleaseStartWithContent.
@Test
public void testReleaseStartWithContent() throws Exception {
testRepository.createInitialCommit("testReleaseStartWithContent\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
testUtils.addFileToProject(project.getProject(), "folder1/file1.txt", "Hello world");
testRepository.connect(project.getProject());
testRepository.trackAllFiles(project.getProject());
RevCommit developCommit = testRepository.commit("Initial commit");
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
RevCommit releaseHead = gfRepo.findHead(gfRepo.getConfig().getReleaseBranchName(MY_RELEASE));
assertEquals(developCommit, releaseHead);
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseStartOperationTest method testReleaseBranchCreatedFromHeadCommit.
@Test
public void testReleaseBranchCreatedFromHeadCommit() throws Exception {
RevCommit initialCommit = testRepository.createInitialCommit("testReleaseBranchCreatedFromHeadCommit\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
ReleaseStartOperation releaseStartOperation = new ReleaseStartOperation(gfRepo, initialCommit.getName(), MY_RELEASE);
releaseStartOperation.execute(null);
assertNull(releaseStartOperation.getSchedulingRule());
assertEquals(gfRepo.getConfig().getFullReleaseBranchName(MY_RELEASE), repository.getFullBranch());
}
Aggregations