use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class InitHandlerTest method testInitEmptyRepoMissingMaster.
@Test
public void testInitEmptyRepoMissingMaster() throws Exception {
String projectName = "AnyProjectName";
TestRepository testRepository = createAndShare(projectName);
selectProject(projectName);
clickInit();
bot.button("Yes").click();
fillDialog(MASTER_BRANCH_MISSING);
bot.waitUntil(shellIsActive(UIText.InitDialog_masterBranchIsMissing));
bot.button("Yes").click();
bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs"));
Repository localRepository = testRepository.getRepository();
GitFlowRepository gitFlowRepository = new GitFlowRepository(localRepository);
GitFlowConfig config = gitFlowRepository.getConfig();
assertEquals(DEVELOP_BRANCH, localRepository.getBranch());
assertEquals(MASTER_BRANCH_MISSING, config.getMaster());
assertEquals(FEATURE_BRANCH_PREFIX, config.getFeaturePrefix());
assertEquals(RELEASE_BRANCH_PREFIX, config.getReleasePrefix());
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
assertNotNull(localRepository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class InitHandlerTest method createAndShare.
private TestRepository createAndShare(String projectName) throws Exception {
IProgressMonitor progressMonitor = new NullProgressMonitor();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(projectName);
project.create(progressMonitor);
project.open(progressMonitor);
TestUtil.waitForJobs(50, 5000);
File gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
TestRepository testRepository = new TestRepository(gitDir);
testRepository.connect(project.getProject());
TestUtil.waitForJobs(50, 5000);
return testRepository;
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class CommitMessageBuilderTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
testRepository = new TestRepository(gitDir);
testRepository.connect(project.getProject());
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitSubscriberMergeContextTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
iProject = project.project;
testRepo = new TestRepository(gitDir);
testRepo.connect(iProject);
repo = RepositoryMapping.getMapping(iProject).getRepository();
// make initial commit
try (Git git = new Git(repo)) {
git.commit().setAuthor("JUnit", "junit@jgit.org").setMessage("Initial commit").call();
}
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitSubscriberResourceMappingContextTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
iProject = project.project;
testRepo = new TestRepository(gitDir);
testRepo.connect(iProject);
repo = RepositoryMapping.getMapping(iProject).getRepository();
// make initial commit
try (Git git = new Git(repo)) {
git.commit().setAuthor("JUnit", "junit@jgit.org").setMessage("Initial commit").call();
}
}
Aggregations