Merge pull request #269 from grkvlt/master

Some small changes for vcloud (greenhousedata) tests
This commit is contained in:
Adrian Cole 2011-12-20 10:55:32 -08:00
commit 766b0ab5ba
4 changed files with 7 additions and 40 deletions

View File

@ -160,6 +160,7 @@ public interface VAppTemplateAsyncClient {
* @see VAppTemplateClient#deleteVAppTemplate * @see VAppTemplateClient#deleteVAppTemplate
*/ */
@DELETE @DELETE
@Consumes(TASK_XML)
@ExceptionParser(ReturnVoidOnNotFoundOr404.class) @ExceptionParser(ReturnVoidOnNotFoundOr404.class)
@XMLResponseParser(TaskHandler.class) @XMLResponseParser(TaskHandler.class)
ListenableFuture<? extends Task> deleteVAppTemplate(@EndpointParam URI href); ListenableFuture<? extends Task> deleteVAppTemplate(@EndpointParam URI href);

View File

@ -49,7 +49,6 @@ import com.google.common.collect.ImmutableMap;
*/ */
@Test(groups = "live", enabled = true, singleThreaded = true, testName = "VAppTemplateClientLiveTest") @Test(groups = "live", enabled = true, singleThreaded = true, testName = "VAppTemplateClientLiveTest")
public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest { public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest {
@Test @Test
public void testGetVAppTemplate() throws Exception { public void testGetVAppTemplate() throws Exception {
Org org = getVCloudApi().getOrgClient().findOrgNamed(null); Org org = getVCloudApi().getOrgClient().findOrgNamed(null);
@ -60,8 +59,9 @@ public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest {
CatalogItem item = getVCloudApi().getCatalogClient().getCatalogItem(resource.getHref()); CatalogItem item = getVCloudApi().getCatalogClient().getCatalogItem(resource.getHref());
if (item.getEntity().getType().equals(VCloudMediaType.VAPPTEMPLATE_XML)) { if (item.getEntity().getType().equals(VCloudMediaType.VAPPTEMPLATE_XML)) {
VAppTemplate template = getVCloudApi().getVAppTemplateClient().getVAppTemplate(item.getEntity().getHref()); VAppTemplate template = getVCloudApi().getVAppTemplateClient().getVAppTemplate(item.getEntity().getHref());
if (template != null){ if (template != null) {
assertEquals(template.getName(),item.getEntity().getName()); // the UUID in the href is the only way to actually link templates
assertEquals(template.getHref(), item.getEntity().getHref());
} else { } else {
// null can be no longer available or auth exception // null can be no longer available or auth exception
} }
@ -100,7 +100,8 @@ public class VAppTemplateClientLiveTest extends BaseVCloudClientLiveTest {
VAppTemplate template = getVCloudApi().getVAppTemplateClient().findVAppTemplateInOrgCatalogNamed( VAppTemplate template = getVCloudApi().getVAppTemplateClient().findVAppTemplateInOrgCatalogNamed(
org.getName(), response.getName(), item.getEntity().getName()); org.getName(), response.getName(), item.getEntity().getName());
if (template != null) { if (template != null) {
assertEquals(template.getName(), item.getEntity().getName()); // the UUID in the href is the only way to actually link templates
assertEquals(template.getHref(), item.getEntity().getHref());
} else { } else {
// null can be no longer available or auth exception // null can be no longer available or auth exception
} }

View File

@ -28,13 +28,13 @@ import static org.jclouds.location.predicates.LocationPredicates.isZoneOrRegionW
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Set; import java.util.Set;
import javax.annotation.Nullable;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.jclouds.collect.Memoized; import org.jclouds.collect.Memoized;
import org.jclouds.domain.Location; import org.jclouds.domain.Location;
import org.jclouds.domain.LocationScope; import org.jclouds.domain.LocationScope;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.location.Region; import org.jclouds.location.Region;
import org.jclouds.location.functions.ToIdAndScope; import org.jclouds.location.functions.ToIdAndScope;

View File

@ -1,35 +0,0 @@
/**
* 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.greenhousedata.element.vcloud;
import org.jclouds.vcloud.DeprecatedVCloudClientLiveTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Deprecated
@Test(groups = "live", singleThreaded = true, testName = "DeprecatedGreenHouseDataElementVCloudClientLiveTest")
public class DeprecatedGreenHouseDataElementVCloudClientLiveTest extends DeprecatedVCloudClientLiveTest {
public DeprecatedGreenHouseDataElementVCloudClientLiveTest() {
provider = "greenhousedata-element-vcloud";
}
}