Search in sources :

Example 6 with ServersView2

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

the class CDKServerAdapterAbstractTest method stopRunningServerAdapters.

/**
 * static method for server adapters stopping in after class method
 */
public static void stopRunningServerAdapters() {
    log.info("Cleaning up resources, stopping server adapter");
    ServersView2 view = new ServersView2();
    if (!view.isOpen()) {
        view.open();
    }
    for (Server server : view.getServers()) {
        log.info("Checking server " + server.getLabel().getName() + " state: " + server.getLabel().getState());
        if (server.getLabel().getState().equals(ServerState.STARTED)) {
            log.info("Stopping server");
            server.stop();
        }
    }
}
Also used : CDKServer(org.jboss.tools.cdk.reddeer.server.ui.CDKServer) Server(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.Server) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2)

Example 7 with ServersView2

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

the class CDKUtils 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 8 with ServersView2

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

the class ServerAdapterFromResourceTest method assertAdapterWorks.

private void assertAdapterWorks() {
    String serverName = adapter.getLabel();
    Server server = new ServersView2().getServer(serverName);
    try {
        new WaitUntil(new ServerHasState(server, ServerState.STARTED), TimePeriod.LONG);
    } catch (WaitTimeoutExpiredException ex) {
        throw new OpenshiftTestInFailureException("https://issues.jboss.org/browse/JBIDE-24241", ex);
    }
}
Also used : OpenshiftTestInFailureException(org.jboss.tools.openshift.ui.bot.test.common.OpenshiftTestInFailureException) ServerHasState(org.eclipse.reddeer.eclipse.condition.ServerHasState) Server(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.Server) ServersView2(org.eclipse.reddeer.eclipse.wst.server.ui.cnf.ServersView2) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) 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