Search in sources :

Example 1 with EditConfigurationShell

use of org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell 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 2 with EditConfigurationShell

use of org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell 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 3 with EditConfigurationShell

use of org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell in project jbosstools-hibernate by jbosstools.

the class ConsoleConfigurationTest method prepareConsoleConfiguration.

public void prepareConsoleConfiguration(String hibernateVersion) {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    EditConfigurationShell s = v.addConfiguration();
    s.setName(CONSOLE_NAME);
    EditConfigurationMainPage p = s.getMainPage();
    p.setProject(prjName);
    p.setDatabaseConnection(PredefinedConnection.HIBERNATE_CONFIGURED_CONNECTION);
    p.setConfigurationFile("/" + prjName + "/" + HIBERNATE_CFG_FILE);
    p.setHibernateVersion(hibernateVersion);
    // ANY ERROR IN WIZARD ??
    s.ok();
    v.open();
    EditConfigurationShell s2 = v.openConsoleConfiguration(CONSOLE_NAME);
    s2.close();
    v.open();
    try {
        v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
    } catch (WaitTimeoutExpiredException e) {
        log.info("Wait timeout occured, try rebuilding console config");
        v.selectConsole(CONSOLE_NAME);
        new ContextMenuItem("Rebuild configuration").select();
        new WaitWhile(new JobIsRunning());
        v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) EditConfigurationMainPage(org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 4 with EditConfigurationShell

use of org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell in project jbosstools-hibernate by jbosstools.

the class CriteriaEditorCodeAssistTest method prepareMaven.

private void prepareMaven() {
    prepareMvn(prj, hbVersion);
    DatabaseConfiguration cfg = dbRequirement.getConfiguration();
    ProjectConfigurationFactory.setProjectFacetForDB(prj, cfg, jpaVersion);
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    List<TreeItem> confs = v.getConsoleConfigurations();
    if (confs != null) {
        for (TreeItem i : confs) {
            v.deleteConsoleConfiguration(i.getText());
        }
    }
    EditConfigurationShell confShell = v.addConfiguration();
    confShell.setName(prj);
    EditConfigurationMainPage mainPage = confShell.getMainPage();
    mainPage.setProject(prj);
    mainPage.setType("JPA (jdk 1.5+)");
    mainPage.setDatabaseConnection("[JPA Project Configured Connection]");
    mainPage.setHibernateVersion(hbVersion);
    confShell.ok();
}
Also used : DatabaseConfiguration(org.eclipse.reddeer.requirements.db.DatabaseConfiguration) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) EditConfigurationMainPage(org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)

Example 5 with EditConfigurationShell

use of org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell in project jbosstools-hibernate by jbosstools.

the class CriteriaEditorTest method prepareMaven.

private void prepareMaven() {
    prepareMvn(prj, hbVersion);
    DatabaseConfiguration cfg = dbRequirement.getConfiguration();
    ProjectConfigurationFactory.setProjectFacetForDB(prj, cfg, jpaVersion);
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    List<TreeItem> confs = v.getConsoleConfigurations();
    if (confs != null) {
        for (TreeItem i : confs) {
            v.deleteConsoleConfiguration(i.getText());
        }
    }
    EditConfigurationShell confShell = v.addConfiguration();
    confShell.setName(prj);
    EditConfigurationMainPage mainPage = confShell.getMainPage();
    mainPage.setProject(prj);
    mainPage.setType("JPA (jdk 1.5+)");
    mainPage.setDatabaseConnection("[JPA Project Configured Connection]");
    mainPage.setHibernateVersion(hbVersion);
    confShell.ok();
}
Also used : DatabaseConfiguration(org.eclipse.reddeer.requirements.db.DatabaseConfiguration) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) EditConfigurationMainPage(org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)

Aggregations

EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)8 EditConfigurationMainPage (org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage)6 KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)6 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)5 DatabaseConfiguration (org.eclipse.reddeer.requirements.db.DatabaseConfiguration)3 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)2 HQLEditor (org.jboss.tools.hibernate.reddeer.hqleditor.HQLEditor)2 Test (org.junit.Test)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 ContentAssistant (org.eclipse.reddeer.jface.text.contentassist.ContentAssistant)1 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)1 QueryPageTabView (org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView)1