Search in sources :

Example 1 with WaitTimeoutExpiredException

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

the class HQLEditor method runHQLQuery.

/**
 * Executes HQL query
 */
public void runHQLQuery() {
    new DefaultToolItem("Run HQL").click();
    try {
        Shell s = new DefaultShell("Open Session factory");
        new YesButton(s).click();
        new WaitWhile(new ShellIsAvailable(s));
    } catch (WaitTimeoutExpiredException e) {
        log.warn("Open Session factory question dialog was expected");
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 2 with WaitTimeoutExpiredException

use of org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException 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();
}
Also used : ProjectExplorer(org.eclipse.reddeer.eclipse.ui.navigator.resources.ProjectExplorer) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) ReverseEngineeringEditor(org.jboss.tools.hibernate.reddeer.mapper.editors.ReverseEngineeringEditor) NewReverseEngineeringFileWizard(org.jboss.tools.hibernate.reddeer.console.wizards.NewReverseEngineeringFileWizard) TableFilterWizardPage(org.jboss.tools.hibernate.reddeer.console.wizards.TableFilterWizardPage) DefaultEditor(org.eclipse.reddeer.workbench.impl.editor.DefaultEditor)

Example 3 with WaitTimeoutExpiredException

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

the class ConsoleConfigurationTest method prepareConsoleConfiguration.

public void prepareConsoleConfiguration(String hibernateVersion) {
    KnownConfigurationsView v = new KnownConfigurationsView();
    v.open();
    EditConfigurationShell s = v.addConfiguration();
    s.setName(CONSOLE_NAME);
    EditConfigurationMainPage p = s.getMainPage();
    p.setProject(prjName);
    p.setDatabaseConnection(PredefinedConnection.HIBERNATE_CONFIGURED_CONNECTION);
    p.setConfigurationFile("/" + prjName + "/" + HIBERNATE_CFG_FILE);
    p.setHibernateVersion(hibernateVersion);
    // ANY ERROR IN WIZARD ??
    s.ok();
    v.open();
    EditConfigurationShell s2 = v.openConsoleConfiguration(CONSOLE_NAME);
    s2.close();
    v.open();
    try {
        v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
    } catch (WaitTimeoutExpiredException e) {
        log.info("Wait timeout occured, try rebuilding console config");
        v.selectConsole(CONSOLE_NAME);
        new ContextMenuItem("Rebuild configuration").select();
        new WaitWhile(new JobIsRunning());
        v.selectNode(CONSOLE_NAME, "Database", "SAKILA.PUBLIC", "ACTOR");
    }
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) EditConfigurationShell(org.jboss.tools.hibernate.reddeer.console.EditConfigurationShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) EditConfigurationMainPage(org.jboss.tools.hibernate.reddeer.console.EditConfigurationMainPage) KnownConfigurationsView(org.jboss.tools.hibernate.reddeer.console.views.KnownConfigurationsView) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 4 with WaitTimeoutExpiredException

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

the class DeleteResourceTest method testDeletePod.

@Test
public void testDeletePod() {
    OpenShiftResource applicationPod = OpenShiftUtils.getOpenShiftPod(projectReq.getProjectName(), new StringStartsWith("eap-app-"), connectionReq.getConnection());
    String podName = applicationPod.getName();
    applicationPod.delete();
    try {
        OpenShiftResourceExists openShiftResourceExists = new OpenShiftResourceExists(Resource.POD, podName, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection());
        new WaitWhile(openShiftResourceExists, TimePeriod.getCustom(15));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Application pod should be deleted at this point, but it it still present.");
    }
}
Also used : StringStartsWith(org.hamcrest.core.StringStartsWith) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 5 with WaitTimeoutExpiredException

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

the class PublishChangesTest method verifyChangesTookEffect.

private void verifyChangesTookEffect() {
    new ServerAdapter(Version.OPENSHIFT3, "eap-app", "Service").select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SHOW_IN_WEB_BROWSER).select();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    try {
        new WaitUntil(new BrowserContainsText("Hello"), TimePeriod.VERY_LONG);
    } catch (WaitTimeoutExpiredException ex) {
        fail("Application was not deployed successfully because it is not shown in web browser properly.");
    }
}
Also used : ServerAdapter(org.jboss.tools.openshift.reddeer.view.resources.ServerAdapter) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) BrowserContainsText(org.jboss.tools.openshift.reddeer.condition.BrowserContainsText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)46 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)34 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)23 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)18 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)17 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)15 Test (org.junit.Test)12 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)10 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)10 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)8 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)6 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)6 OpenShift3Connection (org.jboss.tools.openshift.reddeer.view.resources.OpenShift3Connection)5 OpenShiftResource (org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource)5 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)4 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4