Search in sources :

Example 1 with RepoRemoteBranchesPage

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

the class GitCloneWizardHttpTest method canCloneARemoteRepo.

@Test
public void canCloneARemoteRepo() throws Exception {
    destRepo = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), "test" + System.nanoTime());
    importWizard.openWizard();
    RepoPropertiesPage propertiesPage = importWizard.openRepoPropertiesPage();
    propertiesPage.setURI(r.getUri());
    propertiesPage.setUser("agitter");
    propertiesPage.setPassword("letmein");
    propertiesPage.setStoreInSecureStore(false);
    RepoRemoteBranchesPage remoteBranches = propertiesPage.nextToRemoteBranches();
    cloneRepo(destRepo, remoteBranches);
}
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 2 with RepoRemoteBranchesPage

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

the class GitCloneWizardHttpsTest method canCloneARemoteRepo.

@Test
public void canCloneARemoteRepo() throws Exception {
    destRepo = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(), "test" + System.nanoTime());
    importWizard.openWizard();
    RepoPropertiesPage propertiesPage = importWizard.openRepoPropertiesPage();
    propertiesPage.setURI(r.getSecureUri());
    propertiesPage.setUser("agitter");
    propertiesPage.setPassword("letmein");
    propertiesPage.setStoreInSecureStore(false);
    SWTBotShell wizardShell = bot.activeShell();
    RepoRemoteBranchesPage remoteBranches = propertiesPage.nextToRemoteBranches();
    bot.waitUntil(shellIsActive(UIText.EGitCredentialsProvider_information));
    // SSL trust dialog
    bot.checkBox(1).select();
    bot.button("OK").click();
    bot.waitUntil(new ActiveShell(wizardShell, "import wizard shell"));
    cloneRepo(destRepo, remoteBranches);
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) File(java.io.File) Test(org.junit.Test)

Example 3 with RepoRemoteBranchesPage

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

the class GitCloneWizardTest method invalidPortFreezesDialog.

// TODO network timeouts seem to be longer on cental EGit build
// Test is ignored to fix the build
@Ignore
@Test
public void invalidPortFreezesDialog() throws Exception {
    importWizard.openWizard();
    RepoPropertiesPage repoProperties = importWizard.openRepoPropertiesPage();
    RepoRemoteBranchesPage remoteBranches = repoProperties.nextToRemoteBranches("git://localhost:80/EGIT");
    remoteBranches.assertErrorMessage(NLS.bind(UIText.SourceBranchPage_CompositeTransportErrorMessage, "Exception caught during execution of ls-remote command", "git://localhost:80/EGIT: Connection refused"));
    remoteBranches.assertCannotProceed();
    remoteBranches.cancel();
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with RepoRemoteBranchesPage

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

the class GitCloneWizardTest method invalidHostnameFreezesDialog.

// TODO network timeouts seem to be longer on cental EGit build
// Test is ignored to fix the build
@Ignore
@Test
public void invalidHostnameFreezesDialog() throws Exception {
    importWizard.openWizard();
    RepoPropertiesPage repoProperties = importWizard.openRepoPropertiesPage();
    RepoRemoteBranchesPage remoteBranches = repoProperties.nextToRemoteBranches("git://no.example.com/EGIT");
    remoteBranches.assertErrorMessage(NLS.bind(UIText.SourceBranchPage_CompositeTransportErrorMessage, "Exception caught during execution of ls-remote command", "git://no.example.com/EGIT: unknown host"));
    remoteBranches.assertCannotProceed();
    remoteBranches.cancel();
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 5 with RepoRemoteBranchesPage

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

the class GitCloneWizardTest method timeoutToASocketFreezesDialog.

// TODO: Broken, seems that this takes forever and does not come back with
// an error. Perhaps set a higher timeout for this test ?
@Ignore
public void timeoutToASocketFreezesDialog() throws Exception {
    importWizard.openWizard();
    RepoPropertiesPage repoProperties = importWizard.openRepoPropertiesPage();
    RepoRemoteBranchesPage remoteBranches = repoProperties.nextToRemoteBranches("git://www.example.com/EGIT");
    remoteBranches.assertErrorMessage("git://www.example.com/EGIT: unknown host");
    remoteBranches.assertCannotProceed();
    remoteBranches.cancel();
}
Also used : RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) RepoRemoteBranchesPage(org.eclipse.egit.ui.common.RepoRemoteBranchesPage) Ignore(org.junit.Ignore)

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