use of org.eclipse.reddeer.workbench.impl.editor.DefaultEditor in project jbosstools-hibernate by jbosstools.
the class HibernateToolsFactory method createConfigurationFile.
/**
* Create Hibernate Configuration file
* @param cfg configuration
* @param project project name
* @param cfgFile hibernate configuration file
* @param generateConsole when true hibernate console configuration is generated
*/
public static void createConfigurationFile(DatabaseConfiguration cfg, String project, String cfgFile, boolean generateConsole) {
NewConfigurationWizard wizard = new NewConfigurationWizard();
wizard.open();
NewConfigurationFirstPage p1 = new NewConfigurationFirstPage(wizard);
p1.setLocation(project, "src");
wizard.next();
NewConfigurationWizardPage p2 = new NewConfigurationWizardPage(wizard);
p2.setDatabaseDialect("H2");
p2.setDriverClass(cfg.getDriverClass());
p2.setConnectionURL(cfg.getJdbcString());
p2.setUsername(cfg.getUsername());
if (generateConsole) {
p2.setCreateConsoleConfiguration(generateConsole);
}
wizard.finish();
new DefaultEditor(cfgFile);
}
use of org.eclipse.reddeer.workbench.impl.editor.DefaultEditor in project jbosstools-hibernate by jbosstools.
the class CodeGenerationConfigurationTest 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");
}
new DefaultEditor("Actor.java");
}
use of org.eclipse.reddeer.workbench.impl.editor.DefaultEditor in project jbosstools-hibernate by jbosstools.
the class CodeGenerationConfigurationTest method createRevengFile.
private void createRevengFile() {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
pe.selectProjects(prj);
NewReverseEngineeringFileWizard wizard = new NewReverseEngineeringFileWizard();
wizard.open();
wizard.next();
TableFilterWizardPage page = new TableFilterWizardPage(wizard);
page.setConsoleConfiguration(prj);
page.refreshDatabaseSchema();
page.pressInclude();
wizard.finish();
EditorHandler.getInstance().closeAll(false);
pe.open();
pe.getProject(prj).getProjectItem("hibernate.reveng.xml").open();
new DefaultEditor("Hibernate Reverse Engineering Editor").activate();
ReverseEngineeringEditor re = new ReverseEngineeringEditor();
re.activateDesignTab();
re.activateOverviewTab();
re.activateTableFiltersTab();
re.activateTypeMappingsTab();
re.activateTableAndColumnsTab();
try {
re.selectAllTables("SAKILA.PUBLIC");
} catch (WaitTimeoutExpiredException e) {
fail("Cannot add tables - known issue(s) - JBIDE-19443");
}
re.activateSourceTab();
re.save();
}
use of org.eclipse.reddeer.workbench.impl.editor.DefaultEditor in project jbosstools-hibernate by jbosstools.
the class MappingDiagramTest method checkMappingDiagram.
private void checkMappingDiagram() {
AutoBuilding ab = new AutoBuilding() {
@Override
public Class<? extends Annotation> annotationType() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean value() {
return false;
}
@Override
public boolean cleanup() {
// TODO Auto-generated method stub
return true;
}
};
AutoBuildingRequirement abr = new AutoBuildingRequirement();
abr.setDeclaration(ab);
openMappingDiagram();
try {
new DefaultEditor(prj + ": Actor and 15 others");
} catch (RedDeerException e) {
// workaroud due to buggy auto building
abr.fulfill();
PackageExplorerPart pe = new PackageExplorerPart();
pe.getProject(prj).select();
new ShellMenuItem("Project", "Build Project").select();
new WaitWhile(new JobIsRunning());
openMappingDiagram();
new DefaultEditor(prj + ": Actor and 15 others");
} finally {
abr.cleanUp();
}
}
use of org.eclipse.reddeer.workbench.impl.editor.DefaultEditor in project jbosstools-hibernate by jbosstools.
the class JBossDatasourceTest method jbossDatasourceTest.
@Test
public void jbossDatasourceTest() {
DatabaseConfiguration cfg = dbRequirement.getConfiguration();
NewDSXMLWizard wizard = new NewDSXMLWizard();
wizard.open();
WizardNewDSXMLFileCreationPage page = new WizardNewDSXMLFileCreationPage(wizard);
page.setConnectionProfile(cfg.getProfileName());
page.setParentFolder("/" + PRJ + "/src/main/resources");
wizard.finish();
String dsFileName = cfg.getProfileName() + "-ds.xml";
assertFalse(new DefaultEditor(dsFileName).isDirty());
ProjectExplorer pe = new ProjectExplorer();
pe.open();
assertTrue(pe.getProject(PRJ).containsResource("src", "main", "resources", dsFileName));
}
Aggregations