Search in sources :

Example 11 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project linuxtools by eclipse.

the class DockerExplorerView method getDockerConnectionNames.

/**
 * Gets names of all docker connections present in docker explorer.
 *
 * @return list of docker connections names
 */
public List<String> getDockerConnectionNames() {
    activate();
    List<String> connectionsNames = new ArrayList<String>();
    try {
        List<TreeItem> connections = new DefaultTree().getItems();
        for (TreeItem item : connections) {
            connectionsNames.add(getName(item));
        }
    } catch (CoreLayerException ex) {
    // no connections in view
    }
    return connectionsNames;
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) ArrayList(java.util.ArrayList) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 12 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project linuxtools by eclipse.

the class AbstractDockerBotTest method clearConsole.

protected void clearConsole() {
    ConsoleView cview = new ConsoleView();
    cview.open();
    try {
        cview.clearConsole();
    } catch (CoreLayerException ex) {
    // swallow intentionally
    }
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 13 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project linuxtools by eclipse.

the class AbstractImageBotTest method setUpRegister.

protected void setUpRegister(String serverAddress, String email, String userName, String password) {
    WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
    RegistryAccountsPreferencePage page = new RegistryAccountsPreferencePage(dialog);
    dialog.open();
    dialog.select(page);
    page.removeRegistry(serverAddress);
    page.addRegistry(serverAddress, email, userName, password);
    try {
        new DefaultShell("New Registry Account").setFocus();
    } catch (CoreLayerException e) {
        new DefaultShell("Preferences").setFocus();
    }
    new PushButton("Apply and Close").click();
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WorkbenchPreferenceDialog(org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) RegistryAccountsPreferencePage(org.eclipse.linuxtools.docker.reddeer.preferences.RegistryAccountsPreferencePage)

Example 14 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.

/**
 * Test if deployment config is visible in OS Explorer, when there is no service.
 */
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
    this.project.expand();
    Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
    assertTrue("Service does not exist!", service != null);
    service.select();
    new ContextMenuItem("Delete").select();
    new DefaultShell("Delete OpenShift Resource");
    new OkButton().click();
    // assert service is deleted
    List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
    assertTrue("Service not deleted!", resources.isEmpty());
    try {
        this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
    } catch (CoreLayerException e) {
        // TODO: do not throw after JBIDE-24217 is fixed
        throw new OpenshiftTestInFailureException("JBIDE-24217");
    // TODO: uncomment after JBIDE-24217 is fixed
    // fail("Deployment config not visible!");
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) RequiredService(org.jboss.tools.openshift.reddeer.requirement.OpenShiftServiceRequirement.RequiredService) Service(org.jboss.tools.openshift.reddeer.view.resources.Service) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) 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 15 with CoreLayerException

use of org.eclipse.reddeer.core.exception.CoreLayerException in project jbosstools-openshift by jbosstools.

the class EditResourcesTest method testIncorrectResourceContent.

@Test
public void testIncorrectResourceContent() {
    TextEditor editor = getBuildConfigTextEditor();
    String text = editor.getText();
    if (buildConfig == null) {
        buildConfig = text;
    }
    editor.setText(text.replace("\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"", "\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"wtf"));
    try {
        editor.save();
    } catch (CoreLayerException ex) {
    // ok
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
    assertTrue("Editor should be dirty, it should not be able to save incorrect content", editor.isDirty());
    try {
        new DefaultShell("Problem Occurred");
        new OkButton().click();
    } catch (RedDeerException ex) {
    // sometimes it occures, sometimes not
    }
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) TextEditor(org.eclipse.reddeer.workbench.impl.editor.TextEditor) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Aggregations

CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)26 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)10 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)7 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)6 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)5 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)5 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)4 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)4 Test (org.junit.Test)4 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)3 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)3 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)3 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)3 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)3 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)3 AbstractWaitCondition (org.eclipse.reddeer.common.condition.AbstractWaitCondition)2 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2