Merge pull request #521 from grkvlt/vcloud

Issue 830: Updates to vCloud Director
This commit is contained in:
Adrian Cole 2012-03-27 08:10:21 -07:00
commit 37ad4938df
88 changed files with 731 additions and 2036 deletions

View File

@ -18,15 +18,12 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**

View File

@ -1,122 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Preconditions.*;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
/**
* A list of access settings for a resource.
*
* <pre>
* &lt;complexType name="AccessSettings" /&gt;
* </pre>
*
* @since 0.9
*/
@XmlRootElement(name = "AccessSettings")
@XmlType(name = "AccessSettingsType")
public class AccessSettings {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromAccessSettings(this);
}
public static class Builder {
private List<AccessSetting> accessSettings = Lists.newArrayList();
/**
* @see AccessSettings#getAccessSettings()
*/
public Builder accessSettings(List<AccessSetting> accessSettings) {
this.accessSettings = checkNotNull(accessSettings, "accessSettings");
return this;
}
/**
* @see AccessSettings#getAccessSettings()
*/
public Builder accessSetting(AccessSetting accessSetting) {
this.accessSettings.add(checkNotNull(accessSetting, "accessSetting"));
return this;
}
public AccessSettings build() {
return new AccessSettings(accessSettings);
}
public Builder fromAccessSettings(AccessSettings in) {
return accessSettings(in.getAccessSettings());
}
}
protected AccessSettings() {
// For JAXB and builder use
}
public AccessSettings(List<AccessSetting> accessSettings) {
this.accessSettings = accessSettings;
}
@XmlElement(name = "AccessSetting", required = true)
protected List<AccessSetting> accessSettings = Lists.newArrayList();
/**
* Gets the value of the accessSetting property.
*/
public List<AccessSetting> getAccessSettings() {
return accessSettings;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
AccessSettings that = AccessSettings.class.cast(o);
return equal(this.accessSettings, that.accessSettings);
}
@Override
public int hashCode() {
return Objects.hashCode(accessSettings);
}
@Override
public String toString() {
return Objects.toStringHelper("").add("accessSettings", accessSettings).toString();
}
}

View File

@ -45,6 +45,7 @@ public class AdminCatalog extends CatalogType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromAdminCatalog(this);
}
@ -54,6 +55,7 @@ public class AdminCatalog extends CatalogType {
public static abstract class Builder<B extends Builder<B>> extends CatalogType.Builder<B> {
@Override
public AdminCatalog build() {
return new AdminCatalog(this);
}

View File

@ -19,15 +19,19 @@
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* The AdminOrg represents an administrative view of an organization.
@ -67,6 +71,7 @@ public class AdminOrg extends Org {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromAdminOrg(this);
}
@ -77,11 +82,11 @@ public class AdminOrg extends Org {
public static abstract class Builder<B extends Builder<B>> extends Org.Builder<B> {
private OrgSettings settings;
private UsersList users;
private GroupsList groups;
private CatalogsList catalogs;
private Vdcs vdcs;
private Networks networks;
private Set<Reference> users = Sets.newLinkedHashSet();
private Set<Reference> groups = Sets.newLinkedHashSet();
private Set<Reference> catalogs = Sets.newLinkedHashSet();
private Set<Reference> vdcs = Sets.newLinkedHashSet();
private Set<Reference> networks = Sets.newLinkedHashSet();
/**
* @see AdminOrg#getSettings()
@ -94,43 +99,82 @@ public class AdminOrg extends Org {
/**
* @see AdminOrg#getUsers()
*/
public B users(UsersList users) {
this.users = users;
public B users(Iterable<Reference> users) {
this.users = Sets.newLinkedHashSet(checkNotNull(users, "users"));
return self();
}
/**
* @see AdminOrg#getUsers()
*/
public B user(Reference user) {
users.add(checkNotNull(user, "user"));
return self();
}
/**
* @see AdminOrg#getGroups()
*/
public B groups(GroupsList groups) {
this.groups = groups;
public B groups(Iterable<Reference> groups) {
this.groups = Sets.newLinkedHashSet(checkNotNull(groups, "groups"));
return self();
}
/**
* @see AdminOrg#getGroups()
*/
public B group(Reference group) {
groups.add(checkNotNull(group, "group"));
return self();
}
/**
* @see AdminOrg#getCatalogs()
*/
public B catalogs(Iterable<Reference> catalogReferences) {
this.catalogs = Sets.newLinkedHashSet(checkNotNull(catalogs, "catalogs"));
return self();
}
/**
* @see AdminOrg#getCatalogs()
*/
public B catalogs(CatalogsList catalogs) {
this.catalogs = catalogs;
public B catalog(Reference catalog) {
this.catalogs.add(checkNotNull(catalog, "catalog"));
return self();
}
/**
* @see AdminOrg#getVdcs()
*/
public B vdcs(Iterable<Reference> vdcs) {
this.vdcs = Sets.newLinkedHashSet(checkNotNull(vdcs, "vdcs"));
return self();
}
/**
* @see AdminOrg#getVdcs()
*/
public B vdcs(Vdcs vdcs) {
this.vdcs = vdcs;
public B vdc(Reference vdc) {
this.vdcs.add(checkNotNull(vdc, "vdc"));
return self();
}
/**
* @see AdminOrg#getNetworks()
*/
public B networks(Networks networks) {
this.networks = networks;
public B networks(Iterable<Reference> networks) {
this.networks = Sets.newLinkedHashSet(checkNotNull(networks, "networks"));
return self();
}
/**
* @see AdminOrg#getNetworks()
*/
public B network(Reference network) {
this.networks.add(checkNotNull(network, "network"));
return self();
}
@Override
public AdminOrg build() {
return new AdminOrg(this);
}
@ -153,33 +197,33 @@ public class AdminOrg extends Org {
protected AdminOrg(Builder<?> builder) {
super(builder);
this.settings = builder.settings;
this.users = builder.users;
this.groups = builder.groups;
this.catalogs = builder.catalogs;
this.vdcs = builder.vdcs;
this.networks = builder.networks;
this.users = builder.users == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.users);
this.groups = builder.groups == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.groups);
this.catalogs = builder.catalogs == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.catalogs);
this.vdcs = builder.vdcs == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.vdcs);
this.networks = builder.networks == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.networks);
}
@XmlElement(name = "Settings", required = true)
private OrgSettings settings;
@XmlElement(name = "Users")
private UsersList users;
@XmlElement(name = "Groups")
private GroupsList groups;
@XmlElement(name = "Catalogs")
private CatalogsList catalogs;
@XmlElement(name = "Vdcs")
private Vdcs vdcs;
@XmlElement(name = "Networks")
private Networks networks;
@XmlElementWrapper(name = "Users")
@XmlElement(name = "UserReference")
protected Set<Reference> users = Sets.newLinkedHashSet();
@XmlElementWrapper(name = "Groups")
@XmlElement(name = "GroupReference")
protected Set<Reference> groups = Sets.newLinkedHashSet();
@XmlElementWrapper(name = "Catalogs")
@XmlElement(name = "CatalogReference")
private Set<Reference> catalogs = Sets.newLinkedHashSet();
@XmlElementWrapper(name = "Vdcs")
@XmlElement(name = "Vdc")
protected Set<Reference> vdcs = Sets.newLinkedHashSet();
@XmlElementWrapper(name = "Networks")
@XmlElement(name = "Network")
protected Set<Reference> networks = Sets.newLinkedHashSet();
/**
* Gets the value of the settings property.
*
* @return
* possible object is
* {@link OrgSettings }
*
*/
public OrgSettings getSettings() {
return settings;
@ -187,61 +231,36 @@ public class AdminOrg extends Org {
/**
* Gets the value of the users property.
*
* @return
* possible object is
* {@link UsersList }
*
*/
public UsersList getUsers() {
public Set<Reference> getUsers() {
return users;
}
/**
* Gets the value of the groups property.
*
* @return
* possible object is
* {@link GroupsList }
*
*/
public GroupsList getGroups() {
public Set<Reference> getGroups() {
return groups;
}
/**
* Gets the value of the catalogs property.
*
* @return
* possible object is
* {@link CatalogsList }
*
*/
public CatalogsList getCatalogs() {
public Set<Reference> getCatalogs() {
return catalogs;
}
/**
* Gets the value of the vdcs property.
*
* @return
* possible object is
* {@link Vdcs }
*
*/
public Vdcs getVdcs() {
public Set<Reference> getVdcs() {
return vdcs;
}
/**
* Gets the value of the networks property.
*
* @return
* possible object is
* {@link Networks }
*
*/
public Networks getNetworks() {
public Set<Reference> getNetworks() {
return networks;
}

View File

@ -31,14 +31,7 @@ import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
@ -73,10 +66,12 @@ import com.google.common.collect.Sets;
})
@XmlRootElement(name = "CaptureVAppParams")
public class CaptureVAppParams extends ParamsType {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromCaptureVAppParams(this);
}
@ -87,7 +82,7 @@ public class CaptureVAppParams extends ParamsType {
public static abstract class Builder<B extends Builder<B>> extends ParamsType.Builder<B> {
private Reference source;
private Set<? extends SectionType> sections = ImmutableSet.of();
private Set<? extends SectionType> sections = Sets.newLinkedHashSet();
/**
* @see CaptureVAppParams#getSource()

View File

@ -1,130 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Represents a list of catalog item references.
* <p/>
* <pre>
* &lt;complexType name="CatalogItemsType" /&gt;
* </pre>
*
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "CatalogItems")
public class CatalogItems {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder();
}
public static class Builder {
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
/**
* @see CatalogItems#getCatalogItems()
*/
public Builder items(Collection<Reference> catalogItems) {
this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems"));
return this;
}
/**
* @see CatalogItems#getCatalogItems()
*/
public Builder item(Reference catalogItem) {
this.catalogItems.add(checkNotNull(catalogItem, "catalogItem"));
return this;
}
public CatalogItems build() {
return new CatalogItems(catalogItems);
}
public Builder fromCatalogItems(CatalogItems in) {
return items(in.getCatalogItems());
}
}
private CatalogItems() {
// For JAXB
}
private CatalogItems(Set<Reference> catalogItems) {
this.catalogItems = ImmutableSet.copyOf(catalogItems);
}
@XmlElement(name = "CatalogItem")
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
/**
* Gets the value of the catalogItems property.
*/
public Set<Reference> getCatalogItems() {
return Collections.unmodifiableSet(this.catalogItems);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CatalogItems that = CatalogItems.class.cast(o);
return equal(this.catalogItems, that.catalogItems);
}
@Override
public int hashCode() {
return Objects.hashCode(catalogItems);
}
@Override
public String toString() {
return string().toString();
}
protected ToStringHelper string() {
return Objects.toStringHelper("").add("catalogItems", catalogItems);
}
}

View File

@ -19,16 +19,22 @@
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Container for references to VappTemplate and Media objects.
* <p/>
*
* <pre>
* &lt;complexType name="CatalogType" /&gt;
* </pre>
@ -42,6 +48,7 @@ public class CatalogType extends EntityType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromCatalogType(this);
}
@ -52,7 +59,7 @@ public class CatalogType extends EntityType {
public static class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
private Owner owner;
private CatalogItems catalogItems;
private Set<Reference> catalogItems = Sets.newLinkedHashSet();
private Boolean isPublished;
/**
@ -64,10 +71,18 @@ public class CatalogType extends EntityType {
}
/**
* @see CatalogType#getCatalogItems()
* @see CatalogItems#getCatalogItems()
*/
public B catalogItems(CatalogItems catalogItems) {
this.catalogItems = catalogItems;
public B items(Iterable<Reference> catalogItems) {
this.catalogItems = Sets.newLinkedHashSet(checkNotNull(catalogItems, "catalogItems"));
return self();
}
/**
* @see CatalogItems#getCatalogItems()
*/
public B item(Reference catalogItem) {
this.catalogItems.add(checkNotNull(catalogItem, "catalogItem"));
return self();
}
@ -93,14 +108,14 @@ public class CatalogType extends EntityType {
}
public B fromCatalogType(CatalogType in) {
return fromEntityType(in).owner(in.getOwner()).catalogItems(in.getCatalogItems()).isPublished(in.isPublished());
return fromEntityType(in).owner(in.getOwner()).items(in.getCatalogItems()).isPublished(in.isPublished());
}
}
protected CatalogType(Builder<?> builder) {
super(builder);
this.owner = builder.owner;
this.catalogItems = builder.catalogItems;
this.catalogItems = builder.catalogItems == null || builder.catalogItems.isEmpty() ? null : ImmutableSet.copyOf(builder.catalogItems);
this.isPublished = builder.isPublished;
}
@ -110,8 +125,9 @@ public class CatalogType extends EntityType {
@XmlElement(name = "Owner")
private Owner owner;
@XmlElement(name = "CatalogItems")
private CatalogItems catalogItems;
@XmlElementWrapper(name = "CatalogItems")
@XmlElement(name = "CatalogItem")
private Set<Reference> catalogItems;
@XmlElement(name = "IsPublished")
private Boolean isPublished;
@ -125,8 +141,8 @@ public class CatalogType extends EntityType {
/**
* Gets the value of the catalogItems property.
*/
public CatalogItems getCatalogItems() {
return catalogItems;
public Set<Reference> getCatalogItems() {
return catalogItems == null ? ImmutableSet.<Reference>of() : ImmutableSet.copyOf(catalogItems);
}
/**
@ -145,19 +161,19 @@ public class CatalogType extends EntityType {
CatalogType that = CatalogType.class.cast(o);
return super.equals(that) &&
equal(this.owner, that.owner) &&
equal(this.catalogItems, that.catalogItems) &&
equal(this.getCatalogItems(), that.getCatalogItems()) &&
equal(this.isPublished, that.isPublished);
}
@Override
public int hashCode() {
return Objects.hashCode(super.hashCode(), owner, catalogItems, catalogItems);
return Objects.hashCode(super.hashCode(), owner, getCatalogItems(), catalogItems);
}
@Override
public ToStringHelper string() {
return super.string().add("owner", owner)
.add("catalogItems", catalogItems)
.add("catalogItems", getCatalogItems())
.add("isPublished", isPublished);
}

View File

@ -1,129 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Container for ReferenceType elements that reference catalogs.
* <p/>
* <pre>
* &lt;complexType name="CatalogsListType" /&gt;
* </pre>
*
* @author grkvlt@apache.org
*/
@XmlRootElement(name = "CatalogsList")
public class CatalogsList {
public static final String MEDIA_TYPE = VCloudDirectorMediaType.CATALOG_ITEMS;
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder();
}
public static class Builder {
private Set<Reference> catalogReferences = Sets.newLinkedHashSet();
/**
* @see CatalogsList#getCatalogItems()
*/
public Builder catalogs(Set<Reference> catalogReferences) {
this.catalogReferences = checkNotNull(catalogReferences, "catalogReferences");
return this;
}
/**
* @see CatalogsList#getCatalogItems()
*/
public Builder catalog(Reference catalog) {
this.catalogReferences.add(checkNotNull(catalog, "catalog"));
return this;
}
public CatalogsList build() {
return new CatalogsList(catalogReferences);
}
public Builder fromCatalogsList(CatalogsList in) {
return catalogs(in.getCatalogItems());
}
}
private CatalogsList() {
// for JAXB
}
private CatalogsList(Set<Reference> catalogReferences) {
this.catalogReferences = ImmutableSet.copyOf(checkNotNull(catalogReferences, "catalogReferences"));
}
@XmlElement(name = "CatalogReference")
private Set<Reference> catalogReferences = Sets.newLinkedHashSet();
/**
* Gets the value of the catalogReferences property.
*/
public Set<Reference> getCatalogItems() {
return Collections.unmodifiableSet(this.catalogReferences);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CatalogsList that = CatalogsList.class.cast(o);
return equal(this.catalogReferences, that.catalogReferences);
}
@Override
public int hashCode() {
return Objects.hashCode(catalogReferences);
}
@Override
public String toString() {
return string().toString();
}
protected ToStringHelper string() {
return Objects.toStringHelper("").add("catalogReferences", catalogReferences);
}
}

View File

@ -18,15 +18,19 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* Used to control access to resources.
@ -53,7 +57,7 @@ public class ControlAccessParams {
private Boolean sharedToEveryone = Boolean.FALSE;
private String everyoneAccessLevel;
private AccessSettings accessSettings;
private Set<AccessSetting> accessSettings = Sets.newLinkedHashSet();
/**
* @see ControlAccessParams#getIsSharedToEveryone()
@ -90,8 +94,16 @@ public class ControlAccessParams {
/**
* @see ControlAccessParams#getAccessSettings()
*/
public Builder accessSettings(AccessSettings accessSettings) {
this.accessSettings = accessSettings;
public Builder accessSettings(Iterable<AccessSetting> accessSettings) {
this.accessSettings = Sets.newLinkedHashSet(checkNotNull(accessSettings, "accessSettings"));
return this;
}
/**
* @see ControlAccessParams#getAccessSettings()
*/
public Builder accessSetting(AccessSetting accessSetting) {
this.accessSettings.add(checkNotNull(accessSetting, "accessSetting"));
return this;
}
@ -109,18 +121,19 @@ public class ControlAccessParams {
// For JAXB and builder use
}
public ControlAccessParams(Boolean sharedToEveryone, String everyoneAccessLevel, AccessSettings accessSettings) {
public ControlAccessParams(Boolean sharedToEveryone, String everyoneAccessLevel, Iterable<AccessSetting> accessSettings) {
this.sharedToEveryone = sharedToEveryone;
this.everyoneAccessLevel = everyoneAccessLevel;
this.accessSettings = accessSettings;
this.accessSettings = accessSettings == null ? Sets.<AccessSetting>newLinkedHashSet() : ImmutableSet.copyOf(accessSettings);
}
@XmlElement(name = "IsSharedToEveryone", required = true)
protected Boolean sharedToEveryone;
@XmlElement(name = "EveryoneAccessLevel")
protected String everyoneAccessLevel;
@XmlElement(name = "AccessSettings")
protected AccessSettings accessSettings;
@XmlElementWrapper(name = "AccessSettings")
@XmlElement(name = "AccessSetting")
protected Set<AccessSetting> accessSettings = Sets.newLinkedHashSet();
/**
* If true, this means that the resource is shared with everyone in the organization.
@ -143,7 +156,7 @@ public class ControlAccessParams {
*
* Required on create and modify if {@link #isSharedToEveryone()} is false.
*/
public AccessSettings getAccessSettings() {
public Set<AccessSetting> getAccessSettings() {
return accessSettings;
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
@ -24,24 +23,15 @@ import static com.google.common.base.Objects.equal;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Used when OrgLdapMode=CUSTOM to define connection details for
* the organization's LDAP service.
*
*
* <p>Java class for CustomOrgLdapSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Used when OrgLdapMode=CUSTOM to define connection details for
* the organization's LDAP service.
*
* <pre>
* &lt;complexType name="CustomOrgLdapSettings">
@ -68,10 +58,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomOrgLdapSettings", propOrder = {
"hostName",
"port",

View File

@ -18,10 +18,8 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

View File

@ -19,8 +19,8 @@
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlAttribute;
@ -52,6 +52,7 @@ public class EntityType extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromEntityType(this);
}
@ -62,7 +63,7 @@ public class EntityType extends ResourceType {
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
private String description;
private Set<Task> tasks;
private Set<Task> tasks = Sets.newLinkedHashSet();
private String name;
private String id;
@ -93,8 +94,16 @@ public class EntityType extends ResourceType {
/**
* @see EntityType#getTasks()
*/
public B tasks(Set<Task> tasks) {
this.tasks = tasks;
public B tasks(Iterable<Task> tasks) {
this.tasks = Sets.newLinkedHashSet(checkNotNull(tasks, "tasks"));
return self();
}
/**
* @see EntityType#getTasks()
*/
public B task(Task task) {
this.tasks.add(checkNotNull(task, "task"));
return self();
}
@ -105,7 +114,7 @@ public class EntityType extends ResourceType {
public B fromEntityType(EntityType in) {
return fromResourceType(in)
.description(in.getDescription()).tasks(Sets.newLinkedHashSet(in.getTasks()))
.description(in.getDescription()).tasks(in.getTasks())
.id(in.getId()).name(in.getName());
}
}
@ -123,7 +132,6 @@ public class EntityType extends ResourceType {
protected EntityType(Builder<?> builder) {
super(builder);
this.description = builder.description;
// nullable so that jaxb wont persist empty collections
this.tasks = builder.tasks == null || builder.tasks.isEmpty() ? null : ImmutableSet.copyOf(builder.tasks);
this.id = builder.id;
this.name = builder.name;

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,29 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Admin representation of external network.
*
*
* <p>Java class for ExternalNetwork complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Admin representation of external network.
*
* <pre>
* &lt;complexType name="ExternalNetwork">
@ -52,10 +41,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "ExternalNetwork")
@XmlType(propOrder = {
"providerInfo"
@ -65,6 +51,7 @@ public class ExternalNetwork extends Network {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return new ConcreteBuilder().fromExternalNetwork(this);
}
@ -80,6 +67,7 @@ public class ExternalNetwork extends Network {
return self();
}
@Override
public ExternalNetwork build() {
return new ExternalNetwork(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,28 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
*
* Represents group in the system.
*
*
* <p>Java class for Group complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Represents group in the system.
*
* <pre>
* &lt;complexType name="Group">
@ -53,10 +49,7 @@ import com.google.common.base.Objects;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Group")
@XmlType(propOrder = {
"nameInSource",
@ -69,6 +62,7 @@ public class Group extends EntityType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromGroup(this);
}
@ -79,7 +73,7 @@ public class Group extends EntityType {
public static abstract class Builder<B extends Builder<B>> extends EntityType.Builder<B> {
private String nameInSource;
private UsersList usersList;
private Set<Reference> users = Sets.newLinkedHashSet();
private Reference role;
/**
@ -91,10 +85,18 @@ public class Group extends EntityType {
}
/**
* @see Group#getUsersList()
* @see Group#getUsers()
*/
public B usersList(UsersList usersList) {
this.usersList = usersList;
public B users(Iterable<Reference> users) {
this.users = Sets.newLinkedHashSet(checkNotNull(users, "users"));
return self();
}
/**
* @see Group#getUsers()
*/
public B user(Reference user) {
users.add(checkNotNull(user, "user"));
return self();
}
@ -106,6 +108,7 @@ public class Group extends EntityType {
return self();
}
@Override
public Group build() {
return new Group(this);
}
@ -113,7 +116,7 @@ public class Group extends EntityType {
public B fromGroup(Group in) {
return fromEntityType(in)
.nameInSource(in.getNameInSource())
.usersList(in.getUsersList())
.users(in.getUsersList())
.role(in.getRole());
}
}
@ -126,48 +129,34 @@ public class Group extends EntityType {
protected Group(Builder<?> builder) {
super(builder);
this.nameInSource = builder.nameInSource;
this.usersList = builder.usersList;
this.usersList = builder.users == null ? Sets.<Reference>newLinkedHashSet() : ImmutableSet.copyOf(builder.users);
this.role = builder.role;
}
@XmlElement(name = "NameInSource")
protected String nameInSource;
@XmlElement(name = "UsersList")
protected UsersList usersList;
@XmlElementWrapper(name = "UsersList")
@XmlElement(name = "UserReference")
protected Set<Reference> usersList = Sets.newLinkedHashSet();
@XmlElement(name = "Role")
protected Reference role;
/**
* Gets the value of the nameInSource property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNameInSource() {
return nameInSource;
}
/**
* Gets the value of the usersList property.
*
* @return
* possible object is
* {@link UsersList }
*
* Gets the value of the users property.
*/
public UsersList getUsersList() {
public Set<Reference> getUsersList() {
return usersList;
}
/**
* Gets the value of the role property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getRole() {
return role;

View File

@ -1,165 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
/**
*
* Container for ReferenceType elements that reference groups.
*
*
* <p>Java class for GroupsList complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="GroupsList">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="GroupReference" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "GroupsList")
@XmlType(propOrder = {
"groups"
})
public class GroupsList {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromGroupsList(this);
}
public static class Builder {
private List<Reference> groups;
/**
* @see GroupsList#getGroupReference()
*/
public Builder groups(List<Reference> groups) {
this.groups = ImmutableList.copyOf(groups);
return this;
}
/**
* @see GroupsList#getGroupReference()
*/
public Builder group(Reference group) {
groups.add(checkNotNull(group, "group"));
return this;
}
public GroupsList build() {
return new GroupsList(groups);
}
public Builder fromGroupsList(GroupsList in) {
return groups(in.getGroups());
}
}
private GroupsList() {
// For JAXB
}
private GroupsList(List<Reference> groups) {
this.groups = groups;
}
@XmlElement(name = "GroupReference")
protected List<Reference> groups;
/**
* Gets the value of the groupReference property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the groupReference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getGroupReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List<Reference> getGroups() {
if (groups == null) {
groups = new ArrayList<Reference>();
}
return this.groups;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
GroupsList that = GroupsList.class.cast(o);
return equal(groups, that.groups);
}
@Override
public int hashCode() {
return Objects.hashCode(groups);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("groups", groups).toString();
}
}

View File

@ -20,8 +20,6 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@ -38,7 +36,6 @@ import com.google.common.base.Objects.ToStringHelper;
*
* @author grkvlt@apache.org
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InstantiateOvfParams")
public class InstantiateOvfParams extends VAppCreationParamsType {

View File

@ -18,8 +18,8 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Preconditions.*;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collections;
import java.util.Set;

View File

@ -22,7 +22,6 @@ import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.net.URI;
import java.util.Collections;
import java.util.Set;
import javax.xml.bind.annotation.XmlAttribute;

View File

@ -1,172 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
*
* Container for ReferenceType elements that reference ExternalNetwork objects.
* This element is created by the server and is read only.
*
*
* <p>Java class for Networks complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Networks">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Network" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Networks", propOrder = {
"networks"
})
public class Networks {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromNetworks(this);
}
public static class Builder {
private List<Reference> networks = Lists.newArrayList();
/**
* @see Networks#getNetwork()
*/
public Builder networks(List<Reference> networks) {
this.networks = ImmutableList.copyOf(networks);
return this;
}
/**
* @see Networks#getNetwork()
*/
public Builder network(Reference network) {
this.networks.add(checkNotNull(network, "network"));
return this;
}
public Networks build() {
return new Networks(networks);
}
public Builder fromNetworks(Networks in) {
return networks(in.getNetwork());
}
}
private Networks() {
// For JAXB
}
private Networks(List<Reference> networks) {
this.networks = networks;
}
@XmlElement(name = "Network")
protected List<Reference> networks;
/**
* Gets the value of the network property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the network property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNetwork().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List<Reference> getNetwork() {
if (networks == null) {
networks = new ArrayList<Reference>();
}
return this.networks;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Networks that = Networks.class.cast(o);
return equal(networks, that.networks);
}
@Override
public int hashCode() {
return Objects.hashCode(networks);
}
@Override
public String toString() {
return string().toString();
}
public ToStringHelper string() {
return Objects.toStringHelper("")
.add("networks", networks);
}
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
@ -24,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -34,15 +31,8 @@ import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
/**
*
* Defines the email settings for an organization.
*
*
* <p>Java class for OrgEmailSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines the email settings for an organization.
*
* <pre>
* &lt;complexType name="OrgEmailSettings">
@ -62,10 +52,7 @@ import com.google.common.collect.ImmutableList;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "OrgEmailSettings")
@XmlType(propOrder = {
"isDefaultSmtpServer",
@ -82,6 +69,7 @@ public class OrgEmailSettings extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromOrgEmailSettings(this);
}
@ -163,6 +151,7 @@ public class OrgEmailSettings extends ResourceType {
return self();
}
@Override
public OrgEmailSettings build() {
return new OrgEmailSettings(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -30,15 +27,8 @@ import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Defines general org settings.
*
*
* <p>Java class for OrgGeneralSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines general org settings.
*
* <pre>
* &lt;complexType name="OrgGeneralSettings">
@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "GeneralOrgSettings")
@XmlType(propOrder = {
"canPublishCatalogs",

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,28 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Defines how a group is imported from LDAP.
*
*
* <p>Java class for OrgLdapGroupAttributes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines how a group is imported from LDAP.
*
* <pre>
* &lt;complexType name="OrgLdapGroupAttributes">
@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OrgLdapGroupAttributes", propOrder = {
"objectClass",
"objectIdentifier",

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
@ -24,24 +23,14 @@ import static com.google.common.base.Objects.equal;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Base settings for LDAP connection
*
*
* <p>Java class for OrgLdapSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Base settings for LDAP connection
*
* <pre>
* &lt;complexType name="OrgLdapSettings">
@ -57,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "OrgLdapSettings")
@XmlType(propOrder = {
"ldapMode",
@ -68,14 +54,15 @@ import com.google.common.base.Objects.ToStringHelper;
"customOrgLdapSettings"
})
public class OrgLdapSettings extends ResourceType {
public static final class LdapMode {
public static final String NONE = "NONE";
public static final String SYSTEM = "SYSTEM";
public static final String CUSTOM = "CUSTOM";
/**
* All acceptable {@link OrgLdapSettings#getLdapMode()} values.
* <p/>
* All acceptable {@link #getLdapMode()} values.
*
* This list must be updated whenever a new mode is added.
*/
public static final List<String> ALL = Arrays.asList(
@ -87,6 +74,7 @@ public class OrgLdapSettings extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromOrgLdapSettings(this);
}
@ -124,6 +112,7 @@ public class OrgLdapSettings extends ResourceType {
return self();
}
@Override
public OrgLdapSettings build() {
return new OrgLdapSettings(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,28 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Defines how LDAP attributes are used when importing a user.
*
*
* <p>Java class for OrgLdapUserAttributes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines how LDAP attributes are used when importing a user.
*
* <pre>
* &lt;complexType name="OrgLdapUserAttributes">
@ -60,10 +50,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OrgLdapUserAttributes", propOrder = {
"objectClass",
"objectIdentifier",

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -30,15 +27,8 @@ import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Defines default lease durations and policies for an organization.
*
*
* <p>Java class for OrgLeaseSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines default lease durations and policies for an organization.
*
* <pre>
* &lt;complexType name="OrgLeaseSettings">
@ -54,10 +44,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "VAppLeaseSettings")
@XmlType(propOrder = {
"deleteOnStorageLeaseExpiration",
@ -69,6 +56,7 @@ public class OrgLeaseSettings extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromOrgLeaseSettings(this);
}
@ -106,6 +94,7 @@ public class OrgLeaseSettings extends ResourceType {
return self();
}
@Override
public OrgLeaseSettings build() {
return new OrgLeaseSettings(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -30,7 +27,6 @@ import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
* Java class for OrgPasswordPolicySettings complex type.
*
@ -38,7 +34,6 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;complexType name="OrgPasswordPolicySettings" /&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "OrgPasswordPolicySettings")
@XmlType(propOrder = {
"accountLockoutEnabled",
@ -50,6 +45,7 @@ public class OrgPasswordPolicySettings extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromOrgPasswordPolicySettings(this);
}
@ -87,6 +83,7 @@ public class OrgPasswordPolicySettings extends ResourceType {
return self();
}
@Override
public OrgPasswordPolicySettings build() {
return new OrgPasswordPolicySettings(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,32 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Describes various settings for some organization.
* This type establishes quotas and policies for the organization.
* It also contains elements that specify the details of
* how the organization connects to LDAP and email services.
*
* <p>Java class for OrgSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="OrgSettings">
* &lt;complexContent>
@ -59,10 +49,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "OrgSettings")
@XmlType(propOrder = {
"generalSettings",

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -30,15 +27,8 @@ import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Defines default lease policies for vAppTemplate on organization level.
*
*
* <p>Java class for OrgVAppTemplateLeaseSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Defines default lease policies for vAppTemplate on organization level.
*
* <pre>
* &lt;complexType name="OrgVAppTemplateLeaseSettings">
@ -53,10 +43,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "OrgVAppTemplateLeaseSettings")
@XmlType(propOrder = {
"deleteOnStorageLeaseExpiration",
@ -67,6 +54,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromOrgVAppTemplateLeaseSettings(this);
}
@ -96,6 +84,7 @@ public class OrgVAppTemplateLeaseSettings extends ResourceType {
}
@Override
public OrgVAppTemplateLeaseSettings build() {
return new OrgVAppTemplateLeaseSettings(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,28 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Parameters used when publishing catalogs.
*
*
* <p>Java class for PublishCatalogParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Parameters used when publishing catalogs.
*
* <pre>
* &lt;complexType name="PublishCatalogParams">
@ -51,10 +41,7 @@ import com.google.common.base.Objects;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "PublishCatalogParams")
@XmlType(propOrder = {
"isPublished"

View File

@ -21,7 +21,9 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -31,7 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.cim.ResourceAllocationSettingData
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
/**
* Represents a list of RASD items.
@ -44,12 +46,13 @@ import com.google.common.collect.Lists;
*/
@XmlRootElement(name = "RasdItemsList")
@XmlType(name = "RasdItemsList")
public class RasdItemsList extends ResourceType {
public class RasdItemsList extends ResourceType implements Set<ResourceAllocationSettingData> {
public static Builder<?> builder() {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return builder().fromRasdItemsList(this);
}
@ -59,12 +62,12 @@ public class RasdItemsList extends ResourceType {
public static abstract class Builder<B extends Builder<B>> extends ResourceType.Builder<B> {
private List<ResourceAllocationSettingData> items = Lists.newArrayList();
private Set<ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
/**
* @see RasdItemsList#getItems()
*/
public B items(List<ResourceAllocationSettingData> items) {
public B items(Set<ResourceAllocationSettingData> items) {
this.items = checkNotNull(items, "items");
return self();
}
@ -98,12 +101,12 @@ public class RasdItemsList extends ResourceType {
}
@XmlElement(name = "Item")
protected List<ResourceAllocationSettingData> items = Lists.newArrayList();
protected Set<ResourceAllocationSettingData> items = Sets.newLinkedHashSet();
/**
* A RASD item content.
*/
public List<ResourceAllocationSettingData> getItems() {
public Set<ResourceAllocationSettingData> getItems() {
return items;
}
@ -127,4 +130,79 @@ public class RasdItemsList extends ResourceType {
return super.string().add("items", items);
}
/**
* The delegate always returns a {@link Set} even if {@link #items} is {@literal null}.
*
* The delegated {@link Set} is used by the methods implementing its interface.
* <p>
* NOTE Annoying lack of multiple inheritance for using ForwardingList!
*/
private Set<ResourceAllocationSettingData> delegate() {
return getItems();
}
@Override
public boolean add(ResourceAllocationSettingData arg0) {
return delegate().add(arg0);
}
@Override
public boolean addAll(Collection<? extends ResourceAllocationSettingData> arg0) {
return delegate().addAll(arg0);
}
@Override
public void clear() {
delegate().clear();
}
@Override
public boolean contains(Object arg0) {
return delegate().contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return delegate().containsAll(arg0);
}
@Override
public boolean isEmpty() {
return delegate().isEmpty();
}
@Override
public Iterator<ResourceAllocationSettingData> iterator() {
return delegate().iterator();
}
@Override
public boolean remove(Object arg0) {
return delegate().remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return delegate().removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return delegate().retainAll(arg0);
}
@Override
public int size() {
return delegate().size();
}
@Override
public Object[] toArray() {
return delegate().toArray();
}
@Override
public <T> T[] toArray(T[] arg0) {
return delegate().toArray(arg0);
}
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,17 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import java.util.Set;
import javax.lang.model.type.ReferenceType;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@ -37,15 +32,8 @@ import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.Sets;
/**
*
* This is the container for returned elements in referenceView
*
*
* <p>Java class for References complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* This is the container for returned elements in referenceView
*
* <pre>
* &lt;complexType name="References">
@ -59,10 +47,7 @@ import com.google.common.collect.Sets;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "References")
@XmlType(propOrder = {
"references"
@ -72,6 +57,7 @@ public class References extends ContainerType {
return new ConcreteBuilder();
}
@Override
public Builder<?> toBuilder() {
return new ConcreteBuilder().fromReferences(this);
}
@ -94,6 +80,7 @@ public class References extends ContainerType {
return self();
}
@Override
public References build() {
return new References(this);
}

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,30 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
/**
*
* Specifies connection details for the organization s SMTP server.
* If IsDefaultSmtpServer (in OrgEmailSettings) is false, the SmtpServerSettings
* element is taken into account.
*
*
* <p>Java class for SmtpServerSettings complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Specifies connection details for the organization s SMTP server.
* If IsDefaultSmtpServer (in OrgEmailSettings) is false, the SmtpServerSettings
* element is taken into account.
*
* <pre>
* &lt;complexType name="SmtpServerSettings">
@ -56,10 +46,7 @@ import com.google.common.base.Objects.ToStringHelper;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SmtpServerSettings", propOrder = {
"useAuthentication",
"host",

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,25 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
* <p>Java class for StaticRoute complex type.
* <p/>
* <p>The following schema fragment specifies the expected content contained within this class.
* <p/>
* Java class for StaticRoute complex type.
*
* <pre>
* &lt;complexType name="StaticRoute">
* &lt;complexContent>
@ -51,7 +45,6 @@ import com.google.common.base.Objects;
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StaticRoute", propOrder = {
"name",
"network",

View File

@ -1,166 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
*
* Container for ReferenceType elements that reference users.
*
*
* <p>Java class for UsersList complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="UsersList">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="UserReference" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "UsersList")
@XmlType(propOrder = {
"users"
})
public class UsersList {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromUsersList(this);
}
public static class Builder {
private List<Reference> users = Lists.newArrayList();
/**
* @see UsersList#getUsers()
*/
public Builder users(List<Reference> users) {
this.users = ImmutableList.copyOf(users);
return this;
}
/**
* @see UsersList#getUsers()
*/
public Builder user(Reference user) {
users.add(checkNotNull(user, "user"));
return this;
}
public UsersList build() {
return new UsersList(users);
}
public Builder fromUsersList(UsersList in) {
return users(in.getUsers());
}
}
private UsersList() {
// For JAXB and builder use
}
private UsersList(List<Reference> users) {
this.users = users;
}
@XmlElement(name = "UserReference")
protected List<Reference> users;
/**
* Gets the value of the userReference property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the userReference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUserReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List<Reference> getUsers() {
if (users == null) {
users = new ArrayList<Reference>();
}
return this.users;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
UsersList that = UsersList.class.cast(o);
return equal(users, that.users);
}
@Override
public int hashCode() {
return Objects.hashCode(users);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("userReference", users).toString();
}
}

View File

@ -18,13 +18,11 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Preconditions.*;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@ -40,7 +38,6 @@ import com.google.common.collect.Lists;
*
* @author grkvlt@apache.org
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VAppChildren")
public class VAppChildren {

View File

@ -29,14 +29,7 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import org.jclouds.vcloud.director.v1_5.domain.ovf.DeploymentOptionSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.DiskSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.OperatingSystemSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.ProductSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.SectionType;
import org.jclouds.vcloud.director.v1_5.domain.ovf.StartupSection;
import org.jclouds.vcloud.director.v1_5.domain.ovf.VirtualHardwareSection;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

View File

@ -18,10 +18,8 @@
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.*;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

View File

@ -1,176 +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.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
/**
*
* Represents a list of references to virtual data centers.
*
*
* <p>Java class for Vdcs complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Vdcs">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Vdc" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Vdcs")
@XmlType(propOrder = {
"vdcs"
})
public class Vdcs {
// FIXME Delete Vdcs, and use Set<Vdc>
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromVdcs(this);
}
public static class Builder {
private List<Reference> vdcs = Lists.newArrayList();
/**
* @see Vdcs#getVdc()
*/
public Builder vdcs(List<Reference> vdcs) {
this.vdcs = ImmutableList.copyOf(vdcs);
return this;
}
/**
* @see Vdcs#getVdc()
*/
public Builder vdc(Reference vdc) {
this.vdcs.add(checkNotNull(vdc, "vdc"));
return this;
}
public Vdcs build() {
return new Vdcs(vdcs);
}
public Builder fromVdcs(Vdcs in) {
return vdcs(in.getVdcs());
}
}
private Vdcs() {
// For JAXB and builder use
}
private Vdcs(List<Reference> vdcs) {
this.vdcs = vdcs;
}
@XmlElement(name = "Vdc")
protected List<Reference> vdcs;
/**
* Gets the value of the vdc property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the vdc property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getVdc().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Reference }
*
*
*/
public List<Reference> getVdcs() {
if (vdcs == null) {
vdcs = new ArrayList<Reference>();
}
return this.vdcs;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Vdcs that = Vdcs.class.cast(o);
return equal(vdcs, that.vdcs);
}
@Override
public int hashCode() {
return Objects.hashCode(vdcs);
}
@Override
public String toString() {
return string().toString();
}
public ToStringHelper string() {
return Objects.toStringHelper("")
.add("vdcs", vdcs);
}
}

View File

@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.vcloud.director.v1_5.domain.ovf.environment.EnvironmentType;
import org.omg.CORBA.Environment;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,28 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a VM answer to a question when the VM is in a stuck
* (WAITING_FOR_INPUT) state.
*
*
* <p>Java class for VmQuestionAnswer complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Represents a VM answer to a question when the VM is in a stuck
* {@link ResourceEntityType.Status#WAITING_FOR_INPUT} state.
*
* <pre>
* &lt;complexType name="VmQuestionAnswer">
@ -51,10 +41,7 @@ import com.google.common.base.Objects;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VmQuestionAnswer", propOrder = {
"choiceId",
"questionId"

View File

@ -1,4 +1,4 @@
/**
/*
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@ -16,27 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a pair of ID and text of an answer choice of a VM question.
*
*
* <p>Java class for VmQuestionAnswerChoice complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* Represents a pair of ID and text of an answer choice of a VM question.
*
* <pre>
* &lt;complexType name="VmQuestionAnswerChoice">
@ -50,10 +40,7 @@ import com.google.common.base.Objects;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VmQuestionAnswerChoice", propOrder = {
"id",
"text"

View File

@ -31,8 +31,8 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_1_5_NS;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_CIM_NS;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_ENV_NS;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.VCLOUD_OVF_NS;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

View File

@ -37,7 +37,6 @@ import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;

View File

@ -22,13 +22,10 @@ import java.net.URI;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
/**
* Provides synchronous access to {@link AdminCatalog} objects.
@ -36,7 +33,6 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
* @see AdminCatalogAsyncClient
* @author danikov
*/
@RequestFilters(AddVCloudAuthorizationToRequest.class)
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
public interface AdminCatalogClient extends CatalogClient {

View File

@ -48,7 +48,7 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture;
/**
* @see GroupClient
* @see AdminOrgClient
* @author danikov
*/
@RequestFilters(AddVCloudAuthorizationToRequest.class)
@ -57,6 +57,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
/**
* @see AdminOrgClient#getOrg(URI)
*/
@Override
@GET
@Consumes
@JAXBResponseParser

View File

@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
import org.jclouds.vcloud.director.v1_5.domain.Group;
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings;
@ -34,7 +33,7 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings;
/**
* Provides synchronous access to {@link Group} objects.
* Provides synchronous access to {@link Org} objects.
*
* @see GroupAsyncClient
* @author danikov

View File

@ -36,7 +36,6 @@ import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
@ -49,8 +48,6 @@ import com.google.common.util.concurrent.ListenableFuture;
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public interface AdminVdcAsyncClient extends VdcAsyncClient {
// TODO Should we use MetadataClient?
@GET
@Consumes
@JAXBResponseParser
@ -88,6 +85,7 @@ public interface AdminVdcAsyncClient extends VdcAsyncClient {
/**
* @return asynchronous access to {@link Writeable} features
*/
@Override
@Delegate
MetadataAsyncClient.Writeable getMetadataClient();
}

View File

@ -26,14 +26,11 @@ import org.jclouds.rest.annotations.Delegate;
import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient.Writeable;
/**
* Provides synchronous access to Network.
* <p/>
* Provides synchronous access to {@link AdminVdc}.
*
* @see NetworkAsyncClient
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
* @see AdminVdcAsyncClient
* @author danikov
*/
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)

View File

@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.CatalogType;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;

View File

@ -23,10 +23,8 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.CatalogType;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
/**
* Provides synchronous access to {@link Catalog} objects.

View File

@ -38,7 +38,6 @@ import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;

View File

@ -25,16 +25,13 @@ import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
import org.jclouds.vcloud.director.v1_5.domain.Task;
/**
* Provides synchronous access to Media.
* <p/>
* Provides synchronous access to {@link Media}.
*
* @see MediaAsyncClient
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
* @author danikov
*/
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)

View File

@ -45,13 +45,14 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture;
/**
* @see NetworkClient
* @see MetadataClient
* @author danikov
*/
public interface MetadataAsyncClient {
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public static interface Readable extends MetadataAsyncClient {
/**
* @see MetadataClient.Readable#getMetadata(URISupplier)
*/
@ -75,6 +76,7 @@ public interface MetadataAsyncClient {
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public static interface Writeable extends Readable {
/**
* @see MetadataClient.Writable#mergeMetadata(URI, Metadata))
*/

View File

@ -27,19 +27,16 @@ import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Task;
/**
* Provides synchronous access to Upload.
* <p/>
* Provides synchronous access to {@linkl Metadata}.
*
* @see MetadataAsyncClient
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
* @author danikov
*/
public interface MetadataClient {
// FIXME Correct spelling of Writeable -> Writable
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
public static interface Readable extends MetadataClient {
/**
* Retrieves an list of metadata
*
@ -57,6 +54,7 @@ public interface MetadataClient {
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
public static interface Writeable extends Readable {
/**
* Merges the metadata for a media with the information provided.
*

View File

@ -28,7 +28,6 @@ import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Network;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
@ -36,7 +35,6 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture;
/**
* @see NetworkClient
* @author danikov
*/

View File

@ -23,15 +23,12 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.Network;
/**
* Provides synchronous access to Network.
* <p/>
* Provides synchronous access to {@link Network}.
*
* @see NetworkAsyncClient
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
* @author danikov
*/
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)

View File

@ -28,8 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.OrgList;
/**
* Provides synchronous access to Org.
* <p/>
* Provides synchronous access to {@link Org}.
*
* @see OrgAsyncClient
* @author Adrian Cole

View File

@ -28,7 +28,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences;
/**
* Provides synchronous access to The REST API query interface.
* Provides synchronous access to the REST API query interface.
*
* @see QueryAsyncClient
* @author grkvlt@apache.org

View File

@ -30,12 +30,12 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import com.google.common.util.concurrent.ListenableFuture;
/**
*
* @see UploadClient
* @author danikov
*/
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public interface UploadAsyncClient {
/**
* @see UploadClient#put
*/

View File

@ -25,8 +25,7 @@ import org.jclouds.concurrent.Timeout;
import org.jclouds.io.Payload;
/**
* Provides synchronous access to Upload.
* <p/>
* Provides synchronous access to upload.
*
* @see UploadAsyncClient
* @author danikov

View File

@ -42,11 +42,12 @@ import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture;
/**
* @see GroupClient
* @see UserClient
* @author danikov
*/
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public interface UserAsyncClient {
/**
* @see UserClient#createUser(URI, User)
*/

View File

@ -22,7 +22,6 @@ import java.net.URI;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.director.v1_5.domain.Group;
import org.jclouds.vcloud.director.v1_5.domain.User;
/**
@ -33,6 +32,7 @@ import org.jclouds.vcloud.director.v1_5.domain.User;
*/
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
public interface UserClient {
/**
* Creates or imports a user in an organization. The user could be enabled or disabled.
*

View File

@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.features;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.CUSTOMIZATION_SECTION;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.LEASE_SETTINGS_SECTION;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA_ENTRY;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONFIG_SECTION;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.NETWORK_SECTION;
@ -40,7 +38,6 @@ import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.jclouds.rest.annotations.BinderParam;
@ -53,8 +50,6 @@ import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
@ -214,60 +209,6 @@ public interface VAppTemplateAsyncClient {
ListenableFuture<Task> editVappTemplateLeaseSettingsSection(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection);
/**
* @see VAppTemplateClient#getVAppTemplateMetadata(URI)
*/
@GET
@Consumes(METADATA)
@Path("/metadata")
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Metadata> getVAppTemplateMetadata(@EndpointParam URI templateURI);
@POST
@Produces(METADATA)
@Consumes(TASK)
@Path("/metadata")
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateMetadata(@EndpointParam URI templateURI,
@BinderParam(BindToXMLPayload.class) Metadata metadata);
/**
* @see VAppTemplateClient#getVAppTemplateMetadataValue(URI, String)
*/
@GET
@Consumes(METADATA_ENTRY)
@Path("/metadata/{key}")
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<MetadataValue> getVAppTemplateMetadataValue(@EndpointParam URI templateURI,
@PathParam("key") String key);
/**
* @see VAppTemplateClient#editVAppTemplateMetadataValue(URI, String, org.jclouds.vcloud.director.v1_5.domain.MetadataValue)
*/
@PUT
@Produces(METADATA_ENTRY)
@Consumes(TASK)
@Path("/metadata/{key}")
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> editVAppTemplateMetadataValue(@EndpointParam URI templateURI,
@PathParam("key") String key,
@BinderParam(BindToXMLPayload.class) MetadataValue value);
/**
* @see VAppTemplateClient#deleteVAppTemplateMetadataValue(URI, String)
*/
@DELETE
@Consumes(TASK)
@Path("/metadata/{key}")
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Task> deleteVAppTemplateMetadataValue(@EndpointParam URI templateURI,
@PathParam("key") String key);
/**
* @see VAppTemplateClient#getVAppTemplateNetworkConfigSection(URI)
*/

View File

@ -26,7 +26,6 @@ import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.CustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection;
import org.jclouds.vcloud.director.v1_5.domain.LeaseSettingsSection;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.NetworkConfigSection;
import org.jclouds.vcloud.director.v1_5.domain.NetworkConnectionSection;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
@ -39,7 +38,7 @@ import org.jclouds.vcloud.director.v1_5.domain.ovf.Envelope;
import org.jclouds.vcloud.director.v1_5.domain.ovf.NetworkSection;
/**
* Provides synchronous access to {@link org.jclouds.vcloud.director.v1_5.domain.VAppTemplate} objects.
* Provides synchronous access to {@link VAppTemplate} objects.
*
* @author Adam Lowe
* @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient
@ -49,15 +48,24 @@ public interface VAppTemplateClient {
/**
* Retrieves a vApp template (can be used also to retrieve a VM from a vApp Template).
* The vApp could be in one of these statues: FAILED_CREATION(-1) - Transient entity state,
* e.g., model object is created but the corresponding VC backing does not exist yet. This
* is further sub-categorized in the respective entities. UNRESOLVED(0) - Entity is whole,
* e.g., VM creation is complete and all the required model objects and VC backings are created.
* RESOLVED(1) - Entity is resolved. UNKNOWN(6) - Entity state could not be retrieved from
* the inventory, e.g., VM power state is null. POWERED_OFF(8) - All VMs of the vApp template
* are powered off. MIXED(10) - vApp template status is set to MIXED when the VMs in the
* vApp are in different power states.
*
* The vApp could be in one of these statues:
* <ul>
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#FAILED_CREATION} -
* Transient entity state, e.g., model object is created but the corresponding VC backing
* does not exist yet. This is further sub-categorized in the respective entities.
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED} -
* Entity is whole, e.g., VM creation is complete and all the required model objects and VC backings are created.
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#RESOLVED} -
* Entity is resolved.
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNKNOWN} -
* Entity state could not be retrieved from the inventory, e.g., VM power state is null.
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#POWERED_OFF} -
* All VMs of the vApp template
* are powered off.
* <li>{@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#MIXED} -
* vApp template status is set to MIXED when the VMs in the vApp are in different power states.
* </ul>
* <pre>
* GET /vAppTemplate/{id}
* </pre>
@ -236,17 +244,7 @@ public interface VAppTemplateClient {
NetworkConfigSection getVAppTemplateNetworkConfigSection(URI templateUri);
/**
* Modifies the network config section of a vApp. There are three general types of vApp
* networks which could be configured from this section. They are specified by the element
* value in /. isolated - this is a vApp network which is not connected to any external
* organization network and is used only to connect VMs internally in a vApp. In this
* network you could configure only its element of /. bridged - this is a vApp network
* which is directly connected to an external organization network. In this network you
* should configure only the element of /. In this case the element is inherit from the
* parent network. natRouted - this is a vApp network which is NAT routed to an external
* organization network. In this network you could configure the and also you should
* specify and the element of /. When the network is NAT routed you could specify DHCP,
* firewall rules and NAT rules, for fine-grained configuration of your network.
* Modifies the network config section of a vApp.
*
* <pre>
* PUT /vAppTemplate/{id}/networkConfigSection

View File

@ -41,7 +41,6 @@ import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;

View File

@ -55,7 +55,10 @@ public interface VdcClient {
/**
* Captures a vApp into vApp template.
* The status of vApp template will be in UNRESOLVED(0) until the capture task is finished.
*
* The status of vApp template will be in
* {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
* until the capture task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
@ -64,7 +67,9 @@ public interface VdcClient {
/**
* Clones a media into new one.
* The status of the returned media is UNRESOLVED(0) until the task for cloning finish.
* The status of the returned media is
* {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
* until the task for cloning finish.
*
* @return a Media resource which will contain a task.
* The user should monitor the contained task status in order to check when it is completed.
@ -81,7 +86,10 @@ public interface VdcClient {
/**
* Clones a vApp template into new one.
* The status of vApp template will be in UNRESOLVED(0) until the clone task is finished.
*
* The status of vApp template will be in
* {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
* until the clone task is finished.
*
* @return a VAppTemplate resource which will contain a task.
* The user should should wait for this task to finish to be able to use the VAppTemplate.
@ -89,23 +97,32 @@ public interface VdcClient {
VAppTemplate cloneVAppTemplate(URI vdcUri, CloneVAppTemplateParams params);
/**
* Composes a new vApp using VMs from other vApps or vApp templates. The vCloud API supports
* composing a vApp from any combination of vApp templates, vApps, or virtual machines.
* When you compose a vApp, all children of each composition source become peers in the
* Children collection of the composed vApp. To compose a vApp, a client makes a compose
* vApp request whose body is a ComposeVAppParams element, includes the following information:
* - An InstantiationParams element that applies to the composed vApp itself and any vApp
* templates referenced in Item elements. - A SourcedItem element for each virtual machine,
* vApp, or vAppTemplate to include in the composition. Each SourcedItem can contain the
* following elements: - A required Source element whose href attribute value is a reference
* to a vApp template, vApp, or VM to include in the composition. If the Source element
* references a VM, the Item must also include an InstantiationParams element specific to
* that VM. - An optional NetworkAssignment element that specifies how the network connections
* of child VM elements are mapped to vApp networks in the parent. - If any of the composition
* items is subject to a EULA, the ComposeVAppParams element must include an AllEULAsAccepted
* element that has a value of true, indicating that you accept the EULA. Otherwise, composition
* fails. The composed vApp must be deployed and powered on before it can be used. The status
* of vApp will be UNRESOLVED(0) until the compose task is finished.
* Composes a new vApp using VMs from other vApps or vApp templates.
*
* The vCloud API supports composing a vApp from any combination of vApp templates, vApps,
* or virtual machines. When you compose a vApp, all children of each composition source
* become peers in the Children collection of the composed vApp. To compose a vApp, a client
* makes a compose vApp request whose body is a ComposeVAppParams element, includes the
* following information:
* <ul>
* <li>An InstantiationParams element that applies to the composed vApp itself and any vApp
* templates referenced in Item elements.
* <li>A SourcedItem element for each virtual machine, vApp, or vAppTemplate to include in
* the composition. Each SourcedItem can contain the following elements:
* <ul>
* <li>A required Source element whose href attribute value is a reference
* to a vApp template, vApp, or VM to include in the composition. If the Source element
* references a VM, the Item must also include an InstantiationParams element specific to
* that VM.
* <li>An optional NetworkAssignment element that specifies how the network connections
* of child VM elements are mapped to vApp networks in the parent.
* </ul>
* <li>If any of the composition items is subject to a EULA, the ComposeVAppParams element
* must include an AllEULAsAccepted element that has a value of true, indicating that you
* accept the EULA. Otherwise, composition fails. The composed vApp must be deployed and
* powered on before it can be used. The status of vApp will be
* {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
* until the compose task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
@ -114,7 +131,10 @@ public interface VdcClient {
/**
* Instantiate a vApp template into a new vApp.
* The status of vApp will be in UNRESOLVED(0) until the instantiate task is finished.
*
* The status of vApp will be in
* {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED UNRESOLVED(0)}
* until the instantiate task is finished.
*
* <pre>
* POST /vdc/{id}/action/instantiateVAppTemplate
@ -126,13 +146,17 @@ public interface VdcClient {
VApp instantiateVApp(URI vdcUri, InstantiateVAppParamsType params);
/**
* Uploading vApp template to a vDC. The operation is separate on several steps:
* 1. creating empty vApp template entity
* 2. uploading an OVF of vApp template
* 3. uploading disks described from the OVF
* 4. finishing task for uploading
* The status of vApp template will be NOT_READY(0) until the ovf and all disks are uploaded
* to the transfer site. After this a task will run on the vApp template uploading.
* Uploading vApp template to a vDC.
*
* The operation is separate on several steps:
* <ol>
* <li>creating empty vApp template entity
* <li>uploading an OVF of vApp template
* <li>uploading disks described from the OVF
* <li>finishing task for uploading
* </ol>
* The status of vApp template will be {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#NOT_READY NOT_READY(0)}
* until the ovf and all disks are uploaded to the transfer site. After this a task will run on the vApp template uploading.
*
* Note that the empty vApp template's getFiles() returns a file of size -1 after step one above,
* because the descriptor.ovf does not yet exist.

View File

@ -18,17 +18,14 @@
*/
package org.jclouds.vcloud.director.testng;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.ITestContext;
import org.testng.ITestListener;
import org.testng.ITestResult;
import org.testng.annotations.Test;
import org.testng.TestListenerAdapter;
import com.google.common.base.Joiner;
import com.google.common.base.Predicates;
@ -42,20 +39,12 @@ import com.google.common.collect.Iterables;
*
* @author Adrian Cole
*/
public class FormatApiResultsListener implements ITestListener {
public class FormatApiResultsListener extends TestListenerAdapter {
public static final Logger logger = LoggerFactory.getLogger("jclouds.vcloud.api");
public static final Set<String> apis = ImmutableSet.of("admin", "user");
private ThreadLocal<Long> threadTestStart = new ThreadLocal<Long>();
@Override
public void onTestStart(ITestResult res) {
if (methodInApiGroup(res)) {
threadTestStart.set(System.currentTimeMillis());
}
}
private static final SimpleDateFormat timestamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static final Set<String> apis = ImmutableSet.of("admin", "user");
@Override
synchronized public void onTestSuccess(ITestResult res) {
@ -81,24 +70,12 @@ public class FormatApiResultsListener implements ITestListener {
}
}
@Override
public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {
}
@Override
public void onStart(ITestContext arg0) {
}
@Override
public void onFinish(ITestContext arg0) {
}
private boolean methodInApiGroup(ITestResult res) {
return Iterables.any(Arrays.asList(res.getMethod().getGroups()), Predicates.in(apis));
}
private String resultForState(ITestResult res, String state) {
return Joiner.on(',').join(getApi(res), getOperation(res), getDuration(), state);
return Joiner.on(',').join(getApi(res), getOperation(res), getStart(res), getTest(res), getDuration(res), state);
}
private String getApi(ITestResult res) {
@ -106,13 +83,18 @@ public class FormatApiResultsListener implements ITestListener {
}
private String getOperation(ITestResult res) {
Method method = res.getMethod().getConstructorOrMethod().getMethod();
Test test = method.getAnnotation(Test.class);
return test != null ? test.testName() : method.getName();
return res.getMethod().getDescription();
}
private String getDuration() {
Long start = threadTestStart.get();
return (start == null) ? "" : Long.toString(System.currentTimeMillis() - start);
private String getTest(ITestResult res) {
return res.getName();
}
private String getStart(ITestResult res) {
return timestamp.format(res.getStartMillis());
}
private String getDuration(ITestResult res) {
return Long.toString(res.getEndMillis() - res.getStartMillis());
}
}

View File

@ -68,6 +68,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecordType;
import com.beust.jcommander.internal.Maps;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.net.InetAddresses;
@ -110,12 +111,19 @@ public class Checks {
/**
* Assumes the validTypes to be vcloud-specific types.
*
* @see checkReferenceType(ReferenceType, Collection<String>)
* @see #checkReferenceType(Reference, Collection)
*/
public static void checkReferenceType(Reference reference) {
checkReferenceType(reference, VCloudDirectorMediaType.ALL);
}
/**
* @see #checkReferenceType(Reference, Collection)
*/
public static void checkReferenceType(Reference reference, String type) {
checkReferenceType(reference, ImmutableSet.of(type));
}
public static void checkReferenceType(Reference reference, Collection<String> validTypes) {
// Check required fields
assertNotNull(reference.getHref(), String.format(NOT_NULL_OBJ_FIELD_FMT, "Href", "ReferenceType"));
@ -283,41 +291,26 @@ public class Checks {
assertNotNull(org.getSettings(), String.format(NOT_NULL_OBJ_FIELD_FMT, "settings", "AdminOrg"));
// optional
if (org.getGroups() != null) {
checkGroupsList(org.getGroups());
for (Reference user : org.getUsers()) {
checkReferenceType(user, VCloudDirectorMediaType.ADMIN_USER);
}
if (org.getCatalogs() != null) {
checkCatalogsList(org.getCatalogs());
for (Reference group : org.getGroups()) {
checkReferenceType(group, VCloudDirectorMediaType.GROUP);
}
if (org.getVdcs() != null) {
checkVdcs(org.getVdcs());
for (Reference catalog : org.getCatalogs()) {
checkReferenceType(catalog, VCloudDirectorMediaType.ADMIN_CATALOG);
}
if (org.getNetworks() != null) {
checkNetworks(org.getNetworks());
for (Reference vdc : org.getVdcs()) {
checkReferenceType(vdc, VCloudDirectorMediaType.ADMIN_VDC);
}
for (Reference network : org.getNetworks()) {
checkReferenceType(network, VCloudDirectorMediaType.ADMIN_NETWORK);
}
// Check parent type
checkOrg(org);
}
public static void checkCatalogsList(CatalogsList catalogList) {
for (Reference catalogItem : catalogList.getCatalogItems()) {
checkReferenceType(catalogItem);
}
}
public static void checkVdcs(Vdcs vdcs) {
for (Reference vdc : vdcs.getVdcs()) {
checkReferenceType(vdc);
}
}
public static void checkNetworks(Networks networks) {
for (Reference network : networks.getNetwork()) {
checkReferenceType(network);
}
}
public static void checkAdminCatalog(AdminCatalog catalog) {
// Check parent type
checkCatalogType(catalog);
@ -327,11 +320,8 @@ public class Checks {
// Check optional elements/attributes
Owner owner = catalog.getOwner();
if (owner != null) checkOwner(owner);
CatalogItems catalogItems = catalog.getCatalogItems();
if (catalogItems != null) {
for (Reference catalogItemReference : catalogItems.getCatalogItems()) {
checkReferenceType(catalogItemReference);
}
for (Reference catalogItemReference : catalog.getCatalogItems()) {
checkReferenceType(catalogItemReference, VCloudDirectorMediaType.CATALOG_ITEM);
}
// NOTE isPublished cannot be checked
@ -695,16 +685,9 @@ public class Checks {
if (params.isSharedToEveryone()) {
assertNotNull(params.getEveryoneAccessLevel(), String.format(OBJ_FIELD_REQ, "ControlAccessParams", "EveryoneAccessLevel"));
} else {
AccessSettings accessSettings = params.getAccessSettings();
checkAccessSettings(accessSettings);
}
}
public static void checkAccessSettings(AccessSettings accessSettings) {
if (accessSettings != null && accessSettings.getAccessSettings() != null) {
for (AccessSetting setting : accessSettings.getAccessSettings()) {
checkAccessSetting(setting);
}
for (AccessSetting setting : params.getAccessSettings()) {
checkAccessSetting(setting);
}
}
}
@ -778,38 +761,20 @@ public class Checks {
checkResourceEntityType(media);
}
public static void checkGroupsList(GroupsList groupsList) {
// Check optional fields
if (groupsList.getGroups() != null) {
for (Reference group : groupsList.getGroups()) {
checkReferenceType(group);
}
}
}
public static void checkGroup(Group group) {
// Check optional fields
// NOTE nameInSource cannot be checked
if (group.getUsersList() != null) {
checkUsersList(group.getUsersList());
for (Reference user : group.getUsersList()) {
checkReferenceType(user, VCloudDirectorMediaType.USER);
}
if (group.getRole() != null) {
checkReferenceType(group.getRole());
checkReferenceType(group.getRole(), VCloudDirectorMediaType.ROLE);
}
// parent type
checkEntityType(group);
}
public static void checkUsersList(UsersList usersList) {
// Check optional fields
if (usersList.getUsers() != null) {
for (Reference user : usersList.getUsers()) {
checkReferenceType(user);
}
}
}
public static void checkOrgSettings(OrgSettings settings) {
// Check optional fields
if (settings.getGeneralSettings() != null) {

View File

@ -25,7 +25,6 @@ import java.net.URI;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItems;
import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Owner;
import org.jclouds.vcloud.director.v1_5.domain.PublishCatalogParams;
@ -37,7 +36,7 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet;
/**
* Test the {@link CatalogClient} by observing its side effects.
* Test the {@link AdminCatalogClient} by observing its side effects.
*
* @author grkvlt@apache.org
*/
@ -47,7 +46,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx
private Reference orgRef = Reference.builder()
.type("application/vnd.vmware.vcloud.catalog+xml")
.name("QunyingTestCatalog")
.href(URI.create(endpoint + "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4"))
.href(URI.create(endpoint + "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"))
.build();
private Reference catalogRef = Reference.builder()
@ -60,7 +59,7 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx
public void testCreateCatalog() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/admin/org/???/catalogs")
.apiCommand("POST", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/catalogs")
.xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
.acceptMedia(VCloudDirectorMediaType.ADMIN_CATALOG)
.httpRequestBuilder().build(),
@ -71,16 +70,10 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx
AdminCatalog source = createCatalogSource();
AdminCatalog expected = createCatalog();
assertEquals(client.getAdminCatalogClient().createCatalog(catalogRef.getHref(), source), expected);
assertEquals(client.getAdminCatalogClient().createCatalog(orgRef.getHref(), source), expected);
}
// FIXME temporarily disabling this test due to JAXB error:
// javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.vmware.com/vcloud/v1.5", local:"AdminCatalog").
// Expected elements are <{http://www.vmware.com/vcloud/v1.5}Catalog>,<{http://www.vmware.com/vcloud/v1.5}CatalogItems>,
// <{http://www.vmware.com/vcloud/v1.5}CatalogReference>,<{http://www.vmware.com/vcloud/v1.5}Error>,
// <{http://www.vmware.com/vcloud/v1.5}Link>,<{http://www.vmware.com/vcloud/v1.5}Owner>,
// <{http://www.vmware.com/vcloud/v1.5}Task>
@Test(enabled = false)
@Test
public void testGetCatalog() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
@ -289,8 +282,6 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx
.build())
.build())
.build())
.catalogItems(CatalogItems.builder()
.build())
.isPublished(false)
.build();
}
@ -337,27 +328,25 @@ public class AdminCatalogClientExpectTest extends BaseVCloudDirectorRestClientEx
.build())
.description("Testing")
.owner(owner())
.catalogItems(CatalogItems.builder()
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("image")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/67a469a1-aafe-4b5b-bb31-a6202ad8961f"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("ubuntu10")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("imageTesting")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("TestCase")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/f7598606-aea4-41d7-8f67-2090e28e7876"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("image")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/67a469a1-aafe-4b5b-bb31-a6202ad8961f"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("ubuntu10")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("imageTesting")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("TestCase")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/f7598606-aea4-41d7-8f67-2090e28e7876"))
.build())
.isPublished(false)
.build();

View File

@ -78,7 +78,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
orgRef = Iterables.getFirst(context.getApi().getOrgClient().getOrgList().getOrgs(), null).toAdminReference(endpoint);
}
@Test(testName = "POST /admin/org/{id}/catalogs")
@Test(description = "POST /admin/org/{id}/catalogs")
public void testCreateCatalog() {
AdminCatalog newCatalog = AdminCatalog.builder()
.name(name("Test Catalog "))
@ -91,7 +91,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
// FIXME: documentation suggests we should wait for a task here
}
@Test(testName = "GET /admin/catalog/{id}",
@Test(description = "GET /admin/catalog/{id}",
dependsOnMethods = { "testCreateCatalog" })
public void testGetCatalog() {
catalog = catalogClient.getCatalog(catalog.getHref());
@ -99,14 +99,14 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
Checks.checkAdminCatalog(catalog);
}
@Test(testName = "GET /admin/catalog/{id}/owner",
@Test(description = "GET /admin/catalog/{id}/owner",
dependsOnMethods = { "testGetCatalog" })
public void testGetCatalogOwner() {
owner = catalogClient.getOwner(catalog.getHref());
Checks.checkOwner(owner);
}
@Test(testName = "PUT /admin/catalog/{id}/owner",
@Test(description = "PUT /admin/catalog/{id}/owner",
dependsOnMethods = { "testGetCatalog" })
public void updateCatalogOwner() {
User newOwnerUser = UserClientLiveTest.randomTestUser("testUpdateCatalogOwner", context);
@ -133,7 +133,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
}
}
@Test(testName = "PUT /admin/catalog/{id}", dependsOnMethods = { "testGetCatalogOwner" })
@Test(description = "PUT /admin/catalog/{id}", dependsOnMethods = { "testGetCatalogOwner" })
public void testUpdateCatalog() {
String oldName = catalog.getName();
String newName = "new "+oldName;
@ -171,7 +171,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
}
}
@Test(testName = "POST /admin/catalog/{id}/action/publish",
@Test(description = "POST /admin/catalog/{id}/action/publish",
dependsOnMethods = { "testUpdateCatalog" } ) // FIXME: fails with a 403
public void testPublishCatalog() {
assertNotNull(catalog, String.format(NOT_NULL_OBJ_FMT, "Catalog"));
@ -189,7 +189,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
CATALOG, "isPublished", true, catalog.isPublished()));
}
@Test(testName = "DELETE /admin/catalog/{id}",
@Test(description = "DELETE /admin/catalog/{id}",
dependsOnMethods = { "testCreateCatalog" } )
public void testDeleteCatalog() {
// assertEquals(catalog.getCatalogItems().getCatalogItems().size(), 0,

View File

@ -71,7 +71,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
networkRef = Reference.builder().href(networkURI).build().toAdminReference(endpoint);
}
@Test(testName = "GET /admin/network/{id}")
@Test(description = "GET /admin/network/{id}")
public void testGetNetwork() {
//TODO: test both org and external networks
assertNotNull(networkRef, String.format(OBJ_REQ_LIVE, NETWORK));
@ -88,7 +88,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
}
// TODO: this test is far from exhaustive
@Test(testName = "PUT /admin/network/{id}" )
@Test(description = "PUT /admin/network/{id}" )
public void testUpdateNetwork() {
//TODO: ensure network instanceof OrgNetwork, may require queries
assertTrue(network instanceof OrgNetwork, String.format(REF_REQ_LIVE, "OrgNetwork"));
@ -144,7 +144,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
}
}
@Test(testName = "POST /admin/network/{id}/action/reset")
@Test(description = "POST /admin/network/{id}/action/reset")
public void testResetNetwork() {
// TODO assert that network is deployed somehow
Task resetNetworkTask = networkClient.resetNetwork(networkRef.getHref());

View File

@ -25,10 +25,7 @@ import java.net.URI;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AdminOrg;
import org.jclouds.vcloud.director.v1_5.domain.CatalogsList;
import org.jclouds.vcloud.director.v1_5.domain.GroupsList;
import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Networks;
import org.jclouds.vcloud.director.v1_5.domain.OrgEmailSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgGeneralSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgLdapSettings;
@ -38,13 +35,11 @@ import org.jclouds.vcloud.director.v1_5.domain.OrgSettings;
import org.jclouds.vcloud.director.v1_5.domain.OrgVAppTemplateLeaseSettings;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.SmtpServerSettings;
import org.jclouds.vcloud.director.v1_5.domain.UsersList;
import org.jclouds.vcloud.director.v1_5.domain.Vdcs;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
import org.testng.annotations.Test;
/**
* Test the {@link GroupClient} by observing its side effects.
* Test the {@link AdminOrgClient} by observing its side effects.
*
* @author danikov
*/
@ -126,7 +121,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect
.fullName("JClouds")
.isEnabled(true)
.settings(settings())
.users(UsersList.builder()
.user(Reference.builder()
.type("application/vnd.vmware.admin.user+xml")
.name("adam.lowe@cloudsoftcorp.com")
@ -152,10 +146,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect
.name("adk@cloudsoftcorp.com")
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/user/e9eb1b29-0404-4c5e-8ef7-e584acc51da9"))
.build())
.build())
.groups(GroupsList.builder()
.build())
.catalogs(CatalogsList.builder()
.catalog(Reference.builder()
.type("application/vnd.vmware.admin.catalog+xml")
.name("QunyingTestCatalog")
@ -176,15 +166,11 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect
.name("test")
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/catalog/b7289d54-4ca4-497f-9a93-2d4afc97e3da"))
.build())
.build())
.vdcs(Vdcs.builder()
.vdc(Reference.builder()
.type("application/vnd.vmware.vcloud.vdc+xml")
.name("Cluster01-JClouds")
.href(URI.create("https://vcloudbeta.bluelock.com/api/vdc/d16d333b-e3c0-4176-845d-a5ee6392df07"))
.build())
.build())
.networks(Networks.builder()
.network(Reference.builder()
.type("application/vnd.vmware.admin.network+xml")
.name("ilsolation01-Jclouds")
@ -195,7 +181,6 @@ public class AdminOrgClientExpectTest extends BaseVCloudDirectorRestClientExpect
.name("internet01-Jclouds")
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/network/55a677cf-ab3f-48ae-b880-fab90421980c"))
.build())
.build())
.build();
}

View File

@ -77,21 +77,21 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertNotNull(orgRef, String.format(REF_REQ_LIVE, "admin org"));
}
@Test(testName = "GET /admin/org/{id}")
@Test(description = "GET /admin/org/{id}")
public void testGetAdminOrg() {
AdminOrg adminOrg = orgClient.getOrg(orgRef.getHref());
Checks.checkAdminOrg(adminOrg);
}
@Test(testName = "GET /admin/org/{id}/settings/email")
@Test(description = "GET /admin/org/{id}/settings/email")
public void testGetEmailSettings() {
emailSettings = orgClient.getEmailSettings(orgRef.getHref());
Checks.checkEmailSettings(emailSettings);
}
@Test(testName = "PUT /admin/org/{id}/settings/email",
@Test(description = "PUT /admin/org/{id}/settings/email",
dependsOnMethods = { "testGetEmailSettings" })
public void testUpdateEmailSettings() {
boolean isDefaultSmtpServer = emailSettings.isDefaultSmtpServer();
@ -159,14 +159,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/org/{id}/settings/general")
@Test(description = "GET /admin/org/{id}/settings/general")
public void testGetGeneralSettings() {
generalSettings = orgClient.getGeneralSettings(orgRef.getHref());
Checks.checkGeneralSettings(generalSettings);
}
@Test(testName = "PUT /admin/org/{id}/settings/general",
@Test(description = "PUT /admin/org/{id}/settings/general",
dependsOnMethods = { "testGetGeneralSettings" } )
public void testUpdateGeneralSettings() {
// FIXME: canPublishCatalogs does not update
@ -221,21 +221,21 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/org/{id}/settings/ldap")
@Test(description = "GET /admin/org/{id}/settings/ldap")
public void testGetLdapSettings() {
ldapSettings = orgClient.getLdapSettings(orgRef.getHref());
Checks.checkLdapSettings(ldapSettings);
}
@Test(testName = "GET /admin/org/{id}/settings/passwordPolicy")
@Test(description = "GET /admin/org/{id}/settings/passwordPolicy")
public void testGetPasswordPolicy() {
passwordPolicy = orgClient.getPasswordPolicy(orgRef.getHref());
Checks.checkPasswordPolicySettings(passwordPolicy);
}
@Test(testName = "PUT /admin/org/{id}/settings/passwordPolicy",
@Test(description = "PUT /admin/org/{id}/settings/passwordPolicy",
dependsOnMethods = { "testGetPasswordPolicy" })
public void testUpdatePasswordPolicy() {
boolean accountLockoutEnabled = passwordPolicy.isAccountLockoutEnabled();
@ -277,14 +277,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/org/{id}/settings/vAppLeaseSettings")
@Test(description = "GET /admin/org/{id}/settings/vAppLeaseSettings")
public void testGetVAppLeaseSettings() {
vAppLeaseSettings = orgClient.getVAppLeaseSettings(orgRef.getHref());
Checks.checkVAppLeaseSettings(vAppLeaseSettings);
}
@Test(testName = "PUT /admin/org/{id}/settings/vAppLeaseSettings",
@Test(description = "PUT /admin/org/{id}/settings/vAppLeaseSettings",
dependsOnMethods = { "testGetVAppLeaseSettings" } ) // FIXME: fails with 403 forbidden
public void testUpdateVAppLeaseSettings() {
boolean deleteOnStorageLeaseExpiration = vAppLeaseSettings.deleteOnStorageLeaseExpiration();
@ -326,14 +326,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings")
@Test(description = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings")
public void testGetVAppTemplateLeaseSettings() {
vAppTemplateLeaseSettings = orgClient.getVAppTemplateLeaseSettings(orgRef.getHref());
Checks.checkVAppTemplateLeaseSettings(vAppTemplateLeaseSettings);
}
@Test(testName = "PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings",
@Test(description = "PUT /admin/org/{id}/settings/vAppTemplateLeaseSettings",
dependsOnMethods = { "testGetVAppTemplateLeaseSettings" }) // FIXME: fails with 403 forbidden
public void testUpdateVAppTemplateLeaseSettings() {
boolean deleteOnStorageLeaseExpiration = vAppTemplateLeaseSettings.deleteOnStorageLeaseExpiration();
@ -369,14 +369,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/org/{id}/settings")
@Test(description = "GET /admin/org/{id}/settings")
public void testGetSettings() {
settings = orgClient.getSettings(orgRef.getHref());
Checks.checkOrgSettings(settings);
}
@Test(testName = "PUT /admin/org/{id}/settings",
@Test(description = "PUT /admin/org/{id}/settings",
dependsOnMethods = { "testGetEmailSettings" } )
public void testUpdateSettings() throws Exception {
String newFromEmailAddress = "test"+random.nextInt(Integer.MAX_VALUE)+"@test.com";

View File

@ -54,7 +54,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
queryClient = context.getApi().getAdminQueryClient();
}
@Test(testName = "GET /admin/groups/query")
@Test(description = "GET /admin/groups/query")
public void testQueryAllGroups() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.groupsQueryAll();
@ -64,7 +64,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/orgs/query")
@Test(description = "GET /admin/orgs/query")
public void testQueryAllOrgs() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.orgsQueryAll();
@ -74,7 +74,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/rights/query")
@Test(description = "GET /admin/rights/query")
public void testQueryAllRights() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.rightsQueryAll();
@ -85,7 +85,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/roles/query")
@Test(description = "GET /admin/roles/query")
public void testQueryAllRoles() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.rolesQueryAll();
@ -102,7 +102,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/strandedUsers/query")
@Test(description = "GET /admin/strandedUsers/query")
public void testQueryAllStrandedUsers() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.strandedUsersQueryAll();
@ -113,7 +113,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/users/query")
@Test(description = "GET /admin/users/query")
public void testQueryAllUsers() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.usersQueryAll();
@ -124,7 +124,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/vdcs/query")
@Test(description = "GET /admin/vdcs/query")
public void testQueryAllVdc() {
// TODO Ensure there will be at least one record, for asserting result
QueryResultRecords resultRecords = queryClient.vdcsQueryAll();

View File

@ -80,7 +80,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/vdc/{id}")
@Test(description = "GET /admin/vdc/{id}")
public void testGetVdc() {
AdminVdc vdc = vdcClient.getVdc(adminVdcUri);
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
@ -90,7 +90,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "PUT /admin/vdc/{id}", enabled=false)
@Test(description = "PUT /admin/vdc/{id}", enabled=false)
public void testEditVdc() throws Exception {
String origName = vdcClient.getVdc(adminVdcUri).getName();
String newName = name("a");
@ -128,7 +128,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "DELETE /admin/vdc/{id}", enabled=false)
@Test(description = "DELETE /admin/vdc/{id}", enabled=false)
public void testDeleteVdc() throws Exception {
// TODO Need to have a VDC that we're happy to delete!
Task task = vdcClient.deleteVdc(adminVdcUri);
@ -142,7 +142,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "DISABLE/ENABLE /admin/vdc/{id}", enabled=false)
@Test(description = "DISABLE/ENABLE /admin/vdc/{id}", enabled=false)
public void testDisableAndEnableVdc() throws Exception {
// TODO Need to have a VDC that we're happy to delete!
Exception exception = null;
@ -165,7 +165,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /admin/vdc/{id}/metadata")
@Test(description = "GET /admin/vdc/{id}/metadata")
public void testGetMetadata() throws Exception {
Metadata metadata = metadataClient.getMetadata(adminVdcUri);
@ -173,7 +173,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "PUT /admin/vdc/{id}/metadata", enabled=false)
@Test(description = "PUT /admin/vdc/{id}/metadata", enabled=false)
public void testSetMetadata() throws Exception {
metadataKey = name("key-");
metadataValue = name("value-");
@ -190,7 +190,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false)
@Test(description = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false)
public void testGetMetadataValue() throws Exception {
MetadataValue retrievedMetadataValue = metadataClient.getMetadataValue(adminVdcUri, metadataKey);
@ -198,7 +198,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "PUT /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }, enabled=false )
@Test(description = "PUT /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" }, enabled=false )
public void testSetMetadataValue() throws Exception {
metadataValue = name("value-");
MetadataValue newV = MetadataValue.builder().value(metadataValue).build();
@ -211,7 +211,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO insufficient permissions to test
@Test(testName = "DELETE /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }, enabled=false )
@Test(description = "DELETE /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" }, enabled=false )
public void testDeleteMetadataValue() throws Exception {
// TODO Remove dependency on other tests; make cleanUp delete a list of metadata entries?

View File

@ -27,7 +27,6 @@ import org.jclouds.http.HttpResponse;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItems;
import org.jclouds.vcloud.director.v1_5.domain.CatalogType;
import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
@ -376,7 +375,6 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT
assertEquals(client.getCatalogClient().getCatalogItemMetadataClient().deleteMetadataEntry(catalogItemURI, "KEY"), expected);
}
@SuppressWarnings("unchecked")
public static final CatalogType catalog() {
return CatalogType.builder()
.name("QunyingTestCatalog")
@ -398,18 +396,16 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT
.type("application/vnd.vmware.vcloud.metadata+xml")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/metadata"))
.build())
.catalogItems(CatalogItems.builder()
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("ubuntu10")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("imageTesting")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939"))
.build())
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("ubuntu10")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df"))
.build())
.item(Reference.builder()
.type("application/vnd.vmware.vcloud.catalogItem+xml")
.name("imageTesting")
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a9e0afdb-a42b-4688-8409-2ac68cf22939"))
.build())
.description("Testing")
.isPublished(false)
.build();

View File

@ -110,7 +110,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /catalog/{id}")
@Test(description = "GET /catalog/{id}")
public void testGetCatalog() {
CatalogType catalog = catalogClient.getCatalog(catalogRef.getHref());
assertNotNull(catalog);
@ -118,14 +118,14 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertEquals(catalog.getHref(), catalogRef.getHref());
}
@Test(testName = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
@Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
public void testGetCatalogItem() {
CatalogItem catalogItem = catalogClient.getCatalogItem(this.catalogItem.getHref());
checkCatalogItem(catalogItem);
assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref());
}
@Test(testName = "POST /catalog/{id}/catalogItems")
@Test(description = "POST /catalog/{id}/catalogItems")
public void testAddCatalogItem() {
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
@ -157,7 +157,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertEquals(catalogItem.getDescription(), "New Item");
}
@Test(testName = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
@Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
public void testUpdateCatalogItem() {
CatalogItem updatedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build();
catalogItem = catalogClient.updateCatalogItem(catalogItem.getHref(), updatedCatalogItem);
@ -166,7 +166,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// Note this runs after all the metadata tests
@Test(testName = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue")
@Test(description = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue")
public void testDeleteCatalogItem() {
catalogClient.deleteCatalogItem(catalogItem.getHref());
try {
@ -181,13 +181,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /catalog/{id}/metadata")
@Test(description = "GET /catalog/{id}/metadata")
public void testGetCatalogMetadata() {
Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref());
checkMetadata(catalogMetadata);
}
@Test(testName = "GET /catalog/{id}/metadata/{key}")
@Test(description = "GET /catalog/{id}/metadata/{key}")
public void testGetCatalogMetadataValue() {
Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref());
MetadataEntry existingMetadataEntry = Iterables.find(catalogMetadata.getMetadataEntries(), new Predicate<MetadataEntry>() {
@ -202,13 +202,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkMetadataValue(metadataValue);
}
@Test(testName = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
@Test(description = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
public void testGetCatalogItemMetadata() {
Metadata catalogItemMetadata = catalogClient.getCatalogItemMetadataClient().getMetadata(catalogItem.getHref());
checkMetadata(catalogItemMetadata);
}
@Test(testName = "POST /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
@Test(description = "POST /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
public void testMergeCatalogItemMetadata() {
Metadata newMetadata = Metadata.builder()
.entry(MetadataEntry.builder().entry("KEY", "MARMALADE").build())
@ -236,13 +236,13 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkMetadataValue(newKeyMetadataValue);
}
@Test(testName = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue")
@Test(description = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue")
public void testGetCatalogItemMetadataValue() {
MetadataValue metadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY");
checkMetadataValue(metadataValue);
}
@Test(testName = "PUT /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testMergeCatalogItemMetadata")
@Test(description = "PUT /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testMergeCatalogItemMetadata")
public void testSetCatalogItemMetadataValue() {
MetadataValue newMetadataValue = MetadataValue.builder().value("NEW").build();
@ -257,7 +257,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkMetadataValue(updatedMetadataValue);
}
@Test(testName = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue")
@Test(description = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue")
public void testDeleteCatalogItemMetadataValue() {
Task deleteCatalogItemMetadataValue = catalogClient.getCatalogItemMetadataClient().deleteMetadataEntry(catalogItem.getHref(), "KEY");
checkTask(deleteCatalogItemMetadataValue);

View File

@ -69,7 +69,7 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest {
// context.getApi().getAdminOrgClient().updateLdapSettings(newLdapSettings);
}
@Test(testName = "POST /admin/org/{id}/groups")
@Test(description = "POST /admin/org/{id}/groups")
public void testCreateGroup() {
fail("LDAP not configured, group client isn't currently testable.");
// group = groupClient.createGroup(orgUri, Group.builder()
@ -78,14 +78,14 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkGroup(group);
}
@Test(testName = "GET /admin/group/{id}", dependsOnMethods = { "testCreateGroup" })
@Test(description = "GET /admin/group/{id}", dependsOnMethods = { "testCreateGroup" })
public void testGetGroup() {
group = groupClient.getGroup(groupRef.getHref());
Checks.checkGroup(group);
}
@Test(testName = "PUT /admin/group/{id}", dependsOnMethods = { "testGetGroup" } )
@Test(description = "PUT /admin/group/{id}", dependsOnMethods = { "testGetGroup" } )
public void testUpdateGroup() {
String oldName = group.getName();
String newName = "new "+oldName;
@ -118,7 +118,7 @@ public class GroupClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "DELETE /admin/group/{id}", dependsOnMethods = { "testUpdateGroup" } )
@Test(description = "DELETE /admin/group/{id}", dependsOnMethods = { "testUpdateGroup" } )
public void testDeleteGroup() {
groupClient.deleteGroup(groupRef.getHref());

View File

@ -104,7 +104,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
private MetadataValue metadataValue;
private String metadataEntryValue = "value";
@Test(testName = "POST /vdc/{id}/media")
@Test(description = "POST /vdc/{id}/media")
public void testCreateMedia() throws URISyntaxException {
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
Vdc vdc = vdcClient.getVdc(vdcURI);
@ -154,7 +154,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" })
@Test(description = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" })
public void testGetMedia() {
media = mediaClient.getMedia(media.getHref());
assertNotNull(media, String.format(OBJ_REQ_LIVE, MEDIA));
@ -166,7 +166,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkMediaFor(MEDIA, media);
}
@Test(testName = "GET /media/{id}/owner",
@Test(description = "GET /media/{id}/owner",
dependsOnMethods = { "testGetMedia" })
public void testGetMediaOwner() {
Owner directOwner = mediaClient.getOwner(media.getHref());
@ -185,7 +185,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkReferenceType(directOwner.getUser());
}
@Test(testName = "POST /vdc/{id}/action/cloneMedia",
@Test(description = "POST /vdc/{id}/action/cloneMedia",
dependsOnMethods = { "testGetMediaOwner" })
public void testCloneMedia() {
oldMedia = media;
@ -235,7 +235,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
media.toString(), oldMedia.toString()));
}
@Test(testName = "PUT /media/{id}",
@Test(description = "PUT /media/{id}",
dependsOnMethods = { "testCloneMedia" })
public void testSetMedia() {
String oldName = media.getName();
@ -265,7 +265,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
media = mediaClient.getMedia(media.getHref());
}
@Test(testName = "GET /media/{id}/metadata",
@Test(description = "GET /media/{id}/metadata",
dependsOnMethods = { "testSetMetadataValue" })
public void testGetMetadata() {
metadata = mediaClient.getMetadataClient().getMetadata(media.getHref());
@ -276,7 +276,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkMetadataFor(MEDIA, metadata);
}
@Test(testName = "POST /media/{id}/metadata",
@Test(description = "POST /media/{id}/metadata",
dependsOnMethods = { "testGetMedia" })
public void testMergeMetadata() {
// test new
@ -329,14 +329,14 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /media/{id}/metadata/{key}",
@Test(description = "GET /media/{id}/metadata/{key}",
dependsOnMethods = { "testSetMetadataValue" })
public void testGetMetadataValue() {
metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "key");
Checks.checkMetadataValueFor(MEDIA, metadataValue);
}
@Test(testName = "PUT /media/{id}/metadata/{key}",
@Test(description = "PUT /media/{id}/metadata/{key}",
dependsOnMethods = { "testMergeMetadata" })
public void testSetMetadataValue() {
metadataEntryValue = "value";
@ -350,7 +350,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkMetadataValueFor(MEDIA, metadataValue);
}
@Test(testName = "DELETE /media/{id}/metadata/{key}",
@Test(description = "DELETE /media/{id}/metadata/{key}",
dependsOnMethods = { "testGetMetadata", "testGetMetadataValue" } )
public void testDeleteMetadata() {
Task deleteMetadataEntry = mediaClient.getMetadataClient().deleteMetadataEntry(media.getHref(), "testKey");
@ -387,7 +387,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkMediaFor(MEDIA, media);
}
@Test(testName = "DELETE /media/{id}",
@Test(description = "DELETE /media/{id}",
dependsOnMethods = { "testDeleteMetadata" } )
public void testDeleteMedia() {
Task deleteMedia = mediaClient.deleteMedia(media.getHref());

View File

@ -2,14 +2,14 @@
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
*(Link.builder().regarding copyright ownership. jclouds licenses this file
* 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(Link.builder().required by applicable law or agreed to in writing,
* 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
@ -72,7 +72,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
.deleteMetadataEntry(toAdminUri(networkURI), "key");
}
@Test(testName = "GET /network/{id}")
@Test(description = "GET /network/{id}")
public void testGetNetwork() {
// required for testing
assertNotNull(networkURI, String.format(REF_REQ_LIVE, NETWORK));
@ -87,7 +87,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkOrgNetwork(network);
}
@Test(testName = "GET /network/{id}/metadata")
@Test(description = "GET /network/{id}/metadata")
public void testGetMetadata() {
Metadata metadata = networkClient.getMetadataClient().getMetadata(networkURI);
// required for testing
@ -109,7 +109,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /network/{id}/metadata/{key}")
@Test(description = "GET /network/{id}/metadata/{key}")
public void testGetMetadataValue() {
MetadataValue metadataValue = networkClient.getMetadataClient().getMetadataValue(networkURI, "key");

View File

@ -66,7 +66,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
orgClient = context.getApi().getOrgClient();
}
@AfterClass(groups = { "live" })
@AfterClass(alwaysRun = true)
public void cleanUp() throws Exception {
if (metadataSet) {
context.getApi().getAdminOrgClient().getMetadataClient()
@ -83,7 +83,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
private Org org;
private boolean metadataSet = false;
@Test(testName = "GET /org")
@Test(description = "GET /org")
public void testGetOrgList() {
// Call the method being tested
orgList = orgClient.getOrgList();
@ -99,7 +99,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" })
@Test(description = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" })
public void testGetOrg() {
Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null);
assertNotNull(orgRef);
@ -112,14 +112,14 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkOrg(org);
}
@Test(testName = "orgClient admin metadata setup", dependsOnMethods = { "testGetOrg" })
@Test(description = "orgClient admin metadata setup", dependsOnMethods = { "testGetOrg" })
public void testSetupMetadata() {
context.getApi().getAdminOrgClient().getMetadataClient().setMetadata(toAdminUri(orgURI),
"KEY", MetadataValue.builder().value("VALUE").build());
metadataSet = true;
}
@Test(testName = "GET /org/{id}/metadata", dependsOnMethods = { "testSetupMetadata" })
@Test(description = "GET /org/{id}/metadata", dependsOnMethods = { "testSetupMetadata" })
public void testGetOrgMetadata() {
// Call the method being tested
Metadata metadata = orgClient.getMetadataClient().getMetadata(orgURI);
@ -132,7 +132,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()), String.format(NOT_EMPTY_OBJECT_FMT, "MetadataEntry", "Org"));
}
@Test(testName = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" })
@Test(description = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" })
public void testGetOrgMetadataValue() {
// Call the method being tested
MetadataValue value = orgClient.getMetadataClient().getMetadataValue(orgURI, "KEY");
@ -145,7 +145,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertEquals(value.getValue(), expected, String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", expected, value.getValue()));
}
@Test(testName = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" })
@Test(description = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" })
public void testGetControlAccess() {
// Call the method being tested
ControlAccessParams params = orgClient.getControlAccess(orgURI, catalogId);
@ -154,7 +154,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
checkControlAccessParams(params);
}
@Test(testName = "GET /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" })
@Test(description = "GET /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" })
public void testModifyControlAccess() {
// Setup params
ControlAccessParams params = orgClient.getControlAccess(orgURI, catalogId);

View File

@ -89,7 +89,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
vAppClient = context.getApi().getVAppClient();
}
@Test(testName = "GET /entity/{id}")
@Test(description = "GET /entity/{id}")
public void testEntity() {
// Get a VAppTemplate to look up as an entity
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
@ -107,7 +107,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
@Test(testName = "GET /query")
@Test(description = "GET /query")
public void testQuery() {
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
QueryResultRecords queryResult = queryClient.query("vAppTemplate", String.format("name==%s", vAppTemplate.getName()));
@ -117,19 +117,19 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should include vAppTemplate "+vAppTemplateURI+"; but only has "+hrefs);
}
@Test(testName = "GET /catalogs/query")
@Test(description = "GET /catalogs/query")
public void testQueryAllCatalogs() {
QueryResultRecords catalogRecords = queryClient.catalogsQueryAll();
assertFalse(catalogRecords.getRecords().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogRecord", "QueryResultRecords"));
}
@Test(testName = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" })
@Test(description = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" })
public void testQueryAllCatalogReferences() {
CatalogReferences catalogReferences = queryClient.catalogReferencesQueryAll();
assertFalse(catalogReferences.getReferences().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogReference", "CatalogReferences"));
}
@Test(testName = "GET /vAppTemplates/query")
@Test(description = "GET /vAppTemplates/query")
public void testQueryAllVAppTemplates() {
QueryResultRecords queryResult = queryClient.vAppTemplatesQueryAll();
Set<URI> hrefs = toHrefs(queryResult);
@ -138,7 +138,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should include vAppTemplate "+vAppTemplateURI+"; but only has "+hrefs);
}
@Test(testName = "GET /vAppTemplates/query?filter)")
@Test(description = "GET /vAppTemplates/query?filter")
public void testQueryVAppTemplatesWithFilter() {
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
QueryResultRecords queryResult = queryClient.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName()));
@ -148,7 +148,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertTrue(hrefs.contains(vAppTemplateURI), "VAppTemplates query result should have found vAppTemplate "+vAppTemplateURI);
}
@Test(testName = "GET /vApps/query")
@Test(description = "GET /vApps/query")
public void testQueryAllVApps() {
vApp = instantiateVApp();
@ -159,7 +159,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertTrue(hrefs.contains(vApp.getHref()), "VApp query result should include vapp "+vApp.getHref()+"; but only has "+hrefs);
}
@Test(testName = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } )
@Test(description = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } )
public void testQueryVAppsWithFilter() {
QueryResultRecords queryResult = queryClient.vAppsQuery(String.format("name==%s", vApp.getName()));
Set<URI> hrefs = toHrefs(queryResult);
@ -168,7 +168,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertEquals(hrefs, Collections.singleton(vApp.getHref()), "VApps query result should have found vApp "+vApp.getHref());
}
@Test(testName = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" } )
@Test(description = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" } )
public void testQueryAllVms() {
// Wait for vApp to have been entirely instantiated
Task instantiateTask = Iterables.getFirst(vApp.getTasks(), null);
@ -192,7 +192,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertTrue(hrefs.containsAll(vmHrefs), "VMs query result should include vms "+vmHrefs+"; but only has "+hrefs);
}
@Test(testName = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" } )
@Test(description = "GET /vms/query?filter", dependsOnMethods = { "testQueryAllVms" } )
public void testQueryAllVmsWithFilter() {
List<Vm> vms = vApp.getChildren().getVms();
Set<URI> vmHrefs = toHrefs(vms);
@ -204,14 +204,14 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertEquals(hrefs, vmHrefs, "VMs query result should equal vms of vApp "+vApp.getName()+" ("+vmHrefs+"); but only has "+hrefs);
}
@Test(testName = "GET /mediaList/query")
@Test(description = "GET /mediaList/query")
public void testQueryAllMedia() {
QueryResultRecords queryResult = queryClient.mediaListQueryAll();
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
}
@Test(testName = "GET /mediaList/query?filter")
@Test(description = "GET /mediaList/query?filter")
public void testQueryMediaWithFilter() {
String mediaName = "abc";
QueryResultRecords queryResult = queryClient.mediaListQuery(String.format("name==%s", mediaName));

View File

@ -77,7 +77,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
if (vApp != null) cleanUpVApp(vApp);
}
@Test(testName = "GET /tasksList/{id}")
@Test(description = "GET /tasksList/{id}")
public void testGetTaskList() {
orgList = orgClient.getOrgList();
Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null);
@ -97,7 +97,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "GET /task/{id}", dependsOnMethods = { "testGetTaskList" })
@Test(description = "GET /task/{id}", dependsOnMethods = { "testGetTaskList" })
public void testGetTask() {
//TODO: upload media or something so you can get a fresh cancellable task?
@ -113,7 +113,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
// FIXME cancelTask complains "This task can not be canceled"
// However, when I do this through the UI, I can cancel the task for instantiating a vApp.
@Test(testName = "POST /task/{id}/action/cancel", dependsOnMethods = { "testGetTask" })
@Test(description = "POST /task/{id}/action/cancel", dependsOnMethods = { "testGetTask" })
public void testCancelTask() {
vApp = instantiateVApp();

View File

@ -43,7 +43,7 @@ public class UploadClientLiveTest extends BaseVCloudDirectorClientLiveTest {
uploadClient = context.getApi().getUploadClient();
}
@Test(testName = "PUT ???", enabled = false)
@Test(description = "PUT ???", enabled = false)
public void testUpload() {
}
}

View File

@ -89,14 +89,14 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "POST /admin/org/{id}/users")
@Test(description = "POST /admin/org/{id}/users")
public void testCreateUser() {
User newUser = randomTestUser("testCreateUser", context);
user = userClient.createUser(orgRef.getHref(), newUser);
Checks.checkUser(newUser);
}
@Test(testName = "GET /admin/user/{id}",
@Test(description = "GET /admin/user/{id}",
dependsOnMethods = { "testCreateUser" })
public void testGetUser() {
user = userClient.getUser(user.getHref());
@ -104,7 +104,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkUser(user);
}
@Test(testName = "PUT /admin/user/{id}",
@Test(description = "PUT /admin/user/{id}",
dependsOnMethods = { "testGetUser" })
public void testUpdateUser() {
User oldUser = user.toBuilder().build();
@ -162,7 +162,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
sessionClient.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
}
@Test(testName = "POST /admin/user/{id}/action/unlock", dependsOnMethods = { "testUpdateUser" })
@Test(description = "POST /admin/user/{id}/action/unlock", dependsOnMethods = { "testUpdateUser" })
public void testUnlockUser() {
// Need to know how many times to fail login to lock account
AdminOrgClient adminOrgClient = context.getApi().getAdminOrgClient();
@ -216,7 +216,7 @@ public class UserClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
}
@Test(testName = "DELETE /admin/user/{id}",
@Test(description = "DELETE /admin/user/{id}",
dependsOnMethods = { "testCreateUser" } )
public void testDeleteUser() {
// Create a user to be deleted (so we remove dependencies on test ordering)

View File

@ -64,7 +64,6 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.domain.AccessSetting;
import org.jclouds.vcloud.director.v1_5.domain.AccessSettings;
import org.jclouds.vcloud.director.v1_5.domain.Checks;
import org.jclouds.vcloud.director.v1_5.domain.ControlAccessParams;
import org.jclouds.vcloud.director.v1_5.domain.DeployVAppParams;
@ -125,7 +124,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
/**
* @see VAppClient#getVApp(URI)
*/
@Test(testName = "GET /vApp/{id}")
@Test(description = "GET /vApp/{id}")
public void testGetVApp() {
// The method under test
vApp = vAppClient.getVApp(vAppURI);
@ -148,7 +147,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
/**
* @see VAppClient#modifyVApp(URI, VApp)
*/
@Test(testName = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
@Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
public void testModifyVApp() {
VApp newVApp = VApp.builder()
.name(name("new-name-"))
@ -168,7 +167,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(vApp.getDescription(), newVApp.getDescription(), String.format(OBJ_FIELD_EQ, VAPP, "Description", newVApp.getDescription(), vApp.getDescription()));
}
@Test(testName = "POST /vApp/{id}/action/deploy", dependsOnMethods = { "testGetVApp" })
@Test(description = "POST /vApp/{id}/action/deploy", dependsOnMethods = { "testGetVApp" })
public void testDeployVApp() {
DeployVAppParams params = DeployVAppParams.builder()
.deploymentLeaseSeconds((int) TimeUnit.SECONDS.convert(1L, TimeUnit.HOURS))
@ -190,7 +189,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_OFF);
}
@Test(testName = "POST /vApp/{id}/power/action/powerOn", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/powerOn", dependsOnMethods = { "testDeployVApp" })
public void testPowerOnVApp() {
// Power off VApp
vApp = powerOff(vApp);
@ -206,7 +205,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_ON);
}
@Test(testName = "POST /vApp/{id}/power/action/reboot", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/reboot", dependsOnMethods = { "testDeployVApp" })
public void testReboot() {
// Power on VApp
vApp = powerOn(vApp);
@ -222,7 +221,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_OFF);
}
@Test(testName = "POST /vApp/{id}/power/action/shutdown", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/shutdown", dependsOnMethods = { "testDeployVApp" })
public void testShutdown() {
// Power on VApp
vApp = powerOn(vApp);
@ -241,7 +240,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
vApp = powerOn(vApp);
}
@Test(testName = "POST /vApp/{id}/power/action/suspend", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/suspend", dependsOnMethods = { "testDeployVApp" })
public void testSuspend() {
// Power on VApp
vApp = powerOn(vApp);
@ -260,7 +259,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
vApp = powerOn(vApp);
}
@Test(testName = "POST /vApp/{id}/power/action/reset", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/reset", dependsOnMethods = { "testDeployVApp" })
public void testReset() {
// Power on VApp
vApp = powerOn(vApp);
@ -276,7 +275,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_ON);
}
@Test(testName = "POST /vApp/{id}/action/undeploy", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/action/undeploy", dependsOnMethods = { "testDeployVApp" })
public void testUndeployVApp() {
// Power on VApp
vApp = powerOn(vApp);
@ -295,7 +294,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_OFF);
}
@Test(testName = "POST /vApp/{id}/power/action/powerOff", dependsOnMethods = { "testUndeployVApp" })
@Test(description = "POST /vApp/{id}/power/action/powerOff", dependsOnMethods = { "testUndeployVApp" })
public void testPowerOffVApp() {
// Power on VApp
vApp = powerOn(vApp);
@ -311,7 +310,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertVAppStatus(vAppURI, Status.POWERED_OFF);
}
@Test(testName = "POST /vApp/{id}/action/consolidate", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/action/consolidate", dependsOnMethods = { "testDeployVApp" })
public void testConsolidateVApp() {
// Power on VApp
vApp = powerOn(vApp);
@ -321,15 +320,13 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(consolidateVApp), String.format(TASK_COMPLETE_TIMELY, "consolidateVApp"));
}
@Test(testName = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testGetVApp" })
@Test(description = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testGetVApp" })
public void testControlAccessUser() {
ControlAccessParams params = ControlAccessParams.builder()
.notSharedToEveryone()
.accessSettings(AccessSettings.builder()
.accessSetting(AccessSetting.builder()
.subject(Reference.builder().href(userURI).type(ADMIN_USER).build())
.accessLevel("ReadOnly")
.build())
.accessSetting(AccessSetting.builder()
.subject(Reference.builder().href(userURI).type(ADMIN_USER).build())
.accessLevel("ReadOnly")
.build())
.build();
@ -342,7 +339,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, params, String.format(ENTITY_EQUAL, "ControlAccessParams"));
}
@Test(testName = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testControlAccessUser" })
@Test(description = "POST /vApp/{id}/action/controlAccess", dependsOnMethods = { "testControlAccessUser" })
public void testControlAccessEveryone() {
ControlAccessParams params = ControlAccessParams.builder()
.sharedToEveryone()
@ -359,7 +356,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, params, String.format(ENTITY_EQUAL, "ControlAccessParams"));
}
@Test(testName = "POST /vApp/{id}/action/discardSuspendedState", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/action/discardSuspendedState", dependsOnMethods = { "testDeployVApp" })
public void testDiscardSuspendedState() {
// Suspend the VApp
vApp = suspend(vAppURI);
@ -369,7 +366,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
}
@Test(testName = "POST /vApp/{id}/action/enterMaintenanceMode")
@Test(description = "POST /vApp/{id}/action/enterMaintenanceMode")
public void testEnterMaintenanceMode() {
// Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only
VApp temp = instantiateVApp();
@ -395,7 +392,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
}
@Test(testName = "POST /vApp/{id}/action/exitMaintenanceMode", dependsOnMethods = { "testEnterMaintenanceMode" })
@Test(description = "POST /vApp/{id}/action/exitMaintenanceMode", dependsOnMethods = { "testEnterMaintenanceMode" })
public void testExitMaintenanceMode() {
// Do this to a new vApp, so don't mess up subsequent tests by making the vApp read-only
VApp temp = instantiateVApp();
@ -421,7 +418,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
}
@Test(testName = "POST /vApp/{id}/action/installVMwareTools", dependsOnMethods = { "testDeployVApp" })
@Test(description = "POST /vApp/{id}/action/installVMwareTools", dependsOnMethods = { "testDeployVApp" })
public void testInstallVMwareTools() {
// First ensure the vApp is powered n
vApp = powerOn(vApp);
@ -434,7 +431,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
// FIXME "Could not bind object to request[method=POST, endpoint=https://mycloud.greenhousedata.com/api/vApp/vapp-e124f3f0-adb9-4268-ad49-e54fb27e40af/action/recomposeVApp,
// headers={Accept=[application/vnd.vmware.vcloud.task+xml]}, payload=[content=true, contentMetadata=[contentDisposition=null, contentEncoding=null, contentLanguage=null,
// contentLength=0, contentMD5=null, contentType=application/vnd.vmware.vcloud.recomposeVAppParams+xml], written=false]]: Could not marshall object"
@Test(testName = "POST /vApp/{id}/action/recomposeVApp", dependsOnMethods = { "testGetVApp" })
@Test(description = "POST /vApp/{id}/action/recomposeVApp", dependsOnMethods = { "testGetVApp" })
public void testRecomposeVApp() {
RecomposeVAppParams params = RecomposeVAppParams.builder().build();
@ -444,7 +441,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
// NOTE This test is disabled, as it is not possible to look up datastores using the User API
@Test(testName = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVApp" })
@Test(description = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVApp" })
public void testRelocate() {
// Relocate to the last of the available datastores
QueryResultRecords records = context.getApi().getQueryClient().queryAll("datastore");
@ -456,7 +453,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(relocate), String.format(TASK_COMPLETE_TIMELY, "relocate"));
}
@Test(testName = "POST /vApp/{id}/action/upgradeHardwareVersion", dependsOnMethods = { "testGetVApp" })
@Test(description = "POST /vApp/{id}/action/upgradeHardwareVersion", dependsOnMethods = { "testGetVApp" })
public void testUpgradeHardwareVersion() {
// Power off VApp
vApp = powerOff(vApp);
@ -466,7 +463,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(upgradeHardwareVersion), String.format(TASK_COMPLETE_TIMELY, "upgradeHardwareVersion"));
}
@Test(testName = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" })
public void testGetControlAccess() {
// The method under test
ControlAccessParams controlAccess = vAppClient.getControlAccess(vApp.getHref());
@ -475,7 +472,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkControlAccessParams(controlAccess);
}
@Test(testName = "GET /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetVApp" })
public void testGetGuestCustomizationSection() {
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
@Override
@ -485,7 +482,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
});
}
@Test(testName = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
@Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
public void testModifyGuestCustomizationSection() {
// Copy existing section and update fields
GuestCustomizationSection oldSection = vAppClient.getGuestCustomizationSection(vm.getHref());
@ -516,7 +513,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "GuestCustomizationSection"));
}
@Test(testName = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" })
public void testGetLeaseSettingsSection() {
// The method under test
LeaseSettingsSection section = vAppClient.getLeaseSettingsSection(vApp.getHref());
@ -525,7 +522,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkLeaseSettingsSection(section);
}
@Test(testName = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" })
@Test(description = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" })
public void testModifyLeaseSettingsSection() {
// Copy existing section
LeaseSettingsSection oldSection = vAppClient.getLeaseSettingsSection(vApp.getHref());
@ -575,7 +572,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME "Error: The requested operation on media "com.vmware.vcloud.entity.media:abfcb4b7-809f-4b50-a0aa-8c97bf09a5b0" is not supported in the current state."
@Test(testName = "PUT /vApp/{id}/media/action/insertMedia", dependsOnMethods = { "testGetVApp" })
@Test(description = "PUT /vApp/{id}/media/action/insertMedia", dependsOnMethods = { "testGetVApp" })
public void testInsertMedia() {
// Setup media params from configured media id
MediaInsertOrEjectParams params = MediaInsertOrEjectParams.builder()
@ -587,7 +584,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(insertMedia), String.format(TASK_COMPLETE_TIMELY, "insertMedia"));
}
@Test(testName = "PUT /vApp/{id}/media/action/ejectMedia", dependsOnMethods = { "testInsertMedia" })
@Test(description = "PUT /vApp/{id}/media/action/ejectMedia", dependsOnMethods = { "testInsertMedia" })
public void testEjectMedia() {
// Setup media params from configured media id
MediaInsertOrEjectParams params = MediaInsertOrEjectParams.builder()
@ -599,7 +596,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertTrue(retryTaskSuccess.apply(ejectMedia), String.format(TASK_COMPLETE_TIMELY, "ejectMedia"));
}
@Test(testName = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" })
public void testGetNetworkConfigSection() {
// The method under test
NetworkConfigSection section = vAppClient.getNetworkConfigSection(vApp.getHref());
@ -608,7 +605,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkNetworkConfigSection(section);
}
@Test(testName = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" })
@Test(description = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" })
public void testModifyNetworkConfigSection() {
// Copy existing section and update fields
NetworkConfigSection oldSection = vAppClient.getNetworkConfigSection(vApp.getHref());
@ -632,7 +629,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "NetworkConfigSection"));
}
@Test(testName = "GET /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetVApp" })
public void testGetNetworkConnectionSection() {
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
@Override
@ -643,7 +640,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME "Task error: Unable to perform this action. Contact your cloud administrator."
@Test(testName = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetNetworkConnectionSection" })
@Test(description = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testGetNetworkConnectionSection" })
public void testModifyNetworkConnectionSection() {
// Look up a network in the Vdc
Set<Reference> networks = vdc.getAvailableNetworks();
@ -675,7 +672,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newSection, String.format(ENTITY_EQUAL, "NetworkConnectionSection"));
}
@Test(testName = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" })
public void testGetNetworkSection() {
// The method under test
NetworkSection section = vAppClient.getNetworkSection(vApp.getHref());
@ -684,7 +681,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkNetworkSection(section);
}
@Test(testName = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVApp" })
public void testGetOperatingSystemSection() {
// The method under test
OperatingSystemSection section = vAppClient.getOperatingSystemSection(vm.getHref());
@ -693,7 +690,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkOperatingSystemSection(section);
}
@Test(testName = "PUT /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetOperatingSystemSection", "testModifyVirtualHardwareSection" })
@Test(description = "PUT /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetOperatingSystemSection", "testModifyVirtualHardwareSection" })
public void testModifyOperatingSystemSection() {
// Create new OperatingSystemSection
OperatingSystemSection newSection = OperatingSystemSection.builder()
@ -716,7 +713,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified.getId(), newSection.getId());
}
@Test(testName = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" })
public void testGetOwner() {
// The method under test
Owner owner = vAppClient.getOwner(vApp.getHref());
@ -725,7 +722,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkOwner(owner);
}
@Test(testName = "PUT /vApp/{id}/owner", dependsOnMethods = { "testGetOwner" })
@Test(description = "PUT /vApp/{id}/owner", dependsOnMethods = { "testGetOwner" })
public void testModifyOwner() {
Owner newOwner = Owner.builder().user(Reference.builder().href(userURI).type(ADMIN_USER).build()).build();
@ -742,7 +739,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified.getUser().getHref(), newOwner.getUser().getHref());
}
@Test(testName = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" })
public void testGetProductSections() {
// The method under test
ProductSectionList sectionList = vAppClient.getProductSections(vApp.getHref());
@ -751,7 +748,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkProductSectionList(sectionList);
}
@Test(testName = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
@Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
public void testModifyProductSections() {
// Copy existing section and update fields
ProductSectionList oldSections = vAppClient.getProductSections(vApp.getHref());
@ -783,7 +780,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME How do we force it to ask a question?
@Test(testName = "GET /vApp/{id}/question", dependsOnMethods = { "testDeployVApp" })
@Test(description = "GET /vApp/{id}/question", dependsOnMethods = { "testDeployVApp" })
public void testGetPendingQuestion() {
// Power on VApp
vApp = powerOn(vAppURI);
@ -797,7 +794,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkVmPendingQuestion(question);
}
@Test(testName = "POST /vApp/{id}/question/action/answer", dependsOnMethods = { "testGetPendingQuestion" })
@Test(description = "POST /vApp/{id}/question/action/answer", dependsOnMethods = { "testGetPendingQuestion" })
public void testAnswerQuestion() {
// TODO check that the question has been answered (e.g. asking for getPendingQuestion does not
// include our answered question).
@ -815,7 +812,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
vAppClient.answerQuestion(vm.getHref(), answer);
}
@Test(testName = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVApp" })
public void testGetRuntimeInfoSection() {
// The method under test
RuntimeInfoSection section = vAppClient.getRuntimeInfoSection(vm.getHref());
@ -825,7 +822,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME If still failing, consider escalating?
@Test(testName = "GET /vApp/{id}/screen", dependsOnMethods = { "testDeployVApp" })
@Test(description = "GET /vApp/{id}/screen", dependsOnMethods = { "testDeployVApp" })
public void testGetScreenImage() {
// Power on VApp
vApp = powerOn(vApp);
@ -842,7 +839,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
}
}
@Test(testName = "GET /vApp/{id}/screen/action/acquireTicket", dependsOnMethods = { "testDeployVApp" })
@Test(description = "GET /vApp/{id}/screen/action/acquireTicket", dependsOnMethods = { "testDeployVApp" })
public void testGetScreenTicket() {
// Power on VApp
vApp = powerOn(vApp);
@ -854,7 +851,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkScreenTicket(ticket);
}
@Test(testName = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" })
public void testGetStartupSection() {
// The method under test
StartupSection section = vAppClient.getStartupSection(vApp.getHref());
@ -863,7 +860,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkStartupSection(section);
}
@Test(testName = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" })
@Test(description = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" })
public void testModifyStartupSection() {
// Copy existing section and update fields
StartupSection oldSection = vAppClient.getStartupSection(vApp.getHref());
@ -884,7 +881,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newSection);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVApp" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVApp" })
public void testGetVirtualHardwareSection() {
// Method under test
VirtualHardwareSection hardware = vAppClient.getVirtualHardwareSection(vm.getHref());
@ -893,7 +890,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkVirtualHardwareSection(hardware);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testModifyVirtualHardwareSection() {
// Power off VApp
vApp = powerOff(vApp);
@ -941,7 +938,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modifiedSection, newSection);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionCpu() {
// Method under test
ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vm.getHref());
@ -950,7 +947,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkResourceAllocationSettingData(rasd);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" })
public void testModifyVirtualHardwareSectionCpu() {
// Copy existing section and update fields
ResourceAllocationSettingData oldItem = vAppClient.getVirtualHardwareSectionCpu(vm.getHref());
@ -975,7 +972,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newItem);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionDisks() {
// Method under test
RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionDisks(vm.getHref());
@ -984,7 +981,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkRasdItemsList(rasdItems);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" })
public void testModifyVirtualHardwareSectionDisks() {
// Copy the existing items list and modify the name of an item
RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionDisks(vm.getHref());
@ -1020,7 +1017,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
// checkHasMatchingItem("virtualHardwareSection/disk", modified, item0InstanceId, item0ElementName);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionMedia() {
// Method under test
RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionMedia(vm.getHref());
@ -1029,7 +1026,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkRasdItemsList(rasdItems);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionMemory() {
// Method under test
ResourceAllocationSettingData rasd = vAppClient.getVirtualHardwareSectionCpu(vm.getHref());
@ -1038,7 +1035,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkResourceAllocationSettingData(rasd);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" })
public void testModifyVirtualHardwareSectionMemory() {
ResourceAllocationSettingData origItem = vAppClient.getVirtualHardwareSectionMemory(vm.getHref());
ResourceAllocationSettingData newItem = origItem.toBuilder()
@ -1062,7 +1059,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified, newItem);
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionNetworkCards() {
// Method under test
RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionNetworkCards(vm.getHref());
@ -1071,7 +1068,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkRasdItemsList(rasdItems);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" })
public void testModifyVirtualHardwareSectionNetworkCards() {
RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionNetworkCards(vm.getHref());
RasdItemsList newSection = oldSection.toBuilder().build();
@ -1091,7 +1088,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
// See the description in testModifyVirtualHardwareSectionDisks
}
@Test(testName = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" })
@Test(description = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" })
public void testGetVirtualHardwareSectionSerialPorts() {
// Method under test
RasdItemsList rasdItems = vAppClient.getVirtualHardwareSectionSerialPorts(vm.getHref());
@ -1100,7 +1097,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkRasdItemsList(rasdItems);
}
@Test(testName = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" })
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" })
public void testModifyVirtualHardwareSectionSerialPorts() {
RasdItemsList oldSection = vAppClient.getVirtualHardwareSectionSerialPorts(vm.getHref());
RasdItemsList newSection = oldSection.toBuilder().build();
@ -1120,7 +1117,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
// See the description in testModifyVirtualHardwareSectionDisks
}
@Test(testName = "PUT /vApp/{id}/metadata", dependsOnMethods = { "testGetVApp" })
@Test(description = "PUT /vApp/{id}/metadata", dependsOnMethods = { "testGetVApp" })
public void testSetMetadataValue() {
key = name("key-");
String value = name("value-");
@ -1134,7 +1131,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkMetadataValueFor(VAPP, newMetadataValue, value);
}
@Test(testName = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
@Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
public void testGetMetadata() {
// Call the method being tested
Metadata metadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
@ -1145,7 +1142,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()), String.format(NOT_EMPTY_OBJECT_FMT, "MetadataEntry", "vApp"));
}
@Test(testName = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
@Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
public void testGetOrgMetadataValue() {
// Call the method being tested
MetadataValue value = vAppClient.getMetadataClient().getMetadataValue(vApp.getHref(), key);
@ -1156,7 +1153,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(value.getValue(), expected, String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", expected, value.getValue()));
}
@Test(testName = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
@Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
public void testDeleteMetadataEntry() {
// Delete the entry
Task task = vAppClient.getMetadataClient().deleteMetadataEntry(vApp.getHref(), key);
@ -1169,7 +1166,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
checkMetadataKeyAbsentFor(VAPP, newMetadata, key);
}
@Test(testName = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
@Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
public void testMergeMetadata() {
Metadata oldMetadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
Map<String, String> oldMetadataMap = Checks.metadataToMap(oldMetadata);
@ -1197,7 +1194,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
/**
* @see VAppClient#deleteVApp(URI)
*/
@Test(testName = "DELETE /vApp/{id}")
@Test(description = "DELETE /vApp/{id}")
public void testDeleteVApp() {
// Create a temporary VApp to delete
VApp temp = instantiateVApp();

View File

@ -96,7 +96,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
return clonedVappTemplate;
}
@Test(testName = "GET /vAppTemplate/{id}")
@Test(description = "GET /vAppTemplate/{id}")
public void testGetVAppTemplate() {
vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
@ -104,7 +104,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(vAppTemplate.getHref(), vAppTemplateURI);
}
@Test(testName = "GET /vAppTemplate/{id}/owner")
@Test(description = "GET /vAppTemplate/{id}/owner")
public void testGetVAppTemplateOwner() {
Owner owner = vAppTemplateClient.getOwnerOfVAppTemplate(vAppTemplateURI);
@ -112,21 +112,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(owner.getUser(), vAppTemplateClient.getVAppTemplate(vAppTemplateURI).getOwner().getUser());
}
@Test(testName = "GET /vAppTemplate/{id}/customizationSection")
@Test(description = "GET /vAppTemplate/{id}/customizationSection")
public void testGetCustomizationSection() {
CustomizationSection customizationSection = vAppTemplateClient.getVAppTemplateCustomizationSection(vAppTemplateURI);
checkCustomizationSection(customizationSection);
}
@Test(testName = "GET /vAppTemplate/{id}/productSections")
@Test(description = "GET /vAppTemplate/{id}/productSections")
public void testGetProductSections() {
ProductSectionList productSectionList = vAppTemplateClient.getProductSectionsForVAppTemplate(vAppTemplateURI);
checkProductSectionList(productSectionList);
}
@Test(testName = "PUT /vAppTemplate/{id}/productSections")
@Test(description = "PUT /vAppTemplate/{id}/productSections")
public void testEditProductSections() {
// TODO make a real modification
@ -140,7 +140,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
checkProductSectionList(modified);
}
@Test(testName = "GET /vAppTemplate/{id}/guestCustomizationSection")
@Test(description = "GET /vAppTemplate/{id}/guestCustomizationSection")
public void testGetGuestCustomizationSection() {
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
@Override
@ -150,7 +150,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
});
}
@Test(testName = "GET /vAppTemplate/{id}/leaseSettingsSection")
@Test(description = "GET /vAppTemplate/{id}/leaseSettingsSection")
public void testGetLeaseSettingsSection() {
// FIXME Wrong case for Vapp
LeaseSettingsSection leaseSettingsSection = vAppTemplateClient.getVappTemplateLeaseSettingsSection(vAppTemplateURI);
@ -158,7 +158,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
checkLeaseSettingsSection(leaseSettingsSection);
}
@Test(testName = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" })
@Test(description = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" })
public void testGetVAppTemplateMetadata() {
Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
@ -166,7 +166,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
}
// implicitly tested by testEditVAppTemplateMetadataValue, which first creates the metadata entry; otherwise no entry may exist
@Test(testName = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" })
@Test(description = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" })
public void testGetMetadataValue() {
Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
MetadataEntry entry = Iterables.get(metadata.getMetadataEntries(), 0);
@ -177,14 +177,14 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(val.getValue(), entry.getValue());
}
@Test(testName = "GET /vAppTemplate/{id}/networkConfigSection")
@Test(description = "GET /vAppTemplate/{id}/networkConfigSection")
public void testGetVAppTemplateNetworkConfigSection() {
NetworkConfigSection networkConfigSection = vAppTemplateClient.getVAppTemplateNetworkConfigSection(vAppTemplateURI);
checkNetworkConfigSection(networkConfigSection);
}
@Test(testName = "GET /vAppTemplate/{id}/networkConnectionSection")
@Test(description = "GET /vAppTemplate/{id}/networkConnectionSection")
public void testGetNetworkConnectionSection() {
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
@Override
@ -194,21 +194,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
});
}
@Test(testName = "GET /vAppTemplate/{id}/networkSection")
@Test(description = "GET /vAppTemplate/{id}/networkSection")
public void testGetVAppTemplateNetworkSection() {
NetworkSection networkSection = vAppTemplateClient.getVAppTemplateNetworkSection(vAppTemplateURI);
checkOvfNetworkSection(networkSection);
}
@Test(testName = "GET /vAppTemplate/{id}/ovf")
@Test(description = "GET /vAppTemplate/{id}/ovf")
public void testGetVAppTemplateOvf() {
Envelope envelope = vAppTemplateClient.getVAppTemplateOvf(vAppTemplateURI);
checkOvfEnvelope(envelope);
}
@Test(testName = "PUT /vAppTemplate/{id}")
@Test(description = "PUT /vAppTemplate/{id}")
public void testEditVAppTemplate() {
String name = name("myname-");
String description = name("Description ");
@ -225,7 +225,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(newTemplate.getDescription(), description);
}
@Test(testName = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" })
@Test(description = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" })
public void testEditMetadata() {
// TODO Cleanup after ourselves..
@ -248,7 +248,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
checkMetadataFor("vAppTemplate", newMetadata, expectedMetadataMap);
}
@Test(testName = "PUT /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testEditMetadata" })
@Test(description = "PUT /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testEditMetadata" })
public void testEditMetadataValue() {
// TODO Cleanup after ourselves..
@ -263,7 +263,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(newMetadataValue.getValue(), metadataValue.getValue());
}
@Test(testName = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" })
@Test(description = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" })
public void testDeleteVAppTemplateMetadataValue() {
// First store a value
String key = name("key-");
@ -280,7 +280,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
checkMetadataKeyAbsentFor("vAppTemplate", newMetadata, key);
}
@Test(testName = "PUT /vAppTemplate/{id}/guestCustomizationSection")
@Test(description = "PUT /vAppTemplate/{id}/guestCustomizationSection")
public void testEditGuestCustomizationSection() {
String computerName = name("n");
GuestCustomizationSection newSection = GuestCustomizationSection.builder()
@ -297,7 +297,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(modified.getComputerName(), computerName);
}
@Test(testName = "PUT /vAppTemplate/{id}/customizationSection")
@Test(description = "PUT /vAppTemplate/{id}/customizationSection")
public void testEditCustomizationSection() {
boolean oldVal = vAppTemplateClient.getVAppTemplateCustomizationSection(vAppTemplateURI).isCustomizeOnInstantiate();
boolean newVal = !oldVal;
@ -315,7 +315,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME deploymentLeaseInSeconds returned is null
@Test(testName = "PUT /vAppTemplate/{id}/leaseSettingsSection")
@Test(description = "PUT /vAppTemplate/{id}/leaseSettingsSection")
public void testEditLeaseSettingsSection() throws Exception {
int deploymentLeaseInSeconds = random.nextInt(10000)+1;
// NOTE use smallish number for storageLeaseInSeconds; it seems to be capped at 5184000?
@ -335,7 +335,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertEquals(newLeaseSettingsSection.getDeploymentLeaseInSeconds(), (Integer) deploymentLeaseInSeconds);
}
@Test(testName = "PUT /vAppTemplate/{id}/networkConfigSection")
@Test(description = "PUT /vAppTemplate/{id}/networkConfigSection")
public void testEditNetworkConfigSection() {
// TODO What to modify?
@ -368,7 +368,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
// assertEquals(newVAppNetworkConfig.getNetworkName(), networkName);
}
@Test(testName = "PUT /vAppTemplate/{id}/networkConnectionSection")
@Test(description = "PUT /vAppTemplate/{id}/networkConnectionSection")
public void testEditNetworkConnectionSection() {
// Look up a network in the Vdc
Set<Reference> networks = vdc.getAvailableNetworks();
@ -391,7 +391,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
}
// FIXME cloneVAppTemplate is giving back 500 error
@Test(testName = "DELETE /vAppTemplate/{id}", dependsOnMethods = { "testGetVAppTemplate" })
@Test(description = "DELETE /vAppTemplate/{id}", dependsOnMethods = { "testGetVAppTemplate" })
public void testDeleteVAppTemplate() throws Exception {
VAppTemplate clonedVappTemplate = cloneVAppTemplate(true);
@ -411,7 +411,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
}
}
@Test(testName = "POST /vAppTemplate/{id}/action/disableDownload")
@Test(description = "POST /vAppTemplate/{id}/action/disableDownload")
public void testDisableVAppTemplateDownload() throws Exception {
vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI);
@ -425,7 +425,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
// assertFalse(hasLinkMatchingRel(links, "download.*"), "Should not offer download link after disabling download: "+vAppTemplate);
}
@Test(testName = "POST /vAppTemplate/{id}/action/enableDownload")
@Test(description = "POST /vAppTemplate/{id}/action/enableDownload")
public void testEnableVAppTemplateDownload() throws Exception {
// First disable so that enable really has some work to do...
vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI);
@ -452,7 +452,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
return false;
}
@Test(testName = "POST /vAppTemplate/{id}/action/consolidate")
@Test(description = "POST /vAppTemplate/{id}/action/consolidate")
public void testConsolidateVAppTemplate() throws Exception {
final Task task = vAppTemplateClient.consolidateVappTemplate(vm.getHref());
assertTaskSucceedsLong(task);
@ -460,7 +460,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
// TODO Need assertion that command had effect
}
@Test(testName = "POST /vAppTemplate/{id}/action/relocate") // FIXME Need a datastore reference
@Test(description = "POST /vAppTemplate/{id}/action/relocate") // FIXME Need a datastore reference
public void testRelocateVAppTemplate() throws Exception {
// TODO Need assertion that command had effect
Reference dataStore = null; // FIXME
@ -472,7 +472,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
assertTaskSucceedsLong(task);
}
@Test(testName = "GET /vAppTemplate/{id}/shadowVms")
@Test(description = "GET /vAppTemplate/{id}/shadowVms")
public void testGetShadowVms() {
References references = vAppTemplateClient.getShadowVms(vAppTemplateURI);
@ -481,7 +481,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
// This failed previously, but is passing now.
// However, it's not part of the official API so not necessary to assert it.
@Test(testName = "test completed task not included in vAppTemplate")
@Test(description = "test completed task not included in vAppTemplate")
public void testCompletedTaskNotIncludedInVAppTemplate() throws Exception {
// Kick off a task, and wait for it to complete
vAppTemplateClient.disableDownloadVappTemplate(vAppTemplateURI);

View File

@ -119,7 +119,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
}
@Test(testName = "GET /vdc/{id}")
@Test(description = "GET /vdc/{id}")
public void testGetVdc() {
Vdc vdc = vdcClient.getVdc(vdcURI);
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
@ -128,7 +128,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkVdc(vdc);
}
@Test(testName = "POST /vdc/{id}/action/captureVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } )
@Test(description = "POST /vdc/{id}/action/captureVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } )
public void testCaptureVApp() {
String name = name("captured-");
@ -151,7 +151,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
String.format(OBJ_FIELD_EQ, "VAppTemplate", "name", name, capturedVAppTemplate.getName()));
}
@Test(testName = "POST /vdc/{id}/action/cloneVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } )
@Test(description = "POST /vdc/{id}/action/cloneVApp", dependsOnMethods = { "testInstantiateVAppTemplate" } )
public void testCloneVApp() {
CloneVAppParams cloneVappParams = CloneVAppParams.builder()
.source(instantiatedVApp.getHref())
@ -179,7 +179,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkVApp(clonedVApp);
}
@Test(testName = "POST /vdc/{id}/action/cloneVAppTemplate")
@Test(description = "POST /vdc/{id}/action/cloneVAppTemplate")
public void testCloneVAppTemplate() {
clonedVAppTemplate = vdcClient.cloneVAppTemplate(vdcURI, CloneVAppTemplateParams.builder()
.source(vAppTemplateURI)
@ -192,7 +192,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkVAppTemplate(clonedVAppTemplate);
}
@Test(testName = "POST /vdc/{id}/action/composeVApp")
@Test(description = "POST /vdc/{id}/action/composeVApp")
public void testComposeVApp() {
String name = name("composed-");
@ -224,7 +224,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
// TODO Duplicates code in VAppClientLiveTest
@Test(testName = "POST /vdc/{id}/action/instantiateVAppTemplate")
@Test(description = "POST /vdc/{id}/action/instantiateVAppTemplate")
public void testInstantiateVAppTemplate() {
Vdc vdc = vdcClient.getVdc(vdcURI);
@ -275,7 +275,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkVApp(instantiatedVApp);
}
@Test(testName = "POST /vdc/{id}/action/uploadVAppTemplate")
@Test(description = "POST /vdc/{id}/action/uploadVAppTemplate")
public void testUploadVAppTemplate() {
// TODO Should test all 4 stages of upload; currently doing only stage 1 here.
// 1. creating empty vApp template entity
@ -307,13 +307,13 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
}
@Test(testName = "vdcClient admin metadata configuration", dependsOnMethods = { "testGetVdc" } )
@Test(description = "vdcClient admin metadata configuration", dependsOnMethods = { "testGetVdc" } )
public void testSetupMetadata() {
context.getApi().getAdminVdcClient().getMetadataClient().setMetadata(toAdminUri(vdcURI),
"key", MetadataValue.builder().value("value").build());
}
@Test(testName = "GET /vdc/{id}/metadata", dependsOnMethods = { "testSetupMetadata" } )
@Test(description = "GET /vdc/{id}/metadata", dependsOnMethods = { "testSetupMetadata" } )
public void testGetMetadata() {
Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI);
@ -324,7 +324,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
Checks.checkMetadataFor(VDC, metadata);
}
@Test(testName = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } )
@Test(description = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } )
public void testGetMetadataValue() {
// First find a key
Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI);