use of org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView in project jbosstools-hibernate by jbosstools.
the class JPAProjectFactory method createProject.
/**
* Creates JPA Project
* @param prj projec name
* @param version JPA version
* @param platform JPA platform
*/
public static void createProject(String prj, String version, String platform) {
log.step("Open JPA Project Wizard");
JPAProjectWizard wizard = new JPAProjectWizard();
wizard.open();
JPAProjectWizardFirstPage firstPage = new JPAProjectWizardFirstPage(wizard);
firstPage.setProjectName(prj);
firstPage.setJPAVersion(version);
wizard.next();
wizard.next();
log.step("Disable hibernate configuration");
JpaFacetInstallPage facetPage = new JpaFacetInstallPage(wizard);
facetPage.setPlatform(platform);
facetPage.setJpaImplementation("Disable Library Configuration");
log.step("Click finish");
wizard.finish();
new WaitWhile(new JobIsRunning());
ProblemsView problemsView = new ProblemsView();
problemsView.open();
List<Problem> allErrors = problemsView.getProblems(ProblemType.ERROR);
problemsView.open();
assertTrue("No problems are expected (JBIDE-17855)", allErrors.size() == 0);
}
use of org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView in project jbosstools-hibernate by jbosstools.
the class ProjectImporter method importProjectWithoutErrors.
/**
* Import porject and requires no errors in problems log
* @param pluginId plug-in id of project where project resources are located
* @param projectName project name to import
*/
public static void importProjectWithoutErrors(String pluginId, String projectName, Map<String, String> libraryPathMap) {
importProject(pluginId, projectName);
if (libraryPathMap != null) {
Map<String, String> fullPathJars = new HashMap<>();
for (String jar : libraryPathMap.keySet()) {
if (libraryPathMap.get(jar) == null) {
fullPathJars.put(jar, LIB_DIR);
} else {
fullPathJars.put(jar, LIB_DIR + libraryPathMap.get(jar));
}
}
ProjectHelper.addLibrariesIntoProject(projectName, fullPathJars);
}
new WaitUntil(new JobIsRunning(), TimePeriod.SHORT, false);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
ProblemsView problemsView = new ProblemsView();
problemsView.open();
new WaitWhile(new JobIsRunning());
List<Problem> problems = problemsView.getProblems(ProblemType.ERROR);
for (Problem p : problems) {
log.error("Unexpected " + problems.size() + " problem(s):");
log.dump("Problem: " + p.toString());
}
assertTrue("No problems after import are expected", problems.size() == 0);
}
use of org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView 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.eclipse.ui.views.markers.ProblemsView 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.views.markers.ProblemsView 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