Search in sources :

Example 1 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method getConsoleConfigurations.

public List<TreeItem> getConsoleConfigurations() {
    Tree tree = null;
    try {
        tree = new DefaultTree(this);
    } catch (RedDeerException e) {
        return null;
    }
    new WaitUntil(new ConfigrationsAreLoaded(tree));
    return tree.getItems();
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) Tree(org.eclipse.reddeer.swt.api.Tree) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) ConfigrationsAreLoaded(org.jboss.tools.hibernate.reddeer.condition.ConfigrationsAreLoaded) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 2 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException 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 RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-hibernate by jbosstools.

the class JPADetailsViewTest method testJPADetailView.

@Test
public void testJPADetailView() {
    ProjectUtils.getItem(PRJ, "org.gen", "Actor.java").open();
    TextEditor textEditor = new TextEditor("Actor.java");
    textEditor.setCursorPosition(20, 1);
    JPADetailsView jpaDetailsView = new JPADetailsView();
    jpaDetailsView.open();
    try {
        new DefaultStyledText("Type 'Actor' is mapped as entity.");
    } catch (RedDeerException e) {
        fail("JPA details should be available - known issue - https://issues.jboss.org/browse/JBIDE-17940");
    }
}
Also used : JPADetailsView(org.jboss.tools.hibernate.reddeer.view.JPADetailsView) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) Test(org.junit.Test)

Example 4 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException 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 5 with RedDeerException

use of org.eclipse.reddeer.common.exception.RedDeerException in project jbosstools-openshift by jbosstools.

the class ServerAdapterFromResourceTest method newAdapterFromResource.

private void newAdapterFromResource(Resource type, String name) {
    project.refresh();
    project.getOpenShiftResource(type, name).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    String resourceType = null;
    String selectors = name + " name=" + name;
    if (type.equals(Resource.DEPLOYMENT)) {
        resourceType = "ReplicationController";
        selectors = name + " deploymentconfig=" + serviceReq.getService().getName() + ", name=" + serviceReq.getService().getName() + ", deployment=" + name;
    } else {
        resourceType = type.toString().replaceFirst(".$", "").replaceAll(" ", "");
    }
    assertTrue("Resource should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(project.getName(), selectors).isSelected());
    try {
        new DefaultStyledText(resourceType);
    } catch (RedDeerException e) {
        fail("Resource type does not match");
    }
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, name, resourceType).test());
    adapter = new ServerAdapter(Version.OPENSHIFT3, name, resourceType);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)34 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)12 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)11 Test (org.junit.Test)11 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)10 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)10 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)6 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 TextEditor (org.eclipse.reddeer.workbench.impl.editor.TextEditor)5 PackageExplorerPart (org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart)4 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)4 File (java.io.File)3 LabeledCombo (org.eclipse.reddeer.swt.impl.combo.LabeledCombo)3 DefaultStyledText (org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText)3