Search in sources :

Example 1 with InitOperation

use of org.eclipse.egit.gitflow.op.InitOperation in project egit by eclipse.

the class BranchNameValidatorTest method testBranchNotExists.

@Test
public void testBranchNotExists() throws Exception {
    testRepository.createInitialCommit("testInitOperation\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);
    assertFalse(releaseExists(gfRepo, "notThere"));
}
Also used : Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test) AbstractGitFlowOperationTest(org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)

Example 2 with InitOperation

use of org.eclipse.egit.gitflow.op.InitOperation in project egit by eclipse.

the class BranchNameValidatorTest method testReleaseExists.

@Test
public void testReleaseExists() throws Exception {
    testRepository.createInitialCommit("testInitOperation\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);
    assertTrue(releaseExists(gfRepo, MY_RELEASE));
}
Also used : Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test) AbstractGitFlowOperationTest(org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)

Example 3 with InitOperation

use of org.eclipse.egit.gitflow.op.InitOperation in project egit by eclipse.

the class GitFlowRepositoryTest method testGetReleaseBranches.

@Test
public void testGetReleaseBranches() throws Exception {
    repository1.createInitialCommit("testGetReleaseBranches\n\nfirst commit\n");
    Repository repository = repository1.getRepository();
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    new InitOperation(repository).execute(null);
    assertTrue(gfRepo.getReleaseBranches().isEmpty());
    new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
    assertEquals(R_HEADS + gfRepo.getConfig().getReleasePrefix() + MY_RELEASE, gfRepo.getReleaseBranches().get(0).getName());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Repository(org.eclipse.jgit.lib.Repository) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test)

Example 4 with InitOperation

use of org.eclipse.egit.gitflow.op.InitOperation in project egit by eclipse.

the class GitFlowRepositoryTest method testGetHotfixBranches.

@Test
public void testGetHotfixBranches() throws Exception {
    repository1.createInitialCommit("testGetHotfixBranches\n\nfirst commit\n");
    Repository repository = repository1.getRepository();
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    new InitOperation(repository).execute(null);
    assertTrue(gfRepo.getHotfixBranches().isEmpty());
    new ReleaseStartOperation(gfRepo, MY_RELEASE).execute(null);
    new ReleaseFinishOperation(gfRepo, MY_RELEASE).execute(null);
    new HotfixStartOperation(gfRepo, MY_HOTFIX).execute(null);
    assertEquals(R_HEADS + gfRepo.getConfig().getHotfixPrefix() + MY_HOTFIX, gfRepo.getHotfixBranches().get(0).getName());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Repository(org.eclipse.jgit.lib.Repository) ReleaseFinishOperation(org.eclipse.egit.gitflow.op.ReleaseFinishOperation) ReleaseStartOperation(org.eclipse.egit.gitflow.op.ReleaseStartOperation) HotfixStartOperation(org.eclipse.egit.gitflow.op.HotfixStartOperation) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test)

Example 5 with InitOperation

use of org.eclipse.egit.gitflow.op.InitOperation in project egit by eclipse.

the class GitFlowRepositoryTest method testIsMaster.

@Test
public void testIsMaster() throws Exception {
    repository1.createInitialCommit("testIsMaster\n\nfirst commit\n");
    Repository repository = repository2.getRepository();
    GitFlowRepository gfRepo = new GitFlowRepository(repository);
    assertTrue(gfRepo.isMaster());
    new InitOperation(repository).execute(null);
    assertFalse(gfRepo.isMaster());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Repository(org.eclipse.jgit.lib.Repository) InitOperation(org.eclipse.egit.gitflow.op.InitOperation) Test(org.junit.Test)

Aggregations

InitOperation (org.eclipse.egit.gitflow.op.InitOperation)10 Repository (org.eclipse.jgit.lib.Repository)10 Test (org.junit.Test)9 TestRepository (org.eclipse.egit.core.test.TestRepository)5 ReleaseStartOperation (org.eclipse.egit.gitflow.op.ReleaseStartOperation)4 AbstractGitFlowOperationTest (org.eclipse.egit.gitflow.op.AbstractGitFlowOperationTest)3 FeatureStartOperation (org.eclipse.egit.gitflow.op.FeatureStartOperation)3 GitFlowRepository (org.eclipse.egit.gitflow.GitFlowRepository)1 HotfixStartOperation (org.eclipse.egit.gitflow.op.HotfixStartOperation)1 ReleaseFinishOperation (org.eclipse.egit.gitflow.op.ReleaseFinishOperation)1 InitDialog (org.eclipse.egit.gitflow.ui.internal.dialogs.InitDialog)1 Ref (org.eclipse.jgit.lib.Ref)1 Shell (org.eclipse.swt.widgets.Shell)1