Search in sources :

Example 6 with RepoRemoteBranchesPage

use of org.eclipse.egit.ui.common.RepoRemoteBranchesPage in project egit by eclipse.

the class GitCloneWizardTest method canCloneARemoteRepo.

@Test
public void canCloneARemoteRepo() throws Exception {
    destRepo = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), "test1");
    importWizard.openWizard();
    RepoPropertiesPage propertiesPage = importWizard.openRepoPropertiesPage();
    RepoRemoteBranchesPage remoteBranches = propertiesPage.nextToRemoteBranches(r.getUri());
    cloneRepo(destRepo, remoteBranches);
    bot.button("Cancel").click();
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) File(java.io.File) Test(org.junit.Test)

Example 7 with RepoRemoteBranchesPage

use of org.eclipse.egit.ui.common.RepoRemoteBranchesPage 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();
}
Also used : Repository(org.eclipse.jgit.lib.Repository) RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) WorkingCopyPage(org.eclipse.egit.ui.common.WorkingCopyPage) File(java.io.File) Test(org.junit.Test)

Example 8 with RepoRemoteBranchesPage

use of org.eclipse.egit.ui.common.RepoRemoteBranchesPage 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();
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) WorkingCopyPage(org.eclipse.egit.ui.common.WorkingCopyPage) Test(org.junit.Test)

Aggregations

RepoPropertiesPage (org.eclipse.egit.ui.common.RepoPropertiesPage)8 RepoRemoteBranchesPage (org.eclipse.egit.ui.common.RepoRemoteBranchesPage)8 Test (org.junit.Test)7 File (java.io.File)4 Ignore (org.junit.Ignore)3 WorkingCopyPage (org.eclipse.egit.ui.common.WorkingCopyPage)2 Repository (org.eclipse.jgit.lib.Repository)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1