use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class InitOperationTest method testInitEmptyRepository.
@Test
public void testInitEmptyRepository() throws Exception {
Repository repository = testRepository.getRepository();
InitOperation initOperation = new InitOperation(repository);
initOperation.execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
assertEquals(gfRepo.getConfig().getDevelopFull(), repository.getFullBranch());
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseFinishOperationTest method testReleaseFinishFail.
@Test
public void testReleaseFinishFail() throws Exception {
testRepository.createInitialCommit("testReleaseFinishFail\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
new BranchOperation(repository, gfRepo.getConfig().getDevelop()).execute(null);
try {
new ReleaseFinishOperation(gfRepo).execute(null);
fail();
} catch (WrongGitFlowStateException e) {
// success
}
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseFinishOperationTest method testReleaseTagWithWrongReferenceExists.
@Test
public void testReleaseTagWithWrongReferenceExists() throws Exception {
testRepository.createInitialCommit("testReleaseTagExists\n\nfirst commit\n");
testRepository.createInitialCommit("testReleaseTagExists\n\nsecond commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
RevCommit next = getPreviousCommit(repository, 1);
ReleaseFinishOperation releaseFinishOperation = new ReleaseFinishOperation(gfRepo);
releaseFinishOperation.createTag(null, next, MY_RELEASE, "irrelevant");
try {
releaseFinishOperation.execute(null);
fail();
} catch (CoreException e) {
assertFalse(e.getStatus().isOK());
}
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseFinishOperationTest method testReleaseTagWithCorrectReferenceExists.
@Test
public void testReleaseTagWithCorrectReferenceExists() throws Exception {
testRepository.createInitialCommit("testReleaseTagExists\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
RevCommit next = getPreviousCommit(repository, 0);
ReleaseFinishOperation releaseFinishOperation = new ReleaseFinishOperation(gfRepo);
releaseFinishOperation.createTag(null, next, MY_RELEASE, "irrelevant");
releaseFinishOperation.execute(null);
}
use of org.eclipse.egit.gitflow.GitFlowRepository in project egit by eclipse.
the class ReleaseStartOperationTest method testReleaseStartFailed.
@Test
public void testReleaseStartFailed() throws Exception {
testRepository.createInitialCommit("testReleaseStart\n\nfirst commit\n");
Repository repository = testRepository.getRepository();
new InitOperation(repository).execute(null);
GitFlowRepository gfRepo = new GitFlowRepository(repository);
createTag(gfRepo.findHead(), MY_RELEASE, "irrelevant", repository);
try {
new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
fail();
} catch (CoreException e) {
assertEquals(gfRepo.getConfig().getDevelopFull(), repository.getFullBranch());
}
}
Aggregations