Search in sources :

Example 6 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardGitTest method testNoRepoRemote.

@Test
public void testNoRepoRemote() {
    createRepo();
    service.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard importWizard = new ImportApplicationWizard();
    assertProjectExistsErrorInWizard(importWizard);
    GitCloningWizardPage gitCloningWizardPage = new GitCloningWizardPage();
    gitCloningWizardPage.useExistingRepository(true);
    assertGitRemoteErrorInWizzard(importWizard);
    importWizard.cancel();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) GitCloningWizardPage(org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 7 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ServerSettingsWizardPage method importProject.

public ImportApplicationWizard importProject() {
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    new PushButton("Import...").click();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    return new ImportApplicationWizard();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 8 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ServerAdapterFromResourceTest method importProject.

@BeforeClass
public static void importProject() {
    explorer = new OpenShiftExplorerView();
    explorer.open();
    project = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(DatastoreOS3.TEST_PROJECT);
    project.getServicesWithName(OpenShiftResources.NODEJS_SERVICE).get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard appWizard = new ImportApplicationWizard();
    try {
        CheckBox checkBox = new CheckBox("Do not clone - use existing repository");
        if (checkBox.isEnabled()) {
            checkBox.toggle(true);
            LOGGER.debug("Using existing project, skipping import");
        }
    } catch (RedDeerException ex) {
        LOGGER.debug("No existing project found, importing");
    }
    try {
        appWizard.finish();
    } catch (WaitTimeoutExpiredException ex) {
        // When running test in suite, it needs to be selected correct build config(in OpenShift instance could be more build configs)
        appWizard.selectExistingBuildConfiguration(OpenShiftResources.NODEJS_APP_DEPLOYMENT_CONFIG);
        appWizard.finish();
    }
    new WaitUntil(new OpenShiftResourceExists(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, ResourceState.UNSPECIFIED, DatastoreOS3.TEST_PROJECT, connectionReq.getConnection()), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) BeforeClass(org.junit.BeforeClass)

Example 9 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardGitTest method testNotMatchingRepoRemote.

@Test
public void testNotMatchingRepoRemote() {
    Git repo = createRepo();
    setRemote(repo);
    service.select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION));
    ImportApplicationWizard importWizard = new ImportApplicationWizard();
    assertProjectExistsErrorInWizard(importWizard);
    GitCloningWizardPage gitCloningWizardPage = new GitCloningWizardPage();
    gitCloningWizardPage.useExistingRepository(true);
    assertGitRemoteErrorInWizzard(importWizard);
    importWizard.cancel();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) Git(org.eclipse.jgit.api.Git) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) GitCloningWizardPage(org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) Test(org.junit.Test)

Example 10 with ImportApplicationWizard

use of org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizardTest method testImportOpenShift3AppViaOpenshiftViewTwice.

@Test
public void testImportOpenShift3AppViaOpenshiftViewTwice() {
    testImportOpenShift3AppViaOpenshiftView();
    ImportApplicationWizard importWizard = OpenShiftUtils.openImportApplicationWizardFromOpenshiftView(project);
    GitCloningWizardPage gitWizardPage = new GitCloningWizardPage();
    assertTrue("There should be an error in the wizard (There already is a project with specified name)", gitWizardPage.projectExists());
    gitWizardPage.useExistingRepository(true);
    importWizard.finishAndOverrideExisting();
    assertProjectExistsInProjectView(OpenShiftResources.NODEJS_GIT_NAME);
}
Also used : GitCloningWizardPage(org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage) ImportApplicationWizard(org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard) Test(org.junit.Test)

Aggregations

ImportApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard)11 Test (org.junit.Test)8 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)7 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)7 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)6 GitCloningWizardPage (org.jboss.tools.openshift.reddeer.wizard.importapp.GitCloningWizardPage)4 Git (org.eclipse.jgit.api.Git)2 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)2 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 TreeItemRegexMatcher (org.eclipse.reddeer.core.matcher.TreeItemRegexMatcher)1 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)1 DefaultGroup (org.eclipse.reddeer.swt.impl.group.DefaultGroup)1 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)1 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)1 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)1 ServerSettingsWizard (org.jboss.tools.openshift.reddeer.wizard.server.ServerSettingsWizard)1 ServerSettingsWizardPage (org.jboss.tools.openshift.reddeer.wizard.server.ServerSettingsWizardPage)1 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)1