mirror of https://github.com/apache/jclouds.git
trying to fix guice to have both user/admin modules
This commit is contained in:
parent
17e90c22b1
commit
557cf5e9b3
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.vcloud.director.v1_5;
|
||||
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorContextImpl;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
|
||||
import com.google.inject.ImplementedBy;
|
||||
|
||||
/**
|
||||
* @author danikov
|
||||
*/
|
||||
@ImplementedBy(VCloudDirectorContextImpl.class)
|
||||
public interface VCloudDirectorContext extends RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
||||
|
||||
RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> getAdminContext();
|
||||
}
|
|
@ -23,6 +23,9 @@ import java.util.Properties;
|
|||
|
||||
import org.jclouds.rest.RestContextBuilder;
|
||||
import org.jclouds.vcloud.director.v1_5.config.VCloudDirectorRestClientModule;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorContextImpl;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
|
||||
import com.google.inject.Module;
|
||||
|
||||
|
@ -39,5 +42,10 @@ public class VCloudDirectorContextBuilder extends RestContextBuilder<VCloudDirec
|
|||
protected void addClientModule(List<Module> modules) {
|
||||
modules.add(new VCloudDirectorRestClientModule());
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public VCloudDirectorContext buildContext() {
|
||||
return buildInjector().getInstance(VCloudDirectorContextImpl.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncClient;
|
|||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
|
||||
/**
|
||||
* Provides asynchronous access to VCloudDirector Admin via their REST API.
|
||||
|
@ -40,7 +40,7 @@ import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
|||
* @see VCloudDirectorAdminClient
|
||||
* @author danikov
|
||||
*/
|
||||
public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorUserAsyncClient {
|
||||
public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorAsyncClient {
|
||||
/**
|
||||
* @return asynchronous access to admin query features
|
||||
*/
|
||||
|
|
|
@ -35,17 +35,17 @@ import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryClient;
|
|||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
|
||||
/**
|
||||
* Provides synchronous access to VCloudDirector Admin.
|
||||
*
|
||||
* @see VCloudDirectorUserAsyncClient
|
||||
* @see VCloudDirectorAsyncClient
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
public interface VCloudDirectorAdminClient extends VCloudDirectorUserClient {
|
||||
public interface VCloudDirectorAdminClient extends VCloudDirectorClient {
|
||||
/**
|
||||
* @return asynchronous access to admin query features
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
|
@ -36,26 +37,17 @@ import org.jclouds.http.annotation.Redirection;
|
|||
import org.jclouds.http.annotation.ServerError;
|
||||
import org.jclouds.location.Provider;
|
||||
import org.jclouds.rest.ConfiguresRestClient;
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.jclouds.rest.config.BinderUtils;
|
||||
import org.jclouds.rest.config.RestClientModule;
|
||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
|
||||
import org.jclouds.rest.internal.RestContextImpl;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
||||
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Session;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminCatalogAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminCatalogClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminNetworkAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminNetworkClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminOrgAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminOrgClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminQueryAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminQueryClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminVdcAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.AdminVdcClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.GroupAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.GroupClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.MediaAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
||||
|
@ -70,19 +62,33 @@ import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
|
|||
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.UploadClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.UserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.UserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VAppAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VAppClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.functions.LoginUserInOrgWithPassword;
|
||||
import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose;
|
||||
import org.jclouds.vcloud.director.v1_5.handlers.VCloudDirectorErrorHandler;
|
||||
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.login.SessionClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Supplier;
|
||||
|
@ -93,128 +99,153 @@ import com.google.common.cache.LoadingCache;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import com.google.inject.TypeLiteral;
|
||||
import com.google.inject.name.Named;
|
||||
|
||||
/**
|
||||
* Configures the VCloudDirector connection.
|
||||
* Configures the cloudstack connection.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@RequiresHttp
|
||||
@ConfiguresRestClient
|
||||
public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
||||
|
||||
public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
||||
.put(AdminCatalogClient.class, AdminCatalogAsyncClient.class)
|
||||
.put(AdminOrgClient.class, AdminOrgAsyncClient.class)
|
||||
.put(AdminVdcClient.class, AdminVdcAsyncClient.class)
|
||||
.put(CatalogClient.class, CatalogAsyncClient.class)
|
||||
.put(NetworkClient.class, NetworkAsyncClient.class)
|
||||
.put(OrgClient.class, OrgAsyncClient.class)
|
||||
.put(QueryClient.class, QueryAsyncClient.class)
|
||||
.put(AdminQueryClient.class, AdminQueryAsyncClient.class)
|
||||
.put(MediaClient.class, MediaAsyncClient.class)
|
||||
.put(TaskClient.class, TaskAsyncClient.class)
|
||||
.put(VdcClient.class, VdcAsyncClient.class)
|
||||
.put(VAppClient.class, VAppAsyncClient.class)
|
||||
.put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)
|
||||
.put(UploadClient.class, UploadAsyncClient.class)
|
||||
.put(MetadataClient.Readable.class, MetadataAsyncClient.Readable.class)
|
||||
.put(MetadataClient.Writeable.class, MetadataAsyncClient.Writeable.class)
|
||||
.put(GroupClient.class, GroupAsyncClient.class)
|
||||
.put(UserClient.class, UserAsyncClient.class)
|
||||
.put(AdminNetworkClient.class, AdminNetworkAsyncClient.class)
|
||||
.build();
|
||||
|
||||
public VCloudDirectorRestClientModule() {
|
||||
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class, DELEGATE_MAP);
|
||||
|
||||
public static final Map<Class<?>, Class<?>> USER_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
||||
.put(CatalogClient.class, CatalogAsyncClient.class)
|
||||
.put(MediaClient.class, MediaAsyncClient.class)
|
||||
.put(MetadataClient.Readable.class, MetadataAsyncClient.Readable.class)
|
||||
.put(MetadataClient.Writeable.class, MetadataAsyncClient.Writeable.class)
|
||||
.put(NetworkClient.class, NetworkAsyncClient.class)
|
||||
.put(OrgClient.class, OrgAsyncClient.class)
|
||||
.put(QueryClient.class, QueryAsyncClient.class)
|
||||
.put(TaskClient.class, TaskAsyncClient.class)
|
||||
.put(UploadClient.class, UploadAsyncClient.class)
|
||||
.put(VAppClient.class, VAppAsyncClient.class)
|
||||
.put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)
|
||||
.put(VdcClient.class, VdcAsyncClient.class)
|
||||
.build();
|
||||
|
||||
public static final Map<Class<?>, Class<?>> ADMIN_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
||||
.putAll(USER_DELEGATE_MAP)
|
||||
.put(AdminCatalogClient.class, AdminCatalogAsyncClient.class)
|
||||
.put(AdminNetworkClient.class, AdminNetworkAsyncClient.class)
|
||||
.put(AdminOrgClient.class, AdminOrgAsyncClient.class)
|
||||
.put(AdminQueryClient.class, AdminQueryAsyncClient.class)
|
||||
.put(AdminVdcClient.class, AdminVdcAsyncClient.class)
|
||||
.put(GroupClient.class, GroupAsyncClient.class)
|
||||
.put(UserClient.class, UserAsyncClient.class)
|
||||
.build();
|
||||
|
||||
@Override
|
||||
protected void bindAsyncClient() {
|
||||
// bind the user client (default)
|
||||
super.bindAsyncClient();
|
||||
// bind the admin client
|
||||
BinderUtils.bindAsyncClient(binder(), VCloudDirectorAdminAsyncClient.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void bindClient() {
|
||||
// bind the user client (default)
|
||||
super.bindClient();
|
||||
// bind the admin client
|
||||
BinderUtils.bindClient(binder(), VCloudDirectorAdminClient.class, VCloudDirectorAdminAsyncClient.class, ADMIN_DELEGATE_MAP);
|
||||
}
|
||||
|
||||
public VCloudDirectorRestClientModule() {
|
||||
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class, ADMIN_DELEGATE_MAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(new TypeLiteral<RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient>>() {
|
||||
}).to(new TypeLiteral<RestContextImpl<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient>>() {
|
||||
});
|
||||
|
||||
// Bind clients that are used directly in Functions, Predicates and other circumstances
|
||||
bindClientAndAsyncClient(binder(), SessionClient.class, SessionAsyncClient.class);
|
||||
bindClientAndAsyncClient(binder(), OrgClient.class, OrgAsyncClient.class);
|
||||
bindClientAndAsyncClient(binder(), SessionClient.class, SessionAsyncClient.class);
|
||||
bindClientAndAsyncClient(binder(), TaskClient.class, TaskAsyncClient.class);
|
||||
bindClientAndAsyncClient(binder(), VAppClient.class, VAppAsyncClient.class);
|
||||
|
||||
|
||||
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class);
|
||||
|
||||
|
||||
super.configure();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void bindErrorHandlers() {
|
||||
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(VCloudDirectorErrorHandler.class);
|
||||
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(VCloudDirectorErrorHandler.class);
|
||||
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(VCloudDirectorErrorHandler.class);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Login
|
||||
protected Supplier<URI> loginUrl(@Provider Supplier<URI> provider) {
|
||||
// TODO: technically, we should implement version client, but this will work
|
||||
return Suppliers.compose(new Function<URI, URI>() {
|
||||
|
||||
|
||||
@Override
|
||||
public URI apply(URI arg0) {
|
||||
return URI.create(arg0.toASCIIString() + "/sessions");
|
||||
}
|
||||
|
||||
|
||||
}, provider);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
protected Supplier<Session> currentSession(Supplier<SessionWithToken> in) {
|
||||
return Suppliers.compose(new Function<SessionWithToken, Session>() {
|
||||
|
||||
|
||||
@Override
|
||||
public Session apply(SessionWithToken arg0) {
|
||||
return arg0.getSession();
|
||||
}
|
||||
|
||||
|
||||
}, in);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
@org.jclouds.vcloud.director.v1_5.annotations.Session
|
||||
protected Supplier<String> sessionToken(Supplier<SessionWithToken> in) {
|
||||
return Suppliers.compose(new Function<SessionWithToken, String>() {
|
||||
|
||||
|
||||
@Override
|
||||
public String apply(SessionWithToken arg0) {
|
||||
return arg0.getToken();
|
||||
}
|
||||
|
||||
|
||||
}, in);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
protected Function<Credentials, SessionWithToken> makeSureFilterRetriesOnTimeout(
|
||||
LoginUserInOrgWithPassword loginWithPasswordCredentials) {
|
||||
LoginUserInOrgWithPassword loginWithPasswordCredentials) {
|
||||
// we should retry on timeout exception logging in.
|
||||
return new RetryOnTimeOutExceptionFunction<Credentials, SessionWithToken>(loginWithPasswordCredentials);
|
||||
}
|
||||
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public LoadingCache<Credentials, SessionWithToken> provideSessionWithTokenCache(
|
||||
Function<Credentials, SessionWithToken> getSessionWithToken,
|
||||
@Named(Constants.PROPERTY_SESSION_INTERVAL) int seconds) {
|
||||
Function<Credentials, SessionWithToken> getSessionWithToken,
|
||||
@Named(Constants.PROPERTY_SESSION_INTERVAL) int seconds) {
|
||||
return CacheBuilder.newBuilder().expireAfterWrite(seconds, TimeUnit.SECONDS).build(
|
||||
CacheLoader.from(getSessionWithToken));
|
||||
CacheLoader.from(getSessionWithToken));
|
||||
}
|
||||
|
||||
|
||||
// Temporary conversion of a cache to a supplier until there is a single-element cache
|
||||
// http://code.google.com/p/guava-libraries/issues/detail?id=872
|
||||
@Provides
|
||||
@Singleton
|
||||
protected Supplier<SessionWithToken> provideSessionWithTokenSupplier(
|
||||
final LoadingCache<Credentials, SessionWithToken> cache, @Provider final Credentials creds) {
|
||||
final LoadingCache<Credentials, SessionWithToken> cache, @Provider final Credentials creds) {
|
||||
return new Supplier<SessionWithToken>() {
|
||||
@Override
|
||||
public SessionWithToken get() {
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.vcloud.director.v1_5.internal;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.domain.Credentials;
|
||||
import org.jclouds.lifecycle.Closer;
|
||||
import org.jclouds.location.Iso3166;
|
||||
import org.jclouds.location.Provider;
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.jclouds.rest.Utils;
|
||||
import org.jclouds.rest.annotations.ApiVersion;
|
||||
import org.jclouds.rest.annotations.BuildVersion;
|
||||
import org.jclouds.rest.annotations.Identity;
|
||||
import org.jclouds.rest.internal.RestContextImpl;
|
||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorContext;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.TypeLiteral;
|
||||
|
||||
/**
|
||||
* @author danikov
|
||||
*/
|
||||
@Singleton
|
||||
public class VCloudDirectorContextImpl extends RestContextImpl<VCloudDirectorClient, VCloudDirectorAsyncClient> implements
|
||||
VCloudDirectorContext {
|
||||
private final RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext;
|
||||
|
||||
@Inject
|
||||
VCloudDirectorContextImpl(Closer closer, Map<String, Credentials> credentialStore, Utils utils, Injector injector,
|
||||
TypeLiteral<VCloudDirectorClient> syncApi, TypeLiteral<VCloudDirectorAsyncClient> asyncApi,
|
||||
@Provider Supplier<URI> endpoint, @Provider String provider,
|
||||
@Identity String identity, @ApiVersion String apiVersion, @BuildVersion String buildVersion,
|
||||
@Iso3166 Set<String> iso3166Codes,
|
||||
RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext) {
|
||||
super(closer, credentialStore, utils, injector, syncApi, asyncApi, endpoint, provider,
|
||||
identity, apiVersion, buildVersion, iso3166Codes);
|
||||
this.adminContext = adminContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> getAdminContext() {
|
||||
return adminContext;
|
||||
}
|
||||
}
|
|
@ -43,10 +43,10 @@ import com.google.inject.Provides;
|
|||
/**
|
||||
* Provides asynchronous access to VCloudDirector via their REST API.
|
||||
*
|
||||
* @see VCloudDirectorUserClient
|
||||
* @see VCloudDirectorClient
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public interface VCloudDirectorUserAsyncClient {
|
||||
public interface VCloudDirectorAsyncClient {
|
||||
/**
|
||||
*
|
||||
* @return the current login session
|
|
@ -52,7 +52,7 @@ import com.google.inject.Provides;
|
|||
* @author danikov
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
public interface VCloudDirectorUserClient {
|
||||
public interface VCloudDirectorClient {
|
||||
/**
|
||||
* @return the current login session
|
||||
*/
|
|
@ -22,18 +22,18 @@ import static org.testng.Assert.assertEquals;
|
|||
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.login.SessionClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "VCloudDirectorClient")
|
||||
public class VCloudDirectorClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class VCloudDirectorClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
public void testRestClientModuleWorksProperly() throws Exception {
|
||||
|
||||
VCloudDirectorUserClient clientWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
||||
VCloudDirectorClient clientWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
||||
|
||||
assertEquals(clientWhenSessionsExist.getCurrentSession(), SessionClientExpectTest.SESSION);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -48,13 +48,13 @@ import com.google.common.collect.ImmutableSet;
|
|||
* @author danikov
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "media" }, singleThreaded = true, testName = "MediaClientExpectTest")
|
||||
public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
@Test
|
||||
public void testCreateMedia() {
|
||||
URI uploadLink = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||
|
@ -80,7 +80,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testCloneMedia() {
|
||||
URI cloneUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||
|
@ -110,7 +110,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testGetMedia() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||
.acceptAnyMedia()
|
||||
|
@ -127,7 +127,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testResponse400ForInvalidMedia() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/NOTAUUID");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/NOTAUUID")
|
||||
.acceptAnyMedia()
|
||||
|
@ -156,7 +156,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testResponse403ForCatalogIdUsedAsMediaId() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||
.acceptAnyMedia()
|
||||
|
@ -185,7 +185,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testResponse403ForFakeMediaId() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||
.acceptAnyMedia()
|
||||
|
@ -214,7 +214,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testUpdateMedia() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||
.xmlFilePayload("/media/updateMedia.xml", VCloudDirectorMediaType.MEDIA)
|
||||
|
@ -234,7 +234,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testDeleteMedia() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||
|
@ -252,7 +252,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testGetMetadata() {
|
||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||
.acceptAnyMedia()
|
||||
|
@ -271,7 +271,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testMergeMetadata() {
|
||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||
.xmlFilePayload("/media/mergeMetadata.xml", VCloudDirectorMediaType.METADATA)
|
||||
|
@ -290,7 +290,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testGetMetadataValue() {
|
||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||
.acceptAnyMedia()
|
||||
|
@ -309,7 +309,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testSetMetadataValue() {
|
||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||
.xmlFilePayload("/media/setMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
|
||||
|
@ -330,7 +330,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testDeleteMetadataValue() {
|
||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||
|
@ -348,7 +348,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
public void testGetOwner() {
|
||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
|
||||
.acceptAnyMedia()
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.jclouds.vcloud.director.v1_5.domain.NetworkFeatures;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.OrgNetwork;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.SyslogServerSettings;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -52,13 +52,13 @@ import com.google.common.collect.ImmutableSet;
|
|||
* @author danikov
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "network" }, singleThreaded = true, testName = "NetworkClientExpectTest")
|
||||
public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
@Test
|
||||
public void testGetNetwork() {
|
||||
URI networkUri = URI.create(endpoint + "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38")
|
||||
.acceptAnyMedia()
|
||||
|
@ -75,7 +75,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
|||
public void testGetNetworkWithInvalidId() {
|
||||
URI networkUri = URI.create(endpoint + "/network/NOTAUUID");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/NOTAUUID")
|
||||
.acceptAnyMedia()
|
||||
|
@ -104,7 +104,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
|||
public void testGetNetworkWithCatalogId() {
|
||||
URI networkUri = URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")
|
||||
.acceptAnyMedia()
|
||||
|
@ -133,7 +133,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
|||
public void testGetNetworkWithFakeId() {
|
||||
URI networkUri = URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||
.acceptAnyMedia()
|
||||
|
@ -162,7 +162,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
|||
public void testGetMetadata() {
|
||||
URI networkUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata")
|
||||
.acceptAnyMedia()
|
||||
|
@ -189,7 +189,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
|||
public void testGetMetadataValue() {
|
||||
URI networkUri = URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY")
|
||||
.acceptAnyMedia()
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Org;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.OrgList;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -46,11 +46,11 @@ import com.google.common.collect.Iterables;
|
|||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "org" }, singleThreaded = true, testName = "OrgClientExpectTest")
|
||||
public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
@Test
|
||||
public void testGetOrgList() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/"),
|
||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test
|
||||
public void testGetOrgFromOrgListReference() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/"),
|
||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrg() {
|
||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"),
|
||||
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrgFailOnInvalidOrgId() {
|
||||
URI orgUri = URI.create(endpoint + "/org/NOTAUUID");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/NOTAUUID"),
|
||||
getStandardPayloadResponse(400, "/org/error400.xml", VCloudDirectorMediaType.ERROR));
|
||||
|
||||
|
@ -123,7 +123,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrgFailOnWrongOrgId() {
|
||||
URI orgUri = URI.create(endpoint + "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"),
|
||||
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrgFailOnFakeOrgId() {
|
||||
URI orgUri = URI.create(endpoint + "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
|
||||
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
|
||||
|
||||
|
@ -171,7 +171,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrgMetadata() {
|
||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata")
|
||||
.acceptAnyMedia()
|
||||
|
@ -198,7 +198,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetOrgMetadataValue() {
|
||||
URI orgUri = URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata/KEY")
|
||||
.acceptAnyMedia()
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultCatalogRecord;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecordType;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
|
@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableMultimap;
|
|||
* @author grkvlt@apache.org
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "query" }, singleThreaded = true, testName = "QueryClientExpectTest")
|
||||
public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
@Test
|
||||
public void testQueryAllCatalogs() {
|
||||
|
@ -61,7 +61,7 @@ public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||
|
||||
QueryResultRecords expected = QueryResultRecords.builder()
|
||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=records"))
|
||||
|
@ -137,7 +137,7 @@ public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
|||
.payload(payloadFromResourceWithContentType("/query/allCatalogReferences.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||
|
||||
CatalogReferences expected = CatalogReferences.builder()
|
||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=references"))
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
|
@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableMultimap;
|
|||
* @author grkvlt@apache.org
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "task" }, singleThreaded = true, testName = "TaskClientExpectTest")
|
||||
public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
@Test
|
||||
public void testTaskListForValidOrg() {
|
||||
|
@ -75,7 +75,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
.payload(payloadFromResourceWithContentType("/org/org.xml", VCloudDirectorMediaType.TASKS_LIST + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
|
||||
TasksList expected = TasksList.builder()
|
||||
.name("Tasks Lists")
|
||||
|
@ -115,7 +115,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
.payload(payloadFromResourceWithContentType("/org/error400.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
|
||||
Error expected = Error.builder()
|
||||
.message("validation error on field 'id': String value has invalid format or length")
|
||||
|
@ -160,7 +160,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
.payload(payloadFromResourceWithContentType("/org/error403-fake.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||
|
||||
Error expected = Error.builder()
|
||||
.message("No access to entity \"com.vmware.vcloud.entity.org:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\".")
|
||||
|
@ -194,7 +194,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
.payload(payloadFromResourceWithContentType("/task/task.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||
|
||||
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
.statusCode(200)
|
||||
.build();
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||
|
||||
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
import org.testng.internal.annotations.Sets;
|
||||
|
@ -65,7 +65,7 @@ import com.google.common.collect.Multimaps;
|
|||
* @author grkvlt@apache.org
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "vapp" }, singleThreaded = true, testName = "VAppClientExpectTest")
|
||||
public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
private String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
||||
private URI vAppURI = URI.create(endpoint + vAppId);
|
||||
|
@ -76,7 +76,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)//TODO
|
||||
public void testGetVapp() {
|
||||
VCloudDirectorUserClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId)
|
||||
.acceptMedia(VCloudDirectorMediaType.VAPP)
|
||||
|
@ -92,7 +92,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId)
|
||||
.xmlFilePayload("/vApp/modifyVApp.xml", VCloudDirectorMediaType.VAPP)
|
||||
|
@ -113,7 +113,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testDeleteVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("DELETE", vAppId)
|
||||
.acceptAnyMedia()
|
||||
|
@ -129,7 +129,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testConsolidateVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/consolidate")
|
||||
.acceptAnyMedia()
|
||||
|
@ -145,7 +145,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testControlAccess() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/controlAccess")
|
||||
.xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
|
||||
|
@ -164,7 +164,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testDeploy() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/deploy")
|
||||
.xmlFilePayload("/vApp/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
||||
|
@ -184,7 +184,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testDiscardSuspendedState() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/discardSuspendedState")
|
||||
.acceptAnyMedia()
|
||||
|
@ -200,7 +200,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testEnterMaintenanceMode() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
|
||||
.acceptAnyMedia()
|
||||
|
@ -214,7 +214,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testExitMaintenanceMode() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
|
||||
.acceptAnyMedia()
|
||||
|
@ -228,7 +228,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testInstallVMwareTools() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/installVMwareTools")
|
||||
.acceptAnyMedia()
|
||||
|
@ -244,7 +244,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testRecomposeVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/recomposeVApp")
|
||||
.xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
|
||||
|
@ -264,7 +264,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testRelocate() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/relocate")
|
||||
.xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
|
||||
|
@ -284,7 +284,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testUndeploy() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/undeploy")
|
||||
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
||||
|
@ -304,7 +304,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testUpgradeHardwareVersion() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/action/upgradeHardwareVersion")
|
||||
.acceptAnyMedia()
|
||||
|
@ -320,7 +320,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testPowerOff() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/powerOff")
|
||||
.acceptAnyMedia()
|
||||
|
@ -336,7 +336,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testPowerOn() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/powerOn")
|
||||
.acceptAnyMedia()
|
||||
|
@ -352,7 +352,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testReboot() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/reboot")
|
||||
.acceptAnyMedia()
|
||||
|
@ -368,7 +368,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testReset() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/reset")
|
||||
.acceptAnyMedia()
|
||||
|
@ -384,7 +384,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testShutdown() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/shutdown")
|
||||
.acceptAnyMedia()
|
||||
|
@ -400,7 +400,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testSuspend() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/power/action/suspend")
|
||||
.acceptAnyMedia()
|
||||
|
@ -416,7 +416,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetControlAccesss() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/controlAccess")
|
||||
.acceptAnyMedia()
|
||||
|
@ -432,7 +432,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetGuestCustomizationSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/guestCustomizationSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -448,7 +448,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyGuestCustomizationSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/guestCustomizationSection")
|
||||
.xmlFilePayload("/vApp/modifyGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
|
||||
|
@ -468,7 +468,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetLeaseSettingsSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/leaseSettingsSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -484,7 +484,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyLeaseSettingsSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/leaseSettingsSection")
|
||||
.xmlFilePayload("/vApp/modifyLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
|
||||
|
@ -504,7 +504,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testEjectMedia() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/media/action/ejectMedia")
|
||||
.xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||
|
@ -524,7 +524,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testInsertMedia() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/media/action/insertMedia")
|
||||
.xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||
|
@ -544,7 +544,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetNetworkConfigSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/networkConfigSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -560,7 +560,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyNetworkConfigSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/networkConfigSection")
|
||||
.xmlFilePayload("/vApp/modifyNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
|
||||
|
@ -580,7 +580,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetNetworkConnectionSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/networkConnectionSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -596,7 +596,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyNetworkConnectionSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/networkConnectionSection")
|
||||
.xmlFilePayload("/vApp/modifyNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
|
||||
|
@ -616,7 +616,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetNetworkSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/networkSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -632,7 +632,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetOperatingSystemSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/operatingSystemSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -648,7 +648,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyOperatingSystemSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/operatingSystemSection")
|
||||
.xmlFilePayload("/vApp/modifyOperatingSystemSection.xml", VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION)
|
||||
|
@ -668,7 +668,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetOwner() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/owner")
|
||||
.acceptAnyMedia()
|
||||
|
@ -684,7 +684,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyOwner() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/owner")
|
||||
.xmlFilePayload("/vApp/modifyOwner.xml", VCloudDirectorMediaType.OWNER)
|
||||
|
@ -701,7 +701,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetProductSections() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/productSections")
|
||||
.acceptAnyMedia()
|
||||
|
@ -717,7 +717,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyProductSections() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/productSections")
|
||||
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
||||
|
@ -734,7 +734,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetPendingQuestion() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/question")
|
||||
.acceptAnyMedia()
|
||||
|
@ -750,7 +750,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testAnswerQuestion() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/question/action/answer")
|
||||
.xmlFilePayload("/vApp/answerQuestion.xml", VCloudDirectorMediaType.VM_PENDING_ANSWER)
|
||||
|
@ -767,7 +767,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetRuntimeInfoSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/runtimeInfoSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -783,7 +783,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetScreenImage() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/screen")
|
||||
.acceptMedia(VCloudDirectorMediaType.ANY_IMAGE)
|
||||
|
@ -801,7 +801,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetScreenTicket() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", vAppId + "/screen/action/acquireTicket")
|
||||
.acceptAnyMedia()
|
||||
|
@ -817,7 +817,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetStartupSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/startupSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -833,7 +833,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyStartupSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/startupSection")
|
||||
.xmlFilePayload("/vApp/modifyStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
|
||||
|
@ -853,7 +853,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection")
|
||||
.acceptAnyMedia()
|
||||
|
@ -869,7 +869,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSection() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSection.xml", VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION)
|
||||
|
@ -889,7 +889,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionCpu() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/cpu")
|
||||
.acceptAnyMedia()
|
||||
|
@ -905,7 +905,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSectionCpu() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("", vAppId + "/virtualHardwareSection/cpu")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
|
||||
|
@ -925,7 +925,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionDisks() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/disks")
|
||||
.acceptAnyMedia()
|
||||
|
@ -941,7 +941,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSectionDisks() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/disks")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionDisks.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||
|
@ -961,7 +961,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionMedia() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/media")
|
||||
.acceptAnyMedia()
|
||||
|
@ -977,7 +977,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionMemory() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/memory")
|
||||
.acceptAnyMedia()
|
||||
|
@ -993,7 +993,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSectionMemory() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/memory")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.VAPP)
|
||||
|
@ -1013,7 +1013,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionNetworkCards() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/networkCards")
|
||||
.acceptAnyMedia()
|
||||
|
@ -1029,7 +1029,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSectionNetworkCards() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/networkCards")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionNetworkCards.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||
|
@ -1049,7 +1049,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testGetVirtualHardwareSectionSerialPorts() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/serialPorts")
|
||||
.acceptAnyMedia()
|
||||
|
@ -1065,7 +1065,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testModifyVirtualHardwareSectionSerialPorts() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/serialPorts")
|
||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionSerialPorts.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||
|
|
|
@ -65,7 +65,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Task;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.VAppNetworkConfiguration;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -76,7 +76,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
* @author Adam Lowe
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "vapptemplate" }, testName = "VAppTemplateClientExpectTest")
|
||||
public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
public VAppTemplateClientExpectTest() {
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
|
||||
|
|
|
@ -45,7 +45,7 @@ import org.jclouds.vcloud.director.v1_5.domain.VApp;
|
|||
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
|
||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
|
@ -55,7 +55,7 @@ import org.testng.annotations.Test;
|
|||
* @author danikov
|
||||
*/
|
||||
@Test(groups = { "unit", "user", "vdc" }, singleThreaded = true, testName = "VdcClientExpectTest")
|
||||
public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
||||
public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||
|
||||
private URI vdcURI;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test
|
||||
public void testGetVdc() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||
.acceptAnyMedia()
|
||||
|
@ -84,7 +84,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
@Test
|
||||
public void testResponse400ForInvalidVdcId() {
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/vdc/NOTAUUID")
|
||||
.acceptAnyMedia()
|
||||
|
@ -110,7 +110,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
@Test
|
||||
public void testResponse403ForFakeVdcId() {
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||
.acceptAnyMedia()
|
||||
|
@ -135,7 +135,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testCaptureVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||
|
@ -157,7 +157,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testResponse4xxForCaptureVAppNoParams() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||
|
@ -183,7 +183,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testCloneVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_VAPP_PARAMS)
|
||||
|
@ -205,7 +205,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testCloneVAppTemplate() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
|
||||
|
@ -227,7 +227,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testComposeVApp() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
|
||||
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
|
||||
|
@ -249,7 +249,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testInstantiateVAppTemplate() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
|
||||
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||
|
@ -271,7 +271,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
|
||||
@Test(enabled = false)
|
||||
public void testUploadVAppTemplate() {
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
|
||||
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
|
||||
|
@ -295,7 +295,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testCreateMedia() {
|
||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||
|
@ -321,7 +321,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testCloneMedia() {
|
||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||
|
@ -351,7 +351,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetMetadata() {
|
||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
|
||||
.acceptAnyMedia()
|
||||
|
@ -369,7 +369,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
|||
public void testGetMetadataValue() {
|
||||
URI vdcUri = URI.create("https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||
|
||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||
new VcloudHttpRequestPrimer()
|
||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
|
||||
.acceptAnyMedia()
|
||||
|
|
|
@ -77,8 +77,8 @@ import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
|||
import org.jclouds.vcloud.director.v1_5.predicates.ReferencePredicates;
|
||||
import org.jclouds.vcloud.director.v1_5.predicates.TaskStatusEquals;
|
||||
import org.jclouds.vcloud.director.v1_5.predicates.TaskSuccess;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Listeners;
|
||||
|
@ -97,7 +97,7 @@ import com.google.inject.Guice;
|
|||
import com.google.inject.Module;
|
||||
|
||||
/**
|
||||
* Tests behavior of {@link VCloudDirectorUserClient} and acts as parent for other client live tests.
|
||||
* Tests behavior of {@link VCloudDirectorClient} and acts as parent for other client live tests.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
* @author grkvlt@apache.org
|
||||
|
@ -122,7 +122,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
|
|||
public Predicate<Task> retryTaskSuccessLong;
|
||||
|
||||
protected RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext;
|
||||
protected RestContext<VCloudDirectorUserClient, VCloudDirectorUserAsyncClient> context; // FIXME: rename to userContext?
|
||||
protected RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> context; // FIXME: rename to userContext?
|
||||
protected Session adminSession;
|
||||
protected Session session;
|
||||
|
||||
|
@ -166,9 +166,9 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
|
|||
setupCredentials();
|
||||
Properties overrides = setupProperties();
|
||||
|
||||
RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> rootContext =
|
||||
VCloudDirectorContext rootContext = VCloudDirectorContext.class.cast(
|
||||
new RestContextFactory().createContext(provider, identity, credential, ImmutableSet.<Module> of(
|
||||
new Log4JLoggingModule(), new SshjSshClientModule()), overrides);
|
||||
new Log4JLoggingModule(), new SshjSshClientModule()), overrides));
|
||||
|
||||
rootContext.utils().injector().injectMembers(this);
|
||||
Reference orgRef = Iterables.getFirst(rootContext.getApi().getOrgClient().getOrgList().getOrgs(), null)
|
||||
|
@ -177,7 +177,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
|
|||
|
||||
String adminIdentity = "testAdmin"+new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||
String adminCredential = "testAdminPassword";
|
||||
rootContext.getApi().getUserClient().createUser(orgRef.getHref(), User.builder()
|
||||
rootContext.getAdminContext().getApi().getUserClient().createUser(orgRef.getHref(), User.builder()
|
||||
.name(adminIdentity)
|
||||
.password(adminCredential)
|
||||
.description("test user with user-level privileges") //TODO desc
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.jclouds.http.HttpResponse;
|
|||
import org.jclouds.rest.BaseRestClientExpectTest;
|
||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||
import org.testng.annotations.BeforeGroups;
|
||||
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
|
@ -44,7 +44,7 @@ import com.google.inject.Guice;
|
|||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public abstract class BaseVCloudDirectorRestClientExpectTest<T extends VCloudDirectorUserClient>
|
||||
public abstract class BaseVCloudDirectorRestClientExpectTest<T extends VCloudDirectorClient>
|
||||
extends BaseRestClientExpectTest<T> {
|
||||
|
||||
public static final String user = "adrian@jclouds.org";
|
||||
|
|
Loading…
Reference in New Issue