Search in sources :

Example 1 with ServersView2

use of org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2 in project jbosstools-openshift by jbosstools.

the class BrowserIsReadyElseReloadCondition method test.

@Override
public boolean test() {
    BrowserEditor browserEditor = null;
    try {
        browserEditor = new BrowserEditor(new BaseMatcher<String>() {

            @Override
            public boolean matches(Object arg0) {
                return true;
            }

            @Override
            public void describeTo(Description arg0) {
            // TODO Auto-generated method stub
            }
        });
    } catch (CoreLayerException ex) {
        LOGGER.debug("CoreLayerException in waiting for browser in BrowserIsReadyElseReloadCondition");
        LOGGER.debug(StackTraceUtils.stackTraceToString(ex));
        return false;
    }
    String text = browserEditor.getText();
    if (text.contains("Unable to load page") || text.contains("404")) {
        LOGGER.debug("Refreshing browser");
        new ServersView2().open();
        serverAdapter.select();
        new ContextMenuItem("Show In", "Web Browser").select();
        return false;
    } else {
        // Browser is ready
        return true;
    }
}
Also used : Description(org.hamcrest.Description) BaseMatcher(org.hamcrest.BaseMatcher) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) BrowserEditor(org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 2 with ServersView2

use of org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2 in project jbosstools-openshift by jbosstools.

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaServersView.

@Test
public void testCreateOpenShift3ServerAdapterViaServersView() {
    ServersView2 serversView = new ServersView2();
    serversView.open();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_SERVER).select();
    new DefaultShell(OpenShiftLabel.Shell.ADAPTER);
    new DefaultTreeItem(OpenShiftLabel.Others.OS3_SERVER_ADAPTER).select();
    next();
    next();
    setAdapterDetailsAndCreateAdapterAndVerifyExistence();
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 3 with ServersView2

use of org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2 in project jbosstools-openshift by jbosstools.

the class CDKTestUtils method getAllServers.

public static List<Server> getAllServers() {
    log.info("Collecting all server adapters");
    ServersView2 view = new ServersView2();
    view.open();
    return view.getServers();
}
Also used : ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2)

Example 4 with ServersView2

use of org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2 in project jbosstools-openshift by jbosstools.

the class CDKTestUtils method deleteCDEServer.

public static void deleteCDEServer(String adapter) {
    // $NON-NLS-1$
    log.info("Deleting Container Development Environment server adapter: " + adapter);
    ServersView2 servers = new ServersView2();
    servers.open();
    try {
        servers.getServer(adapter).delete(true);
    } catch (EclipseLayerException exc) {
        log.error(exc.getMessage());
        exc.printStackTrace();
    }
}
Also used : EclipseLayerException(org.eclipse.reddeer.eclipse.exception.EclipseLayerException) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2)

Example 5 with ServersView2

use of org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2 in project jbosstools-openshift by jbosstools.

the class DebuggingEAPAppTest method waitForserverAdapterToBeInRightState.

private static void waitForserverAdapterToBeInRightState() {
    new WaitUntil(new ServerHasState(new ServersView2().getServer(serverAdapter.getLabel()), ServerState.DEBUGGING), TimePeriod.VERY_LONG);
    new WaitUntil(new ServerHasPublishState(new ServersView2().getServer(serverAdapter.getLabel()), ServerPublishState.SYNCHRONIZED));
}
Also used : ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) ServerHasPublishState(org.eclipse.reddeer.eclipse.condition.ServerHasPublishState) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

ServersView2 (org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2)8 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 ServerHasState (org.eclipse.reddeer.eclipse.condition.ServerHasState)2 Server (org.eclipse.reddeer.eclipse.wst.server.ui.cnf.Server)2 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)1 ServerHasPublishState (org.eclipse.reddeer.eclipse.condition.ServerHasPublishState)1 EclipseLayerException (org.eclipse.reddeer.eclipse.exception.EclipseLayerException)1 BrowserEditor (org.eclipse.reddeer.eclipse.ui.browser.BrowserEditor)1 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)1 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)1 BaseMatcher (org.hamcrest.BaseMatcher)1 Description (org.hamcrest.Description)1 CDKServer (org.jboss.tools.cdk.reddeer.server.ui.CDKServer)1 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)1 OpenshiftTestInFailureException (org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException)1 Test (org.junit.Test)1