use of org.eclipse.egit.ui.common.WorkingCopyPage in project egit by eclipse.
the class GitCloneWizardTest method alteringSomeParametersDuringClone.
@Test
public void alteringSomeParametersDuringClone() throws Exception {
destRepo = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), "test2");
importWizard.openWizard();
RepoPropertiesPage repoProperties = importWizard.openRepoPropertiesPage();
RepoRemoteBranchesPage remoteBranches = repoProperties.nextToRemoteBranches(r.getUri());
remoteBranches.deselectAllBranches();
remoteBranches.assertErrorMessage("At least one branch must be selected.");
remoteBranches.assertNextIsDisabled();
remoteBranches.selectBranches(SampleTestRepository.FIX);
remoteBranches.assertNextIsEnabled();
WorkingCopyPage workingCopy = remoteBranches.nextToWorkingCopy();
workingCopy.setDirectory(destRepo.toString());
workingCopy.assertBranch(SampleTestRepository.FIX);
workingCopy.setRemoteName("src");
workingCopy.waitForCreate();
// Some random sampling to see we got something. We do not test
// the integrity of the repository here. Only a few basic properties
// we'd expect from a clone made this way, that would possibly
// not hold true given other parameters in the GUI.
Repository repository = FileRepositoryBuilder.create(new File(destRepo, Constants.DOT_GIT));
assertNotNull(repository.resolve("src/" + SampleTestRepository.FIX));
// we didn't clone that one
assertNull(repository.resolve("src/master"));
// and a local master initialized from origin/master (default!)
assertEquals(repository.resolve("stable"), repository.resolve("src/stable"));
// A well known tag
assertNotNull(repository.resolve(Constants.R_TAGS + SampleTestRepository.v2_0_name).name());
// lots of refs
assertTrue(repository.getAllRefs().size() >= 4);
bot.button("Cancel").click();
}
use of org.eclipse.egit.ui.common.WorkingCopyPage in project egit by eclipse.
the class GitCloneWizardTest method clonedRepositoryShouldExistOnFileSystem.
@Test
public void clonedRepositoryShouldExistOnFileSystem() throws Exception {
importWizard.openWizard();
RepoPropertiesPage repoProperties = importWizard.openRepoPropertiesPage();
RepoRemoteBranchesPage remoteBranches = repoProperties.nextToRemoteBranches(r.getUri());
remoteBranches.assertRemoteBranches(SampleTestRepository.FIX, Constants.MASTER);
WorkingCopyPage workingCopy = remoteBranches.nextToWorkingCopy();
workingCopy.assertWorkingCopyExists();
bot.button("Cancel").click();
}
use of org.eclipse.egit.ui.common.WorkingCopyPage in project egit by eclipse.
the class GitCloneWizardTestBase method cloneRepo.
protected void cloneRepo(File destinationRepo, RepoRemoteBranchesPage remoteBranches) throws Exception {
remoteBranches.assertRemoteBranches(SampleTestRepository.FIX, Constants.MASTER);
remoteBranches.selectBranches(SampleTestRepository.FIX, Constants.MASTER);
WorkingCopyPage workingCopy = remoteBranches.nextToWorkingCopy();
workingCopy.setDirectory(destinationRepo.toString());
workingCopy.assertDirectory(destinationRepo.toString());
workingCopy.assertBranch(Constants.MASTER);
workingCopy.assertRemoteName(Constants.DEFAULT_REMOTE_NAME);
workingCopy.waitForCreate();
// Some random sampling to see we got something. We do not test
// the integrity of the repository here. Only a few basic properties
// we'd expect from a clone made this way, that would possibly
// not hold true given other parameters in the GUI.
Repository repository = FileRepositoryBuilder.create(new File(destinationRepo, Constants.DOT_GIT));
// we always have an origin/master
assertNotNull(repository.resolve("origin/master"));
// and a local master initialized from origin/master (default!)
assertEquals(repository.resolve("master"), repository.resolve("origin/master"));
// A well known tag
assertNotNull(repository.resolve(Constants.R_TAGS + SampleTestRepository.v1_0_name).name());
// lots of refs
int refs = repository.getAllRefs().size();
assertTrue(refs >= 4);
// and a known file in the working dir
assertTrue(new File(destinationRepo, SampleTestRepository.A_txt_name).exists());
DirCacheEntry fileEntry = null;
DirCache dc = repository.lockDirCache();
fileEntry = dc.getEntry(SampleTestRepository.A_txt_name);
dc.unlock();
// check that we have the file in the index
assertNotNull(fileEntry);
// No project has been imported
assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
}
Aggregations