use of org.eclipse.reddeer.eclipse.ui.markers.matcher.MarkerDescriptionMatcher 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.ui.markers.matcher.MarkerDescriptionMatcher 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);
}
Aggregations