merge to master

This commit is contained in:
danikov 2012-03-02 13:12:44 +00:00
parent e24b96e043
commit 5518149db9
6 changed files with 11 additions and 38 deletions

View File

@ -92,8 +92,6 @@ public class CloneMediaParams
public CloneMediaParams build() { public CloneMediaParams build() {
return new CloneMediaParams(description, name, source, isSourceDelete); return new CloneMediaParams(description, name, source, isSourceDelete);
cloneMediaParams.setName(name);
cloneMediaParams.setDescription(description);
} }

View File

@ -23,6 +23,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.net.URI; import java.net.URI;
import java.util.Set; import java.util.Set;
import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@ -137,7 +138,7 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
@XmlElement(name = "Description") @XmlElement(name = "Description")
private String description; private String description;
@XmlElement(namespace = VCLOUD_1_5_NS, name = "Tasks") @XmlElement(name = "Tasks")
private TasksInProgress tasksInProgress; private TasksInProgress tasksInProgress;
@XmlAttribute @XmlAttribute
private String id; private String id;

View File

@ -58,7 +58,6 @@ import com.google.common.collect.Sets;
*/ */
@XmlType(name = "File") @XmlType(name = "File")
public class File extends EntityType<File> { public class File extends EntityType<File> {
@SuppressWarnings("unchecked")
public static Builder builder() { public static Builder builder() {
return new Builder(); return new Builder();
} }
@ -194,13 +193,11 @@ public class File extends EntityType<File> {
this.checksum = checksum; this.checksum = checksum;
} }
@SuppressWarnings("unused")
private File() { private File() {
// For JAXB and builder use // For JAXB
} }
private File(URI href, String name) {
super(href, name);
}
@XmlAttribute @XmlAttribute
protected Long size; protected Long size;
@XmlAttribute @XmlAttribute

View File

@ -22,13 +22,14 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set; import java.util.List;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
/** /**
@ -99,18 +100,18 @@ public class FilesList {
// For JAXB and builder use // For JAXB and builder use
} }
private FilesList(Set<File> files) { private FilesList(List<File> files) {
this.files = ImmutableSet.copyOf(files); this.files = ImmutableList.copyOf(files);
} }
@XmlElement(name = "File", required = true) @XmlElement(name = "File", required = true)
protected Set<File> files = Sets.newLinkedHashSet(); protected List<File> files = Lists.newLinkedList();
/** /**
* Gets the value of the file property. * Gets the value of the file property.
*/ */
public Set<File> getFiles() { public List<File> getFiles() {
return this.files; return this.files;
} }

View File

@ -48,7 +48,6 @@ public class Media extends ResourceEntityType<Media> {
public static final List<String> ALL = Arrays.asList(ISO, FLOPPY); public static final List<String> ALL = Arrays.asList(ISO, FLOPPY);
} }
@SuppressWarnings("unchecked")
public static Builder builder() { public static Builder builder() {
return new Builder(); return new Builder();
} }

View File

@ -193,29 +193,6 @@ public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest
} }
} }
@Test
@Test(enabled = false)
public void testCloneVApp() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVApp")
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_V_APP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/cloneVApp.xml", VCloudDirectorMediaType.V_APP)
.httpResponseBuilder().build());
VApp expected = cloneVApp();
// TODO: configure params
CloneVAppParams params = CloneVAppParams.builder()
.build();
assertEquals(client.getVdcClient().cloneVApp(vdcRef, params), expected);
}
@Test(enabled = false) @Test(enabled = false)
public void testCloneVAppTemplate() { public void testCloneVAppTemplate() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,