Search in sources :

Example 6 with EditConfigurationShell

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

the class HQLEditorCodeAssistTest method testHQLEditor.

@Test
public void testHQLEditor() {
    prepare();
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    v.selectConsole(prj);
    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 ");
    hqlEditor.setCursorPosition("from ".length());
    String proposal = "Actor - org.gen";
    ContentAssistant ca = hqlEditor.openContentAssistant();
    List<String> proposals = ca.getProposals();
    ca.close();
    assertTrue(proposal + " is expected", proposals.contains(proposal));
    hqlEditor.setText("from Actor a where a.");
    hqlEditor.setCursorPosition("from Actor a where a.".length());
    proposal = "actorId - Actor";
    ca = hqlEditor.openContentAssistant();
    proposals = ca.getProposals();
    ca.close();
    assertTrue(proposal + " is expected", proposals.contains(proposal));
}
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) ContentAssistant(org.eclipse.reddeer.jface.text.contentassist.ContentAssistant) Test(org.junit.Test)

Example 7 with EditConfigurationShell

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

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

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