Package org.eclipse.egit.ui.common

Examples of org.eclipse.egit.ui.common.ExistingOrNewPage


  }

  @Test
  public void shareProjectAndCreateRepo() throws Exception {
    createProject(projectName0);
    ExistingOrNewPage existingOrNewPage = sharingWizard
        .openWizard(projectName0);
    existingOrNewPage.setInternalMode(true);

    // initial state
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    String projectPath = workspace.getRoot().getProject(projectName0)
        .getLocation().toOSString();

    existingOrNewPage.assertContents(false, projectName0, projectPath, "", "");
    existingOrNewPage.assertEnabling(false, false, false);

    // select project
    bot.tree().getTreeItem(projectName0).select();
    existingOrNewPage.assertContents(false, projectName0, projectPath, "",
        projectPath);
    existingOrNewPage.assertEnabling(true, true, false);

    // create repository
    bot.button("Create Repository").click();

    String repopath = workspace.getRoot().getProject(projectName0)
        .getLocation().append(Constants.DOT_GIT).toOSString();
    existingOrNewPage.assertContents(true, projectName0, projectPath,
        ".git", "");
    existingOrNewPage.assertEnabling(false, false, true);

    assertTrue((new File(repopath)).exists());

    // share project
    bot.button("Finish").click();
View Full Code Here


    Git git = new Git(repo3);
    git.add().addFilepattern(".").call();
    git.commit().setAuthor("A U Thior", "au.thor@example.com").setMessage("Created Project 3").call();
    repo3.close();

    ExistingOrNewPage existingOrNewPage = sharingWizard.openWizard(
        projectName1, projectName2, projectName3);
    existingOrNewPage.setInternalMode(true);

    // initial state
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    String projectPath1 = workspace.getRoot().getProject(projectName1)
        .getLocation().toOSString();
    String projectPath2 = workspace.getRoot().getProject(projectName2)
        .getLocation().toOSString();
    String projectPath3 = workspace.getRoot().getProject(projectName3)
        .getLocation().toOSString();
    existingOrNewPage.assertContents(
        new Row[] {
            new Row(true, projectName1, projectPath1, ".."
                + File.separator + ".git"),
            new Row(false, projectName2, projectPath2, "", new Row[] {
                new Row(false, ".", "", ".git"),
                new Row(false, "..", "", ".." + File.separator
                    + ".git")}),
            new Row(false, projectName3, projectPath3, "", new Row[] {
                new Row(true, ".", "", ".git"),
                new Row(false, "..", "", ".." + File.separator
                    + ".git")
            })}, "");

    bot.tree().getAllItems()[1].getItems()[0].check();
    existingOrNewPage.assertEnabling(false, false, true);
    bot.button("Finish").click();
    Thread.sleep(1000);
    assertEquals(repo1.getDirectory().getCanonicalPath(), RepositoryMapping
        .getMapping(workspace.getRoot().getProject(projectName1))
        .getRepository().getDirectory().toString());
View Full Code Here

    createProject(projectName0);
    String location1 = createProject(projectName1);
    String location2 = createProject(projectName2);
    createProject(projectName3);

    ExistingOrNewPage existingOrNewPage = sharingWizard.openWizard(
        projectName1, projectName2);
    SWTBotShell createRepoDialog = existingOrNewPage
        .clickCreateRepository();
    String repoDir = Activator.getDefault().getPreferenceStore()
        .getString(UIPreferences.DEFAULT_REPO_DIR);
    File repoFolder = new File(repoDir, repoName);
    createRepoDialog.bot()
        .textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(repoFolder.getAbsolutePath());
    createRepoDialog.bot().button(IDialogConstants.FINISH_LABEL).click();

    SWTBotCombo combo = bot
        .comboBoxWithLabel(UIText.ExistingOrNewPage_ExistingRepositoryLabel);
    assertTrue(combo.getText().startsWith(repoName));
    Repository targetRepo = lookupRepository(new File(repoFolder,
        Constants.DOT_GIT));

    assertTrue(combo.getText()
        .endsWith(targetRepo.getDirectory().getPath()));
    assertEquals(
        targetRepo.getWorkTree().getPath(),
        bot.textWithLabel(
            UIText.ExistingOrNewPage_WorkingDirectoryLabel)
            .getText());
    String[][] contents = new String[2][3];
    contents[0][0] = projectName1;
    contents[0][1] = new Path(location1).toString();
    contents[0][2] = new Path(targetRepo.getWorkTree().getPath()).append(
        projectName1).toString();

    contents[1][0] = projectName2;
    contents[1][1] = new Path(location2).toString();
    contents[1][2] = new Path(targetRepo.getWorkTree().getPath()).append(
        projectName2).toString();
    existingOrNewPage.assertTableContents(contents);

    existingOrNewPage.setRelativePath("a/b");

    contents[0][2] = new Path(targetRepo.getWorkTree().getPath())
        .append("a/b").append(projectName1).toString();
    contents[1][2] = new Path(targetRepo.getWorkTree().getPath())
        .append("a/b").append(projectName2).toString();
    existingOrNewPage.assertTableContents(contents);

    bot.button(IDialogConstants.FINISH_LABEL).click();
    Thread.sleep(1000);
    String location1Path = ResourcesPlugin.getWorkspace().getRoot()
        .getProject(projectName1).getLocation().toString();
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.common.ExistingOrNewPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.