Search in sources :

Example 61 with IServer

use of org.eclipse.wst.server.core.IServer in project webtools.servertools by eclipse.

the class PublishListenerTestCase method testListener.

public void testListener() {
    IPublishListener listener = new IPublishListener() {

        public void publishStarted(IServer server) {
        // ignore
        }

        public void publishFinished(IServer server, IStatus status) {
        // ignore
        }
    };
    listener.publishStarted(null);
    listener.publishFinished(null, null);
}
Also used : IServer(org.eclipse.wst.server.core.IServer) IStatus(org.eclipse.core.runtime.IStatus) IPublishListener(org.eclipse.wst.server.core.IPublishListener)

Example 62 with IServer

use of org.eclipse.wst.server.core.IServer in project webtools.servertools by eclipse.

the class ServerLifecycleListenerTestCase method testListener.

public void testListener() {
    IServerLifecycleListener listener = new IServerLifecycleListener() {

        public void serverAdded(IServer server) {
        // ignore
        }

        public void serverChanged(IServer server) {
        // ignore
        }

        public void serverRemoved(IServer server) {
        // ignore
        }
    };
    listener.serverAdded(null);
    listener.serverChanged(null);
    listener.serverRemoved(null);
}
Also used : IServerLifecycleListener(org.eclipse.wst.server.core.IServerLifecycleListener) IServer(org.eclipse.wst.server.core.IServer)

Example 63 with IServer

use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.

the class ServerAdapterHandler method execute.

@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
    final IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
    ISelection selection = UIUtils.getCurrentSelection(event);
    IResource selectedResource = UIUtils.getFirstElement(selection, IResource.class);
    final IServer openShiftServer = getOpenShiftServer(selectedResource);
    if (openShiftServer != null) {
        openServersView(openShiftServer, workbenchWindow);
    }
    return null;
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IServer(org.eclipse.wst.server.core.IServer) ISelection(org.eclipse.jface.viewers.ISelection) IResource(com.openshift.restclient.model.IResource)

Example 64 with IServer

use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.

the class ServerAdapterHandler method openOrCreateServerAdapter.

/**
 * Looks for an existing {@link IServer} matching the given {@code resource},
 * otherwise, opens the Server Adapter wizard to create a new one.
 *
 * @param resource
 * @param route
 * @param connection
 *            the OpenShift connection
 */
private IServer openOrCreateServerAdapter(final IResource resource, IRoute route, final Connection connection) {
    if (resource == null || connection == null) {
        return null;
    }
    final String resourceName = OpenShiftResourceUniqueId.get(resource);
    IServer server = OpenShiftServerUtils.findServerForResource(resourceName);
    if (server == null) {
        server = createServer(resourceName, resource, route, connection);
    }
    return server;
}
Also used : IServer(org.eclipse.wst.server.core.IServer)

Example 65 with IServer

use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.

the class OpenShiftSubsystemTest method testSubsystemsStandard.

@Test
public void testSubsystemsStandard() throws Exception {
    IServer s1 = OpenShiftServerTestUtils.createOpenshift3Server("example", OpenShiftServerBehaviour.PROFILE_OPENSHIFT3);
    testOpenshift3Standard(s1);
}
Also used : IServer(org.eclipse.wst.server.core.IServer) Test(org.junit.Test)

Aggregations

IServer (org.eclipse.wst.server.core.IServer)183 CoreException (org.eclipse.core.runtime.CoreException)39 IModule (org.eclipse.wst.server.core.IModule)32 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)30 Test (org.junit.Test)30 IProject (org.eclipse.core.resources.IProject)25 IStatus (org.eclipse.core.runtime.IStatus)25 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)23 ArrayList (java.util.ArrayList)20 File (java.io.File)17 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)13 Status (org.eclipse.core.runtime.Status)12 Iterator (java.util.Iterator)11 IPath (org.eclipse.core.runtime.IPath)11 IServerType (org.eclipse.wst.server.core.IServerType)11 CDKServer (org.jboss.tools.openshift.cdk.server.core.internal.adapter.CDKServer)11 IOException (java.io.IOException)10 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)10 Server (org.eclipse.wst.server.core.internal.Server)10 IFolder (org.eclipse.core.resources.IFolder)8