Search in sources :

Example 1 with PackageExplorerPart

use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart in project linuxtools by eclipse.

the class ComposeTest method runDockerCompose.

private void runDockerCompose(String project, String projectFile) {
    PackageExplorerPart pe = new PackageExplorerPart();
    pe.open();
    pe.getProject(project).getProjectItem(projectFile).select();
    @SuppressWarnings("unchecked") ContextMenuItem contextMenu = new ContextMenuItem(new WithTextMatcher("Run As"), new RegexMatcher(".*Docker Compose"));
    contextMenu.select();
    new OkButton().click();
    try {
        new DefaultShell("Docker Compose");
        new PushButton("Apply and Close").click();
        fail("Docker Compose has not been found! Is it installed and the path is correct?");
    } catch (CoreLayerException ex) {
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    new WaitWhile(new ConsoleHasNoChange());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RegexMatcher(org.eclipse.reddeer.common.matcher.RegexMatcher) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) ConsoleHasNoChange(org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)

Example 2 with PackageExplorerPart

use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart 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 3 with PackageExplorerPart

use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart 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();
    }
}
Also used : RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ShellMenuItem(org.eclipse.reddeer.swt.impl.menu.ShellMenuItem) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) AutoBuildingRequirement(org.eclipse.reddeer.requirements.autobuilding.AutoBuildingRequirement) AutoBuilding(org.eclipse.reddeer.requirements.autobuilding.AutoBuildingRequirement.AutoBuilding) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) DefaultEditor(org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)

Example 4 with PackageExplorerPart

use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method rebuildProject.

private static void rebuildProject() {
    PackageExplorerPart pexplorer = new PackageExplorerPart();
    pexplorer.open();
    pexplorer.getProject(PROJECT_NAME).select();
    new ContextMenuItem("Maven", "Update Project...").select();
    new WaitUntil(new ShellIsAvailable("Update Maven Project"), TimePeriod.LONG);
    new CheckBox("Force Update of Snapshots/Releases").toggle(true);
    new PushButton("OK").click();
    new WaitWhile(new ShellIsAvailable("Update Maven Project"), TimePeriod.DEFAULT);
    new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) PackageExplorerPart(org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 5 with PackageExplorerPart

use of org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart 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)

Aggregations

PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)6 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)4 DefaultEditor (org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)4 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)3 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)3 EntityIsGenerated (org.jboss.tools.hibernate.reddeer.condition.EntityIsGenerated)3 Test (org.junit.Test)3 ProblemExists (org.eclipse.reddeer.eclipse.condition.ProblemExists)2 MarkerDescriptionMatcher (org.eclipse.reddeer.eclipse.ui.markers.matcher.MarkerDescriptionMatcher)2 Problem (org.eclipse.reddeer.eclipse.ui.problems.Problem)2 ProblemsView (org.eclipse.reddeer.eclipse.ui.views.markers.ProblemsView)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)2 RegexMatcher (org.eclipse.reddeer.common.matcher.RegexMatcher)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)1 ConsoleHasNoChange (org.eclipse.reddeer.eclipse.condition.ConsoleHasNoChange)1 CaptureScreenshotException (org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException)1