Search in sources :

Example 1 with GenerateDdlWizard

use of org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateDdlWizard in project jbosstools-hibernate by jbosstools.

the class TablesFromJPAEntitiesGeneration method testDDLGeneration.

private void testDDLGeneration(boolean useConsole, String hbVersion, String pkg) {
    ProjectExplorer pe = new ProjectExplorer();
    pe.open();
    pe.selectProjects(prj);
    GenerateDdlWizard w = new GenerateDdlWizard();
    w.open();
    GenerateDdlWizardPage p = new GenerateDdlWizardPage(w);
    p.setFileName(DDL_FILE);
    p.setUseConsoleConfiguration(useConsole);
    if (useConsole) {
        assertTrue(p.isConsoleConfigurationEnabled());
        assertFalse(p.isHibernateVersionEnabled());
        p.setConsoleConfiguration(prj);
    }
    if (!useConsole) {
        assertFalse(p.isConsoleConfigurationEnabled());
        assertTrue(p.isHibernateVersionEnabled());
        p.setHibernateVersion(hbVersion);
    }
    w.finish();
    pe.open();
    try {
        ProjectUtils.getPackage(prj, DDL_FILE).open();
    } catch (RedDeerException e) {
        Assert.fail("DDL is not generated - known issues(s): JBIDE-19431,JBIDE-19535");
    }
    String ddlText = new TextEditor(DDL_FILE).getText();
    assertTrue("DDL file cannot be empty", ddlText.length() > 0);
    checkDDLContent(ddlText);
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) GenerateDdlWizardPage(org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateDdlWizardPage) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) GenerateDdlWizard(org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateDdlWizard)

Aggregations

RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)1 ProjectExplorer (org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer)1 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)1 GenerateDdlWizard (org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateDdlWizard)1 GenerateDdlWizardPage (org.jboss.tools.hibernate.reddeer.jpt.ui.wizard.GenerateDdlWizardPage)1