use of org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage 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.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage in project jbosstools-hibernate by jbosstools.
the class ProjectConfigurationFactory method setProjectFacetForDB.
/**
* Sets JPA project facets for given database configuration
* @param prj given project
* @param cfg given database configuration
* @param jpaVersion JPA version (2.0 or 2.1 is supported)
*/
public static void setProjectFacetForDB(String prj, DatabaseConfiguration cfg, String jpaVersion) {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
PropertyDialog pd = pe.getProject(prj).openProperties();
boolean javaFacet = false;
FacetsPropertyPage pp = new FacetsPropertyPage(pd);
pd.select(pp);
for (TreeItem t : getFacets(pd.getShell())) {
if (t.getText().equals("Java")) {
javaFacet = true;
break;
}
}
if (!javaFacet) {
pp.selectFacet("Java");
DefaultHyperlink hyperlink = new DefaultHyperlink();
hyperlink.activate();
Shell s = new DefaultShell("Modify Faceted Project");
new OkButton().click();
new WaitWhile(new ShellIsAvailable(s));
}
pp.selectFacet("JPA");
pp.selectVersion("JPA", jpaVersion);
addFurtherJPAConfiguration(jpaVersion, !javaFacet);
closePreferences(pd);
new WorkbenchShell().setFocus();
pe.open();
pe.selectProjects(prj);
pd.open();
// TODO Why this takes so long ?
pd.select("JPA");
JpaFacetInstallPage jpaPage = new JpaFacetInstallPage(pd);
jpaPage.setConnectionProfile(cfg.getProfileName());
jpaPage.setAutoDiscovery(true);
closePreferences(pd);
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
checkPersistenceXML(prj);
}
use of org.jboss.tools.hibernate.reddeer.wizard.JpaFacetInstallPage in project jbosstools-hibernate by jbosstools.
the class PersistenceXMLFileTest method prepare.
private void prepare() {
importProject(prj, null);
ProjectExplorer pe = new ProjectExplorer();
pe.open();
PropertyDialog pd = pe.getProject(prj).openProperties();
FacetsPropertyPage fp = new FacetsPropertyPage(pd);
pd.select(fp);
List<TreeItem> facets = fp.getSelectedFacets();
boolean javaFacet = false;
boolean jpaFacet = false;
for (TreeItem facet : facets) {
if (facet.getText().equals("Java")) {
javaFacet = true;
} else if (facet.getText().equals("JPA")) {
jpaFacet = true;
}
}
if (!javaFacet) {
fp.selectFacet("Java");
new DefaultHyperlink(pd).activate();
Shell s = new DefaultShell("Modify Faceted Project");
new OkButton(s).click();
new WaitWhile(new ShellIsAvailable(s));
}
if (!jpaFacet) {
fp.selectFacet("JPA");
new DefaultHyperlink(pd).activate();
Shell s = new DefaultShell("Modify Faceted Project");
new NextButton(s).click();
JpaFacetInstallPage installPage = new JpaFacetInstallPage(s);
installPage.setPlatform("Hibernate (JPA 2.1)");
installPage.setJpaImplementation("Disable Library Configuration");
new OkButton(s).click();
new WaitWhile(new ShellIsAvailable(s));
}
pd.ok();
}
Aggregations