Search in sources :

Example 1 with PushResultDialogTester

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

the class PushTest method testPush.

@Test
public void testPush() throws Exception {
    // change file
    TestUtil.appendFileContent(file, "additional content", true);
    // commit change
    try (Git git = new Git(localRepository)) {
        git.add().addFilepattern(SampleTestRepository.A_txt_name).call();
        git.commit().setMessage("Change").call();
    }
    configurePush();
    // push change
    PushWizardTester wizardTester = new PushWizardTester();
    RepoPropertiesPage repoPropertiesPage = wizardTester.openPushWizard(localRepository);
    repoPropertiesPage.setPushDestination("push");
    wizardTester.nextPage();
    // now login dialog appears
    LoginDialogTester loginDialogTester = new LoginDialogTester();
    loginDialogTester.login("agitter", "letmein");
    RefSpecPageTester refSpecPageTester = new RefSpecPageTester();
    refSpecPageTester.waitUntilPageIsReady(1);
    wizardTester.finish();
    loginDialogTester.login("agitter", "letmein");
    PushResultDialogTester pushResultDialogTester = new PushResultDialogTester();
    bot.waitUntil(shellIsActive("Push Results: push"));
    String expectedMessage = "Repository " + remoteRepository.getUri();
    pushResultDialogTester.assertResultMessage(expectedMessage);
    pushResultDialogTester.closeDialog();
}
Also used : PushWizardTester(org.eclipse.egit.ui.common.PushWizardTester) Git(org.eclipse.jgit.api.Git) PushResultDialogTester(org.eclipse.egit.ui.common.PushResultDialogTester) RepoPropertiesPage(org.eclipse.egit.ui.common.RepoPropertiesPage) LoginDialogTester(org.eclipse.egit.ui.common.LoginDialogTester) RefSpecPageTester(org.eclipse.egit.ui.common.RefSpecPageTester) Test(org.junit.Test)

Aggregations

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 RepoPropertiesPage (org.eclipse.egit.ui.common.RepoPropertiesPage)1 Git (org.eclipse.jgit.api.Git)1 Test (org.junit.Test)1