use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.
the class OpenShiftSubsystemTest method testSubsystemsNull.
@Test
public void testSubsystemsNull() throws Exception {
IServer s1 = OpenShiftServerTestUtils.createOpenshift3Server("example", null);
testOpenshift3Standard(s1);
}
use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.
the class OpenShiftServerTestUtils method mockServer.
public static IServer mockServer(IServerWorkingCopy workingCopy, IResource resource, Connection connection) throws UnsupportedEncodingException, MalformedURLException {
IServer server = mock(IServer.class);
if (connection != null) {
String connectionUrl = ConnectionURL.forConnection(connection).toString();
doReturn(connectionUrl).when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_CONNECTIONURL), anyString());
}
String resourceUniqueId = OpenShiftResourceUniqueId.get(resource);
doReturn(resourceUniqueId).when(server).getAttribute(eq(OpenShiftServerUtils.ATTR_SERVICE), anyString());
doReturn(workingCopy).when(server).createWorkingCopy();
return server;
}
use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.
the class DebugLaunchConfigsTest method getRemoteDebuggerLaunchConfiguration.
@Test
public void getRemoteDebuggerLaunchConfiguration() throws CoreException {
String name = "Remote debugger to foo";
ILaunchConfiguration good = mock(ILaunchConfiguration.class);
when(good.getName()).thenReturn(name);
ILaunchConfiguration bad = mock(ILaunchConfiguration.class);
when(launchManager.getLaunchConfigurations(any())).thenReturn(new ILaunchConfiguration[] { bad, good });
IServer server = mockServer("foo");
assertSame(good, debugLaunchConfigs.getRemoteDebuggerLaunchConfiguration(server));
server = mockServer("bar");
assertNull(debugLaunchConfigs.getRemoteDebuggerLaunchConfiguration(server));
}
use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.
the class DebugLaunchConfigsTest method mockServer.
private IServer mockServer(String name) {
IServer server = mock(IServer.class);
when(server.getName()).thenReturn(name);
return server;
}
use of org.eclipse.wst.server.core.IServer in project jbosstools-openshift by jbosstools.
the class ResourceChangePublisher method getPublishRequiredServers.
private OpenShiftServer[] getPublishRequiredServers(IResourceDelta delta) {
// The list of servers that will require publish
final List<OpenShiftServer> servers2 = new ArrayList<>();
// wrksServers = Workspaces Servers
final IServer[] wrksServers = ServerCore.getServers();
for (int i = 0; i < wrksServers.length; i++) {
OpenShiftServer os = (OpenShiftServer) wrksServers[i].loadAdapter(OpenShiftServer.class, new NullProgressMonitor());
if (os != null) {
IProject magic = OpenShiftServerUtils.getDeployProject(wrksServers[i]);
if (magic != null) {
// Safe because we've already eliminated non-project deltas
IProject p = (IProject) delta.getResource();
if (magic.equals(p)) {
servers2.add(os);
}
}
}
}
return servers2.toArray(new OpenShiftServer[servers2.size()]);
}
Aggregations