Search in sources :

Example 1 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project linuxtools by eclipse.

the class ComposeTest method runDockerCompose.

private void runDockerCompose(String project, String projectFile) {
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    pe.getProject(project).getProjectItem(projectFile).select();
    @SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
    contextMenu.select();
    new OkButton().click();
    try {
        new DefaultShell("Docker Compose");
        new PushButton("Apply and Close").click();
        fail("Docker Compose has not been found! Is it installed and the path is correct?");
    } catch (CoreLayerException ex) {
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    new WaitWhile(new ConsoleHasNoChange());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 2 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method addConfiguration.

/**
 * Add configuration
 */
public EditConfigurationShell addConfiguration() {
    open();
    new ContextMenuItem("Add Configuration...").select();
    return new EditConfigurationShell();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)

Example 3 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method openConsoleConfiguration.

/**
 * Open console configuration
 * @param name given console name
 * @return shell of the console
 */
public EditConfigurationShell openConsoleConfiguration(String name) {
    selectConsole(name);
    String title = "Edit Configuration";
    new ContextMenuItem(title).select();
    return new EditConfigurationShell();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)

Example 4 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class ConnectionProfileFactory method createConnectionProfile.

/**
 * Creates Connection profile based on DatabaseRequirement configuration
 * @param conf given database requirement configuration
 */
public static void createConnectionProfile(DatabaseConfiguration cfg) {
    DataSourceExplorerView dse = new DataSourceExplorerView();
    dse.open();
    // TODO implement this in explorer
    // TODO fix explorer name
    DefaultTreeItem item = new DefaultTreeItem("Database Connections");
    item.expand(TimePeriod.DEFAULT);
    List<TreeItem> items = item.getItems();
    for (TreeItem i : items) {
        i.select();
        new ContextMenuItem("Delete").select();
        Shell delete = new DefaultShell("Delete confirmation");
        new YesButton(delete).click();
        new WaitWhile(new ShellIsAvailable(delete));
    }
    DatabaseProfile dbProfile = new DatabaseProfile();
    dbProfile.setDatabase(cfg.getProfileName());
    dbProfile.setDriverDefinition(DriverDefinitionFactory.getDriverDefinition(cfg));
    dbProfile.setHostname(cfg.getJdbcString());
    dbProfile.setName(cfg.getProfileName());
    dbProfile.setPassword(cfg.getPassword());
    dbProfile.setUsername(cfg.getUsername());
    dbProfile.setVendor(cfg.getDriverVendor());
    // Driver Definition creation
    NewCPWizard cpw = new NewCPWizard();
    cpw.open();
    cpw.createDatabaseProfile(dbProfile);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) DatabaseProfile(org.eclipse.reddeer.eclipse.datatools.ui.DatabaseProfile) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DataSourceExplorerView(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) NewCPWizard(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.wizards.NewCPWizard) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 5 with ContextMenuItem

use of org.eclipse.reddeer.swt.impl.menu.ContextMenuItem in project jbosstools-hibernate by jbosstools.

the class ConnectionProfileFactory method deleteConnectionProfile.

/**
 * Deletes connection profile
 * @param profileName profile name to delete
 */
@SuppressWarnings("unchecked")
public static void deleteConnectionProfile(String profileName) {
    DataSourceExplorerView explorer = new DataSourceExplorerView();
    explorer.open();
    new DefaultTreeItem(new TreeItemRegexMatcher("Database Connections"), new TreeItemRegexMatcher(profileName + ".*")).select();
    new ContextMenuItem("Delete").select();
    Shell delete = new DefaultShell("Delete confirmation");
    new YesButton(delete).click();
    new WaitWhile(new ShellIsAvailable(delete));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) TreeItemRegexMatcher(org.eclipse.reddeer.core.matcher.TreeItemRegexMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DataSourceExplorerView(org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Aggregations

ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)73 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)36 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)36 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)33 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)29 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)29 Test (org.junit.Test)26 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)19 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)17 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)15 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)11 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)11 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)9 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)8 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)7 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)7 ImportApplicationWizard (org.jboss.tools.openshift.reddeer.wizard.importapp.ImportApplicationWizard)6 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)5 EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)5