Search in sources :

Example 1 with OpenShiftServerAdapterFactory

use of org.jboss.tools.openshift.internal.ui.server.OpenShiftServerAdapterFactory in project jbosstools-openshift by jbosstools.

the class OpenShiftServerAdapterFactoryTest method testLoadWebModule.

@Test
public void testLoadWebModule() {
    OpenShiftServerAdapterFactory factory = new OpenShiftServerAdapterFactory();
    IServer server = mock(IServer.class);
    OpenShiftServer realServer = mock(OpenShiftServer.class);
    when(server.loadAdapter(eq(OpenShiftServer.class), isA(IProgressMonitor.class))).thenReturn(realServer);
    IServerModule serverModule = factory.getAdapter(server, IServerModule.class);
    assertNotNull(serverModule);
    IModule[] module = serverModule.getModule();
    assertNotNull(module);
    assertNotNull(module[0].loadAdapter(IWebModule.class, null));
}
Also used : IServer(org.eclipse.wst.server.core.IServer) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IModule(org.eclipse.wst.server.core.IModule) OpenShiftServerAdapterFactory(org.jboss.tools.openshift.internal.ui.server.OpenShiftServerAdapterFactory) IServerModule(org.eclipse.wst.server.ui.IServerModule) OpenShiftServer(org.jboss.tools.openshift.core.server.OpenShiftServer) IWebModule(org.eclipse.jst.server.core.IWebModule) Test(org.junit.Test)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IWebModule (org.eclipse.jst.server.core.IWebModule)1 IModule (org.eclipse.wst.server.core.IModule)1 IServer (org.eclipse.wst.server.core.IServer)1 IServerModule (org.eclipse.wst.server.ui.IServerModule)1 OpenShiftServer (org.jboss.tools.openshift.core.server.OpenShiftServer)1 OpenShiftServerAdapterFactory (org.jboss.tools.openshift.internal.ui.server.OpenShiftServerAdapterFactory)1 Test (org.junit.Test)1