use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart 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.eclipse.jdt.ui.packageview.PackageExplorerPart in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationFileTest method checkFile.
private void checkFile(boolean generateConsole) {
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.getProject(prjName).getProjectItem("src", HIBERNATE_CFG_FILE).open();
new DefaultEditor(HIBERNATE_CFG_FILE);
if (generateConsole) {
KnownConfigurationsView v = new KnownConfigurationsView();
v.selectConsole(prjName);
}
}
use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart in project jbosstools-hibernate by jbosstools.
the class EntityValidationTest method userIdentifierGeneratorValidationTest.
// known issue JBIDE-19526
@Test(expected = HibernateTestException.class)
public void userIdentifierGeneratorValidationTest() {
ProblemsView pv = new ProblemsView();
pv.open();
List<Problem> problems = pv.getProblems(ProblemType.ERROR);
assertTrue(problems.isEmpty());
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.getProject(PROJECT_NAME).getProjectItem("src/main/java", "org.hibernate.ui.test.model", "UserIdGenerator.java").delete();
try {
ScreenshotCapturer.getInstance().captureScreenshot("entity_validation");
} catch (CaptureScreenshotException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
pv.activate();
String expectedProblem = "Strategy class \"org.hibernate.ui.test.model.UserIdGenerator\" could not be found.";
new WaitUntil(new ProblemExists(ProblemType.ERROR, new MarkerDescriptionMatcher(expectedProblem)), TimePeriod.DEFAULT, false);
problems = pv.getProblems(ProblemType.ERROR, new MarkerDescriptionMatcher(expectedProblem));
if (problems.size() != 1) {
throw new HibernateTestException();
}
}
use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart in project jbosstools-hibernate by jbosstools.
the class EntityValidationTest method embeddedEntityValidationTest.
@Test
public void embeddedEntityValidationTest() {
ProblemsView pv = new ProblemsView();
pv.open();
List<Problem> problems = pv.getProblems(ProblemType.ERROR);
assertTrue(problems.isEmpty());
PackageExplorerPart pe = new PackageExplorerPart();
pe.open();
pe.getProject(PROJECT_NAME).getProjectItem("src/main/java", "org.hibernate.ui.test.model", "Address.java").delete();
pv.activate();
String expectedProblem = "org.hibernate.ui.test.model.Address is not mapped as an embeddable";
new WaitUntil(new ProblemExists(ProblemType.ERROR, new MarkerDescriptionMatcher(expectedProblem)));
problems = pv.getProblems(ProblemType.ERROR, new MarkerDescriptionMatcher(expectedProblem));
assertTrue(expectedProblem + " error is expected", problems.size() == 2);
}
use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart 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);
}
Aggregations