Search in sources :

Example 6 with KnownConfigurationsView

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

the class HQLEditorTest method testHQLEditor.

@Test
public void testHQLEditor() {
    prepare();
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    EditConfigurationShell confShell = v.openConsoleConfiguration(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();
    v.open();
    v.selectConsole(prj);
    new ContextMenuItem("HQL Editor").select();
    HQLEditor hqlEditor = new HQLEditor(prj);
    hqlEditor.setText("from Actor");
    hqlEditor.save();
    hqlEditor.runHQLQuery();
    QueryPageTabView result = new QueryPageTabView();
    result.open();
    assertTrue("Query result items expected", result.getResultItems().size() > 10);
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) EditConfigurationMainPage(org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage) HQLEditor(org.jboss.tools.hibernate.reddeer.hqleditor.HQLEditor) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) QueryPageTabView(org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView) Test(org.junit.Test)

Example 7 with KnownConfigurationsView

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

the class HibernateUIPartsTest method testHibernateViews.

/**
 * Tests Hibernate perspective
 * Tests Hibernate views
 * - Hibernate Configurations
 * - Hibernate Dynamic SQL Preview
 * - Hibernate Query Result
 * - Query Parameters
 */
@Test
public void testHibernateViews() {
    checkView(new KnownConfigurationsView());
    checkView(new DynamicSQLPreviewView());
    checkView(new QueryPageTabView());
    checkView(new QueryParametersView());
}
Also used : DynamicSQLPreviewView(org.jboss.tools.hibernate.reddeer.console.views.DynamicSQLPreviewView) QueryParametersView(org.jboss.tools.hibernate.reddeer.console.views.QueryParametersView) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) QueryPageTabView(org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView) Test(org.junit.Test)

Example 8 with KnownConfigurationsView

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

the class MappingDiagramTest method prepareMavenProject.

public void prepareMavenProject() {
    importMavenProject(prj);
    DatabaseConfiguration cfg = dbRequirement.getConfiguration();
    DriverDefinitionFactory.createDatabaseDriverDefinition(cfg);
    ConnectionProfileFactory.createConnectionProfile(cfg);
    ProjectConfigurationFactory.setProjectFacetForDB(prj, cfg, jpaVersion);
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    EditConfigurationShell confShell = v.openConsoleConfiguration(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) 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 9 with KnownConfigurationsView

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

the class HibernateRedDeerTest method deleteHibernateConfigurations.

private static void deleteHibernateConfigurations() {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    while (v.getConsoleConfigurations() != null && !v.getConsoleConfigurations().isEmpty()) {
        TreeItem i = v.getConsoleConfigurations().get(0);
        i.select();
        ContextMenuItem closeConfig = new ContextMenuItem("Close Configuration");
        if (closeConfig.isEnabled()) {
            closeConfig.select();
            new WaitWhile(new JobIsRunning());
        }
        v.deleteConsoleConfiguration(i.getText());
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 10 with KnownConfigurationsView

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

the class MappingDiagramTest method openMappingDiagram.

private void openMappingDiagram() {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    v.selectConsole(prj);
    ContextMenuItem mappingMenu = new ContextMenuItem("Mapping Diagram");
    mappingMenu.select();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)

Aggregations

KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)14 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)7 EditConfigurationMainPage (org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage)6 EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)6 DatabaseConfiguration (org.eclipse.reddeer.requirements.db.DatabaseConfiguration)3 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)3 QueryPageTabView (org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView)3 Test (org.junit.Test)3 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)2 ContentAssistant (org.eclipse.reddeer.jface.text.contentassist.ContentAssistant)2 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)2 CriteriaEditor (org.jboss.tools.hibernate.reddeer.criteriaeditor.CriteriaEditor)2 HQLEditor (org.jboss.tools.hibernate.reddeer.hqleditor.HQLEditor)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)1 DefaultEditor (org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)1 DynamicSQLPreviewView (org.jboss.tools.hibernate.reddeer.console.views.DynamicSQLPreviewView)1 QueryParametersView (org.jboss.tools.hibernate.reddeer.console.views.QueryParametersView)1