* @return standalone client based on the harness credentials, org and
* space. This is not the client used by the server instance, but a new
* client for testing purposes only.
*/
public CloudFoundryOperations createStandaloneClient() throws CoreException {
CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class,
null);
CloudFoundrySpace space = cloudFoundryServer.getCloudFoundrySpace();
if (space == null) {
throw CloudErrorUtil.toCoreException("No org and space was set in test harness for: "
+ cloudFoundryServer.getServerId());
}
try {
return CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
new CloudCredentials(cloudFoundryServer.getUsername(), cloudFoundryServer.getPassword()),
new URL(cloudFoundryServer.getUrl()), space.getOrgName(), space.getSpaceName(),
cloudFoundryServer.getSelfSignedCertificate());
}
catch (MalformedURLException e) {
throw CloudErrorUtil.toCoreException(e);
}
}