use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.
the class JPAEntityGenerationTest method testEntityGeneration.
private void testEntityGeneration(boolean useHibernateConsole) {
prepare();
DatabaseConfiguration cfg = dbRequirement.getConfiguration();
EntityGenerationFactory.generateJPAEntities(cfg, prj, "org.gen", hbVersion, useHibernateConsole);
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
try {
new WaitUntil(new EntityIsGenerated(prj, "src/main/java", "org.gen", "Actor.java"));
pe.getProject(prj).getProjectItem("src/main/java", "org.gen", "Actor.java").open();
} catch (RedDeerException e) {
e.printStackTrace();
fail("Entities not generated, possible cause https://issues.jboss.org/browse/JBIDE-19175");
}
new DefaultEditor("Actor.java");
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.
the class CodeGenerationKeyWordsTest method checkGeneratedEntities.
private void checkGeneratedEntities(String src) {
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
try {
new WaitUntil(new EntityIsGenerated(prj, src, "org.gen", "Actor.java"));
pe.getProject(prj).getProjectItem(src, "org.gen", "Actor.java").open();
} catch (RedDeerException e) {
fail("Entities not generated, possible cause https://issues.jboss.org/browse/JBIDE-19217");
}
TextEditor actorEditor = new TextEditor("Actor.java");
assertTrue(actorEditor.getText().contains("implements_"));
for (Marker m : actorEditor.getMarkers()) {
if (m.getType().equals("org.eclipse.jdt.ui.error")) {
fail("Actor has error markers");
}
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.
the class CriteriaEditor method runCriteria.
/**
* Executes criteria
*/
public void runCriteria() {
new DefaultToolItem("Run criteria").click();
try {
Shell s = new DefaultShell("Open Session factory");
new YesButton(s).click();
new WaitWhile(new ShellIsAvailable(s));
} catch (RedDeerException e) {
log.warn("Open Session factory question dialog was expected");
} finally {
new WaitWhile(new JobIsRunning());
}
}
use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.
the class TablesFromJPAEntitiesGeneration method testDDLGeneration.
private void testDDLGeneration(boolean useConsole, String hbVersion, String pkg) {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.selectProjects(prj);
GenerateDdlWizard w = new GenerateDdlWizard();
w.open();
GenerateDdlWizardPage p = new GenerateDdlWizardPage(w);
p.setFileName(DDL_FILE);
p.setUseConsoleConfiguration(useConsole);
if (useConsole) {
assertTrue(p.isConsoleConfigurationEnabled());
assertFalse(p.isHibernateVersionEnabled());
p.setConsoleConfiguration(prj);
}
if (!useConsole) {
assertFalse(p.isConsoleConfigurationEnabled());
assertTrue(p.isHibernateVersionEnabled());
p.setHibernateVersion(hbVersion);
}
w.finish();
pe.open();
try {
ProjectUtils.getPackage(prj, DDL_FILE).open();
} catch (RedDeerException e) {
Assert.fail("DDL is not generated - known issues(s): JBIDE-19431,JBIDE-19535");
}
String ddlText = new TextEditor(DDL_FILE).getText();
assertTrue("DDL file cannot be empty", ddlText.length() > 0);
checkDDLContent(ddlText);
}
Aggregations