use of org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationTest method clean.
@After
public void clean() {
KnownConfigurationsView v = new KnownConfigurationsView();
v.open();
v.deleteConsoleConfiguration(CONSOLE_NAME);
deleteAllProjects();
}
use of org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView 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");
}
}
use of org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView 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();
}
use of org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView 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();
}
use of org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView 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));
}
Aggregations