use of org.eclipse.reddeer.workbench.impl.editor.TextEditor in project jbosstools-hibernate by jbosstools.
the class JpaAnnotationGenerationTest method postCheck.
private void postCheck(String clazz) {
HibernateJPAWizard jpaWizard = new HibernateJPAWizard();
jpaWizard.next();
jpaWizard.finish();
ProjectUtils.getItem(prj, PCKG, clazz + ".java").open();
TextEditor editor = new TextEditor(clazz + ".java");
assertTrue(editor.getText().contains("@Entity"));
ProblemsView pw = new ProblemsView();
pw.open();
assertEquals(0, pw.getProblems(ProblemType.ERROR).size());
assertEquals(0, pw.getProblems(ProblemType.WARNING).size());
}
use of org.eclipse.reddeer.workbench.impl.editor.TextEditor 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.workbench.impl.editor.TextEditor in project jbosstools-hibernate by jbosstools.
the class AntFileExportTest method testAntFilenameExport.
@Test
public void testAntFilenameExport() {
HibernatePerspective p = new HibernatePerspective();
p.open();
LaunchConfigurationsDialog launchDialog = new LaunchConfigurationsDialog();
launchDialog.open();
launchDialog.selectHibernateCodeGeneration(GEN_NAME);
launchDialog.selectConfiguration(PRJ);
launchDialog.apply();
launchDialog.close();
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.selectProjects(PRJ);
ExportAntCodeGenWizard w = new ExportAntCodeGenWizard();
w.open();
ExportAntCodeGenWizardPage page = new ExportAntCodeGenWizardPage(w);
page.setHibernateGenConfiguration(GEN_NAME);
page.setAntFileName(ANTFILE_NAME);
w.finish();
pe.open();
pe.getProject(PRJ).getProjectItem(ANTFILE_NAME).open();
assertTrue("Ant file cannot be ampty", new TextEditor(ANTFILE_NAME).getText().length() > 0);
}
use of org.eclipse.reddeer.workbench.impl.editor.TextEditor 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