Search in sources :

Example 11 with RepoPropertiesPage

use of org.eclipse.egit.ui.common.RepoPropertiesPage 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 12 with RepoPropertiesPage

use of org.eclipse.egit.ui.common.RepoPropertiesPage 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)12 Test (org.junit.Test)11 RepoRemoteBranchesPage (org.eclipse.egit.ui.common.RepoRemoteBranchesPage)8 File (java.io.File)4 Ignore (org.junit.Ignore)3 WorkingCopyPage (org.eclipse.egit.ui.common.WorkingCopyPage)2 LoginDialogTester (org.eclipse.egit.ui.common.LoginDialogTester)1 PushResultDialogTester (org.eclipse.egit.ui.common.PushResultDialogTester)1 PushWizardTester (org.eclipse.egit.ui.common.PushWizardTester)1 RefSpecPageTester (org.eclipse.egit.ui.common.RefSpecPageTester)1 Git (org.eclipse.jgit.api.Git)1 Repository (org.eclipse.jgit.lib.Repository)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1