Search in sources :

Example 1 with EntityIsGenerated

use of org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated 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");
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) EntityIsGenerated(org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) DefaultEditor(org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)

Example 2 with EntityIsGenerated

use of org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated in project jbosstools-hibernate by jbosstools.

the class JPAEntityGenerationTest method testEntityGeneration.

private void testEntityGeneration(boolean useHibernateConsole) {
    prepare();
    DatabaseConfiguration cfg = dbRequirement.getConfiguration();
    EntityGenerationFactory.generateJPAEntities(cfg, prj, "org.gen", hbVersion, useHibernateConsole);
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    try {
        new WaitUntil(new EntityIsGenerated(prj, "src/main/java", "org.gen", "Actor.java"));
        pe.getProject(prj).getProjectItem("src/main/java", "org.gen", "Actor.java").open();
    } catch (RedDeerException e) {
        e.printStackTrace();
        fail("Entities not generated, possible cause https://issues.jboss.org/browse/JBIDE-19175");
    }
    new DefaultEditor("Actor.java");
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) EntityIsGenerated(org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated) DatabaseConfiguration(org.eclipse.reddeer.requirements.db.DatabaseConfiguration) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) DefaultEditor(org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)

Example 3 with EntityIsGenerated

use of org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated in project jbosstools-hibernate by jbosstools.

the class CodeGenerationKeyWordsTest 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");
    }
    TextEditor actorEditor = new TextEditor("Actor.java");
    assertTrue(actorEditor.getText().contains("implements_"));
    for (Marker m : actorEditor.getMarkers()) {
        if (m.getType().equals("org.eclipse.jdt.ui.error")) {
            fail("Actor has error markers");
        }
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) EntityIsGenerated(org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) Marker(org.eclipse.reddeer.workbench.impl.editor.Marker) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)3 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)3 EntityIsGenerated (org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated)3 DefaultEditor (org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)2 DatabaseConfiguration (org.eclipse.reddeer.requirements.db.DatabaseConfiguration)1 Marker (org.eclipse.reddeer.workbench.impl.editor.Marker)1 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)1