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.rest.RestContextBuilder;
|
||||||
import org.jclouds.vcloud.director.v1_5.config.VCloudDirectorRestClientModule;
|
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;
|
import com.google.inject.Module;
|
||||||
|
|
||||||
|
@ -40,4 +43,9 @@ public class VCloudDirectorContextBuilder extends RestContextBuilder<VCloudDirec
|
||||||
modules.add(new VCloudDirectorRestClientModule());
|
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.AdminVdcAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncClient;
|
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.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.
|
* 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
|
* @see VCloudDirectorAdminClient
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorUserAsyncClient {
|
public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorAsyncClient {
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin query features
|
* @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.AdminVdcClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupClient;
|
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.features.admin.UserClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to VCloudDirector Admin.
|
* Provides synchronous access to VCloudDirector Admin.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorUserAsyncClient
|
* @see VCloudDirectorAsyncClient
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VCloudDirectorAdminClient extends VCloudDirectorUserClient {
|
public interface VCloudDirectorAdminClient extends VCloudDirectorClient {
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin query features
|
* @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
|
* contributor license agreements. See the NOTICE file
|
||||||
* distributed with this work for additional information
|
* distributed with this work for additional information
|
||||||
* regarding copyright ownership. jclouds licenses this file
|
* 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.http.annotation.ServerError;
|
||||||
import org.jclouds.location.Provider;
|
import org.jclouds.location.Provider;
|
||||||
import org.jclouds.rest.ConfiguresRestClient;
|
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.rest.config.RestClientModule;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorAsyncClient;
|
import org.jclouds.rest.internal.RestContextImpl;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
|
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.annotations.Login;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Session;
|
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.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.CatalogAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
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.MediaAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
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.TaskClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient;
|
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.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.VAppAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppClient;
|
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.VAppTemplateAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient;
|
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.VdcAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
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.functions.LoginUserInOrgWithPassword;
|
||||||
import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose;
|
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.handlers.VCloudDirectorErrorHandler;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncClient;
|
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.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.Function;
|
||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
|
@ -93,10 +99,11 @@ import com.google.common.cache.LoadingCache;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
import com.google.inject.TypeLiteral;
|
||||||
import com.google.inject.name.Named;
|
import com.google.inject.name.Named;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures the VCloudDirector connection.
|
* Configures the cloudstack connection.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
|
@ -104,37 +111,61 @@ import com.google.inject.name.Named;
|
||||||
@ConfiguresRestClient
|
@ConfiguresRestClient
|
||||||
public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
||||||
|
|
||||||
public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
public static final Map<Class<?>, Class<?>> USER_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(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(NetworkClient.class, NetworkAsyncClient.class)
|
||||||
.put(OrgClient.class, OrgAsyncClient.class)
|
.put(OrgClient.class, OrgAsyncClient.class)
|
||||||
.put(QueryClient.class, QueryAsyncClient.class)
|
.put(QueryClient.class, QueryAsyncClient.class)
|
||||||
.put(AdminQueryClient.class, AdminQueryAsyncClient.class)
|
|
||||||
.put(MediaClient.class, MediaAsyncClient.class)
|
|
||||||
.put(TaskClient.class, TaskAsyncClient.class)
|
.put(TaskClient.class, TaskAsyncClient.class)
|
||||||
.put(VdcClient.class, VdcAsyncClient.class)
|
.put(UploadClient.class, UploadAsyncClient.class)
|
||||||
.put(VAppClient.class, VAppAsyncClient.class)
|
.put(VAppClient.class, VAppAsyncClient.class)
|
||||||
.put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)
|
.put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)
|
||||||
.put(UploadClient.class, UploadAsyncClient.class)
|
.put(VdcClient.class, VdcAsyncClient.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();
|
.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() {
|
public VCloudDirectorRestClientModule() {
|
||||||
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class, DELEGATE_MAP);
|
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class, ADMIN_DELEGATE_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
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
|
// 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(), OrgClient.class, OrgAsyncClient.class);
|
||||||
|
bindClientAndAsyncClient(binder(), SessionClient.class, SessionAsyncClient.class);
|
||||||
bindClientAndAsyncClient(binder(), TaskClient.class, TaskAsyncClient.class);
|
bindClientAndAsyncClient(binder(), TaskClient.class, TaskAsyncClient.class);
|
||||||
bindClientAndAsyncClient(binder(), VAppClient.class, VAppAsyncClient.class);
|
bindClientAndAsyncClient(binder(), VAppClient.class, VAppAsyncClient.class);
|
||||||
|
|
||||||
|
|
|
@ -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.
|
* Provides asynchronous access to VCloudDirector via their REST API.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorUserClient
|
* @see VCloudDirectorClient
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public interface VCloudDirectorUserAsyncClient {
|
public interface VCloudDirectorAsyncClient {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the current login session
|
* @return the current login session
|
|
@ -52,7 +52,7 @@ import com.google.inject.Provides;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VCloudDirectorUserClient {
|
public interface VCloudDirectorClient {
|
||||||
/**
|
/**
|
||||||
* @return the current login session
|
* @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.internal.BaseVCloudDirectorRestClientExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClientExpectTest;
|
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;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "unit", testName = "VCloudDirectorClient")
|
@Test(groups = "unit", testName = "VCloudDirectorClient")
|
||||||
public class VCloudDirectorClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class VCloudDirectorClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
public void testRestClientModuleWorksProperly() throws Exception {
|
public void testRestClientModuleWorksProperly() throws Exception {
|
||||||
|
|
||||||
VCloudDirectorUserClient clientWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
VCloudDirectorClient clientWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
||||||
|
|
||||||
assertEquals(clientWhenSessionsExist.getCurrentSession(), SessionClientExpectTest.SESSION);
|
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.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
@ -48,13 +48,13 @@ import com.google.common.collect.ImmutableSet;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "media" }, singleThreaded = true, testName = "MediaClientExpectTest")
|
@Test(groups = { "unit", "user", "media" }, singleThreaded = true, testName = "MediaClientExpectTest")
|
||||||
public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateMedia() {
|
public void testCreateMedia() {
|
||||||
URI uploadLink = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media");
|
URI uploadLink = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -80,7 +80,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testCloneMedia() {
|
public void testCloneMedia() {
|
||||||
URI cloneUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -110,7 +110,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testGetMedia() {
|
public void testGetMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -127,7 +127,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testResponse400ForInvalidMedia() {
|
public void testResponse400ForInvalidMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/NOTAUUID");
|
URI mediaUri = URI.create(endpoint + "/media/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/NOTAUUID")
|
.apiCommand("GET", "/media/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -156,7 +156,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testResponse403ForCatalogIdUsedAsMediaId() {
|
public void testResponse403ForCatalogIdUsedAsMediaId() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
.apiCommand("GET", "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -185,7 +185,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testResponse403ForFakeMediaId() {
|
public void testResponse403ForFakeMediaId() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
URI mediaUri = URI.create(endpoint + "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -214,7 +214,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testUpdateMedia() {
|
public void testUpdateMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.xmlFilePayload("/media/updateMedia.xml", VCloudDirectorMediaType.MEDIA)
|
.xmlFilePayload("/media/updateMedia.xml", VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -234,7 +234,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testDeleteMedia() {
|
public void testDeleteMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -252,7 +252,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -271,7 +271,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testMergeMetadata() {
|
public void testMergeMetadata() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
.apiCommand("POST", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||||
.xmlFilePayload("/media/mergeMetadata.xml", VCloudDirectorMediaType.METADATA)
|
.xmlFilePayload("/media/mergeMetadata.xml", VCloudDirectorMediaType.METADATA)
|
||||||
|
@ -290,7 +290,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -309,7 +309,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testSetMetadataValue() {
|
public void testSetMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.xmlFilePayload("/media/setMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
|
.xmlFilePayload("/media/setMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
|
||||||
|
@ -330,7 +330,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testDeleteMetadataValue() {
|
public void testDeleteMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -348,7 +348,7 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
|
||||||
.acceptAnyMedia()
|
.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.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.SyslogServerSettings;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
@ -52,13 +52,13 @@ import com.google.common.collect.ImmutableSet;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "network" }, singleThreaded = true, testName = "NetworkClientExpectTest")
|
@Test(groups = { "unit", "user", "network" }, singleThreaded = true, testName = "NetworkClientExpectTest")
|
||||||
public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNetwork() {
|
public void testGetNetwork() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38");
|
URI networkUri = URI.create(endpoint + "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38")
|
.apiCommand("GET", "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -75,7 +75,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
||||||
public void testGetNetworkWithInvalidId() {
|
public void testGetNetworkWithInvalidId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/NOTAUUID");
|
URI networkUri = URI.create(endpoint + "/network/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/NOTAUUID")
|
.apiCommand("GET", "/network/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -104,7 +104,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
||||||
public void testGetNetworkWithCatalogId() {
|
public void testGetNetworkWithCatalogId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
URI networkUri = URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")
|
.apiCommand("GET", "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -133,7 +133,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
||||||
public void testGetNetworkWithFakeId() {
|
public void testGetNetworkWithFakeId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
URI networkUri = URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -162,7 +162,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
URI networkUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata")
|
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -189,7 +189,7 @@ public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectT
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI networkUri = URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY")
|
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY")
|
||||||
.acceptAnyMedia()
|
.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.OrgList;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
@ -46,11 +46,11 @@ import com.google.common.collect.Iterables;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "org" }, singleThreaded = true, testName = "OrgClientExpectTest")
|
@Test(groups = { "unit", "user", "org" }, singleThreaded = true, testName = "OrgClientExpectTest")
|
||||||
public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgList() {
|
public void testGetOrgList() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/"),
|
getStandardRequest("GET", "/org/"),
|
||||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgFromOrgListReference() {
|
public void testGetOrgFromOrgListReference() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/"),
|
getStandardRequest("GET", "/org/"),
|
||||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrg() {
|
public void testGetOrg() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
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"),
|
getStandardRequest("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"),
|
||||||
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrgFailOnInvalidOrgId() {
|
public void testGetOrgFailOnInvalidOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/NOTAUUID");
|
URI orgUri = URI.create(endpoint + "/org/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/NOTAUUID"),
|
getStandardRequest("GET", "/org/NOTAUUID"),
|
||||||
getStandardPayloadResponse(400, "/org/error400.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(400, "/org/error400.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrgFailOnWrongOrgId() {
|
public void testGetOrgFailOnWrongOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
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"),
|
getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"),
|
||||||
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrgFailOnFakeOrgId() {
|
public void testGetOrgFailOnFakeOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
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"),
|
getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
|
||||||
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrgMetadata() {
|
public void testGetOrgMetadata() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata")
|
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -198,7 +198,7 @@ public class OrgClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetOrgMetadataValue() {
|
public void testGetOrgMetadataValue() {
|
||||||
URI orgUri = URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata/KEY")
|
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata/KEY")
|
||||||
.acceptAnyMedia()
|
.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.QueryResultRecordType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableMultimap;
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "query" }, singleThreaded = true, testName = "QueryClientExpectTest")
|
@Test(groups = { "unit", "user", "query" }, singleThreaded = true, testName = "QueryClientExpectTest")
|
||||||
public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testQueryAllCatalogs() {
|
public void testQueryAllCatalogs() {
|
||||||
|
@ -61,7 +61,7 @@ public class QueryClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||||
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
QueryResultRecords expected = QueryResultRecords.builder()
|
QueryResultRecords expected = QueryResultRecords.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=records"))
|
.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"))
|
.payload(payloadFromResourceWithContentType("/query/allCatalogReferences.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
CatalogReferences expected = CatalogReferences.builder()
|
CatalogReferences expected = CatalogReferences.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=references"))
|
.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.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
@ -43,7 +43,7 @@ import com.google.common.collect.ImmutableMultimap;
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "task" }, singleThreaded = true, testName = "TaskClientExpectTest")
|
@Test(groups = { "unit", "user", "task" }, singleThreaded = true, testName = "TaskClientExpectTest")
|
||||||
public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTaskListForValidOrg() {
|
public void testTaskListForValidOrg() {
|
||||||
|
@ -75,7 +75,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
.payload(payloadFromResourceWithContentType("/org/org.xml", VCloudDirectorMediaType.TASKS_LIST + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/org/org.xml", VCloudDirectorMediaType.TASKS_LIST + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
TasksList expected = TasksList.builder()
|
TasksList expected = TasksList.builder()
|
||||||
.name("Tasks Lists")
|
.name("Tasks Lists")
|
||||||
|
@ -115,7 +115,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
.payload(payloadFromResourceWithContentType("/org/error400.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/org/error400.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
Error expected = Error.builder()
|
Error expected = Error.builder()
|
||||||
.message("validation error on field 'id': String value has invalid format or length")
|
.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"))
|
.payload(payloadFromResourceWithContentType("/org/error403-fake.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
Error expected = Error.builder()
|
Error expected = Error.builder()
|
||||||
.message("No access to entity \"com.vmware.vcloud.entity.org:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\".")
|
.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"))
|
.payload(payloadFromResourceWithContentType("/task/task.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
||||||
.build();
|
.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");
|
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ public class TaskClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
.statusCode(200)
|
.statusCode(200)
|
||||||
.build();
|
.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");
|
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.StartupSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
|
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.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.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import org.testng.internal.annotations.Sets;
|
import org.testng.internal.annotations.Sets;
|
||||||
|
@ -65,7 +65,7 @@ import com.google.common.collect.Multimaps;
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "vapp" }, singleThreaded = true, testName = "VAppClientExpectTest")
|
@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 String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
||||||
private URI vAppURI = URI.create(endpoint + vAppId);
|
private URI vAppURI = URI.create(endpoint + vAppId);
|
||||||
|
@ -76,7 +76,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)//TODO
|
@Test(enabled = false)//TODO
|
||||||
public void testGetVapp() {
|
public void testGetVapp() {
|
||||||
VCloudDirectorUserClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId)
|
.apiCommand("GET", vAppId)
|
||||||
.acceptMedia(VCloudDirectorMediaType.VAPP)
|
.acceptMedia(VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -92,7 +92,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVApp() {
|
public void testModifyVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId)
|
.apiCommand("PUT", vAppId)
|
||||||
.xmlFilePayload("/vApp/modifyVApp.xml", VCloudDirectorMediaType.VAPP)
|
.xmlFilePayload("/vApp/modifyVApp.xml", VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -113,7 +113,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeleteVApp() {
|
public void testDeleteVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", vAppId)
|
.apiCommand("DELETE", vAppId)
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -129,7 +129,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testConsolidateVApp() {
|
public void testConsolidateVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/consolidate")
|
.apiCommand("POST", vAppId + "/action/consolidate")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -145,7 +145,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testControlAccess() {
|
public void testControlAccess() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/controlAccess")
|
.apiCommand("POST", vAppId + "/action/controlAccess")
|
||||||
.xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
|
.xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
|
||||||
|
@ -164,7 +164,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeploy() {
|
public void testDeploy() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/deploy")
|
.apiCommand("POST", vAppId + "/action/deploy")
|
||||||
.xmlFilePayload("/vApp/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
||||||
|
@ -184,7 +184,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDiscardSuspendedState() {
|
public void testDiscardSuspendedState() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/discardSuspendedState")
|
.apiCommand("POST", vAppId + "/action/discardSuspendedState")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -200,7 +200,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testEnterMaintenanceMode() {
|
public void testEnterMaintenanceMode() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
|
.apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -214,7 +214,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testExitMaintenanceMode() {
|
public void testExitMaintenanceMode() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
|
.apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -228,7 +228,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInstallVMwareTools() {
|
public void testInstallVMwareTools() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/installVMwareTools")
|
.apiCommand("POST", vAppId + "/action/installVMwareTools")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -244,7 +244,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testRecomposeVApp() {
|
public void testRecomposeVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/recomposeVApp")
|
.apiCommand("POST", vAppId + "/action/recomposeVApp")
|
||||||
.xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
|
||||||
|
@ -264,7 +264,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testRelocate() {
|
public void testRelocate() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/relocate")
|
.apiCommand("POST", vAppId + "/action/relocate")
|
||||||
.xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
|
.xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
|
||||||
|
@ -284,7 +284,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUndeploy() {
|
public void testUndeploy() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/undeploy")
|
.apiCommand("POST", vAppId + "/action/undeploy")
|
||||||
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
||||||
|
@ -304,7 +304,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpgradeHardwareVersion() {
|
public void testUpgradeHardwareVersion() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/upgradeHardwareVersion")
|
.apiCommand("POST", vAppId + "/action/upgradeHardwareVersion")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -320,7 +320,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOff() {
|
public void testPowerOff() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/powerOff")
|
.apiCommand("POST", vAppId + "/power/action/powerOff")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -336,7 +336,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOn() {
|
public void testPowerOn() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/powerOn")
|
.apiCommand("POST", vAppId + "/power/action/powerOn")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -352,7 +352,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReboot() {
|
public void testReboot() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/reboot")
|
.apiCommand("POST", vAppId + "/power/action/reboot")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -368,7 +368,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReset() {
|
public void testReset() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/reset")
|
.apiCommand("POST", vAppId + "/power/action/reset")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -384,7 +384,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testShutdown() {
|
public void testShutdown() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/shutdown")
|
.apiCommand("POST", vAppId + "/power/action/shutdown")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -400,7 +400,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testSuspend() {
|
public void testSuspend() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/suspend")
|
.apiCommand("POST", vAppId + "/power/action/suspend")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -416,7 +416,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetControlAccesss() {
|
public void testGetControlAccesss() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/controlAccess")
|
.apiCommand("GET", vAppId + "/controlAccess")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -432,7 +432,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetGuestCustomizationSection() {
|
public void testGetGuestCustomizationSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/guestCustomizationSection")
|
.apiCommand("GET", vAppId + "/guestCustomizationSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -448,7 +448,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyGuestCustomizationSection() {
|
public void testModifyGuestCustomizationSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/guestCustomizationSection")
|
.apiCommand("PUT", vAppId + "/guestCustomizationSection")
|
||||||
.xmlFilePayload("/vApp/modifyGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
|
.xmlFilePayload("/vApp/modifyGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
|
||||||
|
@ -468,7 +468,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetLeaseSettingsSection() {
|
public void testGetLeaseSettingsSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/leaseSettingsSection")
|
.apiCommand("GET", vAppId + "/leaseSettingsSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -484,7 +484,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyLeaseSettingsSection() {
|
public void testModifyLeaseSettingsSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/leaseSettingsSection")
|
.apiCommand("PUT", vAppId + "/leaseSettingsSection")
|
||||||
.xmlFilePayload("/vApp/modifyLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
|
.xmlFilePayload("/vApp/modifyLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
|
||||||
|
@ -504,7 +504,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testEjectMedia() {
|
public void testEjectMedia() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/media/action/ejectMedia")
|
.apiCommand("PUT", vAppId + "/media/action/ejectMedia")
|
||||||
.xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
.xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||||
|
@ -524,7 +524,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInsertMedia() {
|
public void testInsertMedia() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/media/action/insertMedia")
|
.apiCommand("PUT", vAppId + "/media/action/insertMedia")
|
||||||
.xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
.xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||||
|
@ -544,7 +544,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkConfigSection() {
|
public void testGetNetworkConfigSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/networkConfigSection")
|
.apiCommand("GET", vAppId + "/networkConfigSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -560,7 +560,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyNetworkConfigSection() {
|
public void testModifyNetworkConfigSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/networkConfigSection")
|
.apiCommand("PUT", vAppId + "/networkConfigSection")
|
||||||
.xmlFilePayload("/vApp/modifyNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
|
.xmlFilePayload("/vApp/modifyNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
|
||||||
|
@ -580,7 +580,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkConnectionSection() {
|
public void testGetNetworkConnectionSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/networkConnectionSection")
|
.apiCommand("GET", vAppId + "/networkConnectionSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -596,7 +596,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyNetworkConnectionSection() {
|
public void testModifyNetworkConnectionSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/networkConnectionSection")
|
.apiCommand("PUT", vAppId + "/networkConnectionSection")
|
||||||
.xmlFilePayload("/vApp/modifyNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
|
.xmlFilePayload("/vApp/modifyNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
|
||||||
|
@ -616,7 +616,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkSection() {
|
public void testGetNetworkSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/networkSection")
|
.apiCommand("GET", vAppId + "/networkSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -632,7 +632,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetOperatingSystemSection() {
|
public void testGetOperatingSystemSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/operatingSystemSection")
|
.apiCommand("GET", vAppId + "/operatingSystemSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -648,7 +648,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyOperatingSystemSection() {
|
public void testModifyOperatingSystemSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/operatingSystemSection")
|
.apiCommand("PUT", vAppId + "/operatingSystemSection")
|
||||||
.xmlFilePayload("/vApp/modifyOperatingSystemSection.xml", VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION)
|
.xmlFilePayload("/vApp/modifyOperatingSystemSection.xml", VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION)
|
||||||
|
@ -668,7 +668,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/owner")
|
.apiCommand("GET", vAppId + "/owner")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -684,7 +684,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyOwner() {
|
public void testModifyOwner() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/owner")
|
.apiCommand("PUT", vAppId + "/owner")
|
||||||
.xmlFilePayload("/vApp/modifyOwner.xml", VCloudDirectorMediaType.OWNER)
|
.xmlFilePayload("/vApp/modifyOwner.xml", VCloudDirectorMediaType.OWNER)
|
||||||
|
@ -701,7 +701,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/productSections")
|
.apiCommand("GET", vAppId + "/productSections")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -717,7 +717,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyProductSections() {
|
public void testModifyProductSections() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/productSections")
|
.apiCommand("PUT", vAppId + "/productSections")
|
||||||
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
||||||
|
@ -734,7 +734,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetPendingQuestion() {
|
public void testGetPendingQuestion() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/question")
|
.apiCommand("GET", vAppId + "/question")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -750,7 +750,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testAnswerQuestion() {
|
public void testAnswerQuestion() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/question/action/answer")
|
.apiCommand("PUT", vAppId + "/question/action/answer")
|
||||||
.xmlFilePayload("/vApp/answerQuestion.xml", VCloudDirectorMediaType.VM_PENDING_ANSWER)
|
.xmlFilePayload("/vApp/answerQuestion.xml", VCloudDirectorMediaType.VM_PENDING_ANSWER)
|
||||||
|
@ -767,7 +767,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetRuntimeInfoSection() {
|
public void testGetRuntimeInfoSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/runtimeInfoSection")
|
.apiCommand("GET", vAppId + "/runtimeInfoSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -783,7 +783,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetScreenImage() {
|
public void testGetScreenImage() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/screen")
|
.apiCommand("GET", vAppId + "/screen")
|
||||||
.acceptMedia(VCloudDirectorMediaType.ANY_IMAGE)
|
.acceptMedia(VCloudDirectorMediaType.ANY_IMAGE)
|
||||||
|
@ -801,7 +801,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetScreenTicket() {
|
public void testGetScreenTicket() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/screen/action/acquireTicket")
|
.apiCommand("POST", vAppId + "/screen/action/acquireTicket")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -817,7 +817,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetStartupSection() {
|
public void testGetStartupSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/startupSection")
|
.apiCommand("GET", vAppId + "/startupSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -833,7 +833,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyStartupSection() {
|
public void testModifyStartupSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/startupSection")
|
.apiCommand("PUT", vAppId + "/startupSection")
|
||||||
.xmlFilePayload("/vApp/modifyStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
|
.xmlFilePayload("/vApp/modifyStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
|
||||||
|
@ -853,7 +853,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSection() {
|
public void testGetVirtualHardwareSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -869,7 +869,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSection() {
|
public void testModifyVirtualHardwareSection() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection")
|
.apiCommand("PUT", vAppId + "/virtualHardwareSection")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSection.xml", VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSection.xml", VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION)
|
||||||
|
@ -889,7 +889,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionCpu() {
|
public void testGetVirtualHardwareSectionCpu() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/cpu")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/cpu")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -905,7 +905,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionCpu() {
|
public void testModifyVirtualHardwareSectionCpu() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("", vAppId + "/virtualHardwareSection/cpu")
|
.apiCommand("", vAppId + "/virtualHardwareSection/cpu")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
|
||||||
|
@ -925,7 +925,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionDisks() {
|
public void testGetVirtualHardwareSectionDisks() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/disks")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/disks")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -941,7 +941,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionDisks() {
|
public void testModifyVirtualHardwareSectionDisks() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/disks")
|
.apiCommand("PUT", vAppId + "/virtualHardwareSection/disks")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionDisks.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionDisks.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||||
|
@ -961,7 +961,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionMedia() {
|
public void testGetVirtualHardwareSectionMedia() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/media")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/media")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -977,7 +977,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionMemory() {
|
public void testGetVirtualHardwareSectionMemory() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/memory")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/memory")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -993,7 +993,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionMemory() {
|
public void testModifyVirtualHardwareSectionMemory() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/memory")
|
.apiCommand("PUT", vAppId + "/virtualHardwareSection/memory")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.VAPP)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -1013,7 +1013,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionNetworkCards() {
|
public void testGetVirtualHardwareSectionNetworkCards() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/networkCards")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/networkCards")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -1029,7 +1029,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionNetworkCards() {
|
public void testModifyVirtualHardwareSectionNetworkCards() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/networkCards")
|
.apiCommand("PUT", vAppId + "/virtualHardwareSection/networkCards")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionNetworkCards.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionNetworkCards.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||||
|
@ -1049,7 +1049,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionSerialPorts() {
|
public void testGetVirtualHardwareSectionSerialPorts() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/virtualHardwareSection/serialPorts")
|
.apiCommand("GET", vAppId + "/virtualHardwareSection/serialPorts")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -1065,7 +1065,7 @@ public class VAppClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionSerialPorts() {
|
public void testModifyVirtualHardwareSectionSerialPorts() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/virtualHardwareSection/serialPorts")
|
.apiCommand("PUT", vAppId + "/virtualHardwareSection/serialPorts")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionSerialPorts.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.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.VAppNetworkConfiguration;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
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.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 org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
@ -76,7 +76,7 @@ import com.google.common.collect.ImmutableSet;
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "vapptemplate" }, testName = "VAppTemplateClientExpectTest")
|
@Test(groups = { "unit", "user", "vapptemplate" }, testName = "VAppTemplateClientExpectTest")
|
||||||
public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class VAppTemplateClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
public VAppTemplateClientExpectTest() {
|
public VAppTemplateClientExpectTest() {
|
||||||
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
|
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.VAppTemplate;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
|
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.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.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ import org.testng.annotations.Test;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user", "vdc" }, singleThreaded = true, testName = "VdcClientExpectTest")
|
@Test(groups = { "unit", "user", "vdc" }, singleThreaded = true, testName = "VdcClientExpectTest")
|
||||||
public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorUserClient> {
|
public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<VCloudDirectorClient> {
|
||||||
|
|
||||||
private URI vdcURI;
|
private URI vdcURI;
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetVdc() {
|
public void testGetVdc() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -84,7 +84,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
@Test
|
@Test
|
||||||
public void testResponse400ForInvalidVdcId() {
|
public void testResponse400ForInvalidVdcId() {
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/NOTAUUID")
|
.apiCommand("GET", "/vdc/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -110,7 +110,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
@Test
|
@Test
|
||||||
public void testResponse403ForFakeVdcId() {
|
public void testResponse403ForFakeVdcId() {
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -135,7 +135,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCaptureVApp() {
|
public void testCaptureVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -157,7 +157,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testResponse4xxForCaptureVAppNoParams() {
|
public void testResponse4xxForCaptureVAppNoParams() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -183,7 +183,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCloneVApp() {
|
public void testCloneVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_VAPP_PARAMS)
|
||||||
|
@ -205,7 +205,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCloneVAppTemplate() {
|
public void testCloneVAppTemplate() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
|
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
|
||||||
|
@ -227,7 +227,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testComposeVApp() {
|
public void testComposeVApp() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
|
||||||
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
|
||||||
|
@ -249,7 +249,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInstantiateVAppTemplate() {
|
public void testInstantiateVAppTemplate() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -271,7 +271,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUploadVAppTemplate() {
|
public void testUploadVAppTemplate() {
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
|
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
|
||||||
|
@ -295,7 +295,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testCreateMedia() {
|
public void testCreateMedia() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -321,7 +321,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testCloneMedia() {
|
public void testCloneMedia() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -351,7 +351,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorUserClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -369,7 +369,7 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest<
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI vdcUri = URI.create("https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
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()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
|
||||||
.acceptAnyMedia()
|
.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.ReferencePredicates;
|
||||||
import org.jclouds.vcloud.director.v1_5.predicates.TaskStatusEquals;
|
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.predicates.TaskSuccess;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorUserClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Listeners;
|
import org.testng.annotations.Listeners;
|
||||||
|
@ -97,7 +97,7 @@ import com.google.inject.Guice;
|
||||||
import com.google.inject.Module;
|
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 Adrian Cole
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
|
@ -122,7 +122,7 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
|
||||||
public Predicate<Task> retryTaskSuccessLong;
|
public Predicate<Task> retryTaskSuccessLong;
|
||||||
|
|
||||||
protected RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext;
|
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 adminSession;
|
||||||
protected Session session;
|
protected Session session;
|
||||||
|
|
||||||
|
@ -166,9 +166,9 @@ public abstract class BaseVCloudDirectorClientLiveTest extends BaseVersionedServ
|
||||||
setupCredentials();
|
setupCredentials();
|
||||||
Properties overrides = setupProperties();
|
Properties overrides = setupProperties();
|
||||||
|
|
||||||
RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> rootContext =
|
VCloudDirectorContext rootContext = VCloudDirectorContext.class.cast(
|
||||||
new RestContextFactory().createContext(provider, identity, credential, ImmutableSet.<Module> of(
|
new RestContextFactory().createContext(provider, identity, credential, ImmutableSet.<Module> of(
|
||||||
new Log4JLoggingModule(), new SshjSshClientModule()), overrides);
|
new Log4JLoggingModule(), new SshjSshClientModule()), overrides));
|
||||||
|
|
||||||
rootContext.utils().injector().injectMembers(this);
|
rootContext.utils().injector().injectMembers(this);
|
||||||
Reference orgRef = Iterables.getFirst(rootContext.getApi().getOrgClient().getOrgList().getOrgs(), null)
|
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 adminIdentity = "testAdmin"+new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
||||||
String adminCredential = "testAdminPassword";
|
String adminCredential = "testAdminPassword";
|
||||||
rootContext.getApi().getUserClient().createUser(orgRef.getHref(), User.builder()
|
rootContext.getAdminContext().getApi().getUserClient().createUser(orgRef.getHref(), User.builder()
|
||||||
.name(adminIdentity)
|
.name(adminIdentity)
|
||||||
.password(adminCredential)
|
.password(adminCredential)
|
||||||
.description("test user with user-level privileges") //TODO desc
|
.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.rest.BaseRestClientExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
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 org.testng.annotations.BeforeGroups;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
@ -44,7 +44,7 @@ import com.google.inject.Guice;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public abstract class BaseVCloudDirectorRestClientExpectTest<T extends VCloudDirectorUserClient>
|
public abstract class BaseVCloudDirectorRestClientExpectTest<T extends VCloudDirectorClient>
|
||||||
extends BaseRestClientExpectTest<T> {
|
extends BaseRestClientExpectTest<T> {
|
||||||
|
|
||||||
public static final String user = "adrian@jclouds.org";
|
public static final String user = "adrian@jclouds.org";
|
||||||
|
|
Loading…
Reference in New Issue