Search in sources :

Example 1 with QueryPageTabView

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

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

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

the class CriteriaEditorTest method checkCriteriaEditor.

private void checkCriteriaEditor() {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    v.selectConsole(prj);
    new ContextMenuItem("Hibernate Criteria Editor").select();
    CriteriaEditor criteriaEditor = new CriteriaEditor(prj);
    criteriaEditor.setText("session.createCriteria(Actor.class).list();");
    criteriaEditor.save();
    criteriaEditor.runCriteria();
    QueryPageTabView result = new QueryPageTabView();
    result.open();
    assertTrue("Query result items expected - known issue https://issues.jboss.org/browse/JBIDE-19743", result.getResultItems().size() > 10);
}
Also used : CriteriaEditor(org.jboss.tools.hibernate.reddeer.criteriaeditor.CriteriaEditor) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) QueryPageTabView(org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView)

Aggregations

KnownConfigurationsView (org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView)3 QueryPageTabView (org.jboss.tools.hibernate.reddeer.console.views.QueryPageTabView)3 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 Test (org.junit.Test)2 EditConfigurationMainPage (org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage)1 EditConfigurationShell (org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell)1 DynamicSQLPreviewView (org.jboss.tools.hibernate.reddeer.console.views.DynamicSQLPreviewView)1 QueryParametersView (org.jboss.tools.hibernate.reddeer.console.views.QueryParametersView)1 CriteriaEditor (org.jboss.tools.hibernate.reddeer.criteriaeditor.CriteriaEditor)1 HQLEditor (org.jboss.tools.hibernate.reddeer.hqleditor.HQLEditor)1