You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/03/31 09:13:35 UTC

[22/52] [partial] Moving jclouds dependencies to accurate parent directories

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudNetworkSectionHandler.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudNetworkSectionHandler.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudNetworkSectionHandler.java
new file mode 100755
index 0000000..e26af7c
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudNetworkSectionHandler.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.xml.ovf;
+
+import static org.jclouds.util.SaxUtils.equalsOrSuffix;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.ovf.NetworkSection;
+import org.jclouds.ovf.xml.NetworkSectionHandler;
+import org.jclouds.util.SaxUtils;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.ovf.VCloudNetworkSection;
+import org.jclouds.vcloud.util.Utils;
+import org.xml.sax.Attributes;
+
+/**
+ * @author Adrian Cole
+ */
+public class VCloudNetworkSectionHandler extends ParseSax.HandlerWithResult<VCloudNetworkSection> {
+   private final NetworkSectionHandler networkSectionHandler;
+
+   @Inject
+   VCloudNetworkSectionHandler(NetworkSectionHandler networkSectionHandler) {
+      this.networkSectionHandler = networkSectionHandler;
+   }
+
+   private ReferenceType net;
+
+   public VCloudNetworkSection getResult() {
+      NetworkSection system = networkSectionHandler.getResult();
+      return new VCloudNetworkSection(net.getType(), net.getHref(), system.getInfo(), system.getNetworks());
+   }
+
+   public void startElement(String uri, String localName, String qName, Attributes attrs) {
+      Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs);
+      if (equalsOrSuffix(qName, "NetworkSection")) {
+         this.net = Utils.newReferenceType(attributes);
+      }
+      networkSectionHandler.startElement(uri, localName, qName, attrs);
+   }
+
+   @Override
+   public void endElement(String uri, String localName, String qName) {
+      networkSectionHandler.endElement(uri, localName, qName);
+   }
+
+   public void characters(char ch[], int start, int length) {
+      networkSectionHandler.characters(ch, start, length);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudOperatingSystemHandler.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudOperatingSystemHandler.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudOperatingSystemHandler.java
new file mode 100755
index 0000000..981388e
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudOperatingSystemHandler.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.xml.ovf;
+
+import static org.jclouds.vcloud.util.Utils.newReferenceType;
+
+import java.util.Map;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.util.SaxUtils;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.ovf.VCloudOperatingSystemSection;
+import org.jclouds.vcloud.util.Utils;
+import org.xml.sax.Attributes;
+
+/**
+ * @author Adrian Cole
+ */
+public class VCloudOperatingSystemHandler extends ParseSax.HandlerWithResult<VCloudOperatingSystemSection> {
+   private StringBuilder currentText = new StringBuilder();
+
+   protected ReferenceType os;
+   protected Integer id;
+   protected String info;
+   protected String vmwOsType;
+   protected String description;
+   protected ReferenceType edit;
+
+   public VCloudOperatingSystemSection getResult() {
+      VCloudOperatingSystemSection system = new VCloudOperatingSystemSection(id, info, description, os.getType(), os.getHref(),
+               vmwOsType, edit);
+      os = null;
+      id = null;
+      info = null;
+      vmwOsType = null;
+      description = null;
+      edit = null;
+      return system;
+   }
+
+   @Override
+   public void startElement(String uri, String localName, String qName, Attributes attrs) {
+      Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs);
+      if (qName.endsWith("Link")) {
+         this.edit = Utils.newReferenceType(attributes);
+      } else if (qName.endsWith("OperatingSystemSection")) {
+         os = newReferenceType(attributes);
+         vmwOsType = attributes.get("osType");
+         if (attributes.containsKey("id"))
+            this.id = Integer.parseInt(attributes.get("id"));
+      }
+   }
+
+   @Override
+   public void endElement(String uri, String localName, String qName) {
+      if (qName.endsWith("Info")) {
+         this.info = currentText.toString().trim();
+      } else if (qName.endsWith("Description")) {
+         this.description = currentText.toString().trim();
+      }
+      currentText = new StringBuilder();
+   }
+
+   public void characters(char ch[], int start, int length) {
+      currentText.append(ch, start, length);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudResourceAllocationSettingDataHandler.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudResourceAllocationSettingDataHandler.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudResourceAllocationSettingDataHandler.java
new file mode 100755
index 0000000..85d9d8b
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/java/org/jclouds/vcloud/xml/ovf/VCloudResourceAllocationSettingDataHandler.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.xml.ovf;
+
+import java.util.Map;
+
+import org.jclouds.cim.ResourceAllocationSettingData;
+import org.jclouds.cim.xml.ResourceAllocationSettingDataHandler;
+import org.jclouds.util.SaxUtils;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.ovf.EditableResourceAllocationSettingData;
+import org.jclouds.vcloud.domain.ovf.VCloudHardDisk;
+import org.jclouds.vcloud.domain.ovf.VCloudNetworkAdapter;
+import org.jclouds.vcloud.util.Utils;
+import org.xml.sax.Attributes;
+
+/**
+ * @author Adrian Cole
+ */
+public class VCloudResourceAllocationSettingDataHandler extends ResourceAllocationSettingDataHandler {
+
+   private ReferenceType edit;
+
+   private long capacity;
+   private int busType;
+   private String busSubType;
+
+   private String ipAddress;
+   private boolean primaryNetworkConnection;
+   private String ipAddressingMode;
+
+   public ResourceAllocationSettingData getResult() {
+      try {
+         ResourceAllocationSettingData from = super.getResult();
+         if (edit != null) {
+            return EditableResourceAllocationSettingData.builder().fromResourceAllocationSettingData(from).edit(edit)
+                     .build();
+         } else if (busSubType != null) {
+            return VCloudHardDisk.builder().fromResourceAllocationSettingData(from).capacity(capacity).busType(busType)
+                     .busSubType(busSubType).build();
+         } else if (ipAddress != null) {
+            return VCloudNetworkAdapter.builder().fromResourceAllocationSettingData(from).ipAddress(ipAddress)
+                     .primaryNetworkConnection(primaryNetworkConnection).ipAddressingMode(ipAddressingMode).build();
+         } else {
+            return from;
+         }
+      } finally {
+         ipAddress = null;
+         primaryNetworkConnection = false;
+         ipAddressingMode = null;
+         capacity = -1;
+         busType = -1;
+         busSubType = null;
+         edit = null;
+      }
+   }
+
+   @Override
+   public void startElement(String uri, String localName, String qName, Attributes attrs) {
+      Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs);
+      if (qName.endsWith("Link")) {
+         this.edit = Utils.newReferenceType(attributes);
+      } else if (qName.endsWith("HostResource") && attributes.size() > 0) {
+         capacity = Long.parseLong(attributes.get("capacity"));
+         busType = Integer.parseInt(attributes.get("busType"));
+         busSubType = attributes.get("busSubType");
+      } else if (qName.endsWith("Connection") && attributes.size() > 0) {
+         ipAddress = attributes.get("ipAddress");
+         primaryNetworkConnection = Boolean.parseBoolean(attributes.get("primaryNetworkConnection"));
+         ipAddressingMode = attributes.get("ipAddressingMode");
+      }
+      super.startElement(uri, localName, qName, attrs);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
new file mode 100755
index 0000000..d800a94
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
@@ -0,0 +1 @@
+org.jclouds.vcloud.VCloudApiMetadata
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiMetadataTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiMetadataTest.java
new file mode 100755
index 0000000..7840801
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiMetadataTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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;
+
+import org.jclouds.compute.internal.BaseComputeServiceApiMetadataTest;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "VCloudApiMetadataTest")
+public class VCloudApiMetadataTest extends BaseComputeServiceApiMetadataTest {
+
+   public VCloudApiMetadataTest() {
+      super(new VCloudApiMetadata());
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiTest.java
new file mode 100755
index 0000000..9578c64
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudApiTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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;
+
+import java.io.IOException;
+import java.util.concurrent.ExecutionException;
+
+import org.jclouds.vcloud.internal.BaseVCloudApiTest;
+import org.jclouds.vcloud.utils.TestUtils;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code VCloudApi}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during
+// surefire
+@Test(groups = "unit", testName = "VCloudApiTest")
+public class VCloudApiTest extends BaseVCloudApiTest<VCloudApi> {
+
+   private VCloudApi syncClient;
+
+   public void testSync() throws SecurityException, NoSuchMethodException, InterruptedException, ExecutionException {
+      assert syncClient.getVAppApi() != null;
+      assert syncClient.getCatalogApi() != null;
+      assert syncClient.getVmApi() != null;
+      assert syncClient.getVAppTemplateApi() != null;
+      assert syncClient.getTaskApi() != null;
+      assert syncClient.getVDCApi() != null;
+      assert syncClient.getNetworkApi() != null;
+      assert syncClient.getOrgApi() != null;
+   }
+
+   @BeforeClass
+   @Override
+   protected void setupFactory() throws IOException {
+      super.setupFactory();
+      syncClient = injector.getInstance(VCloudApi.class);
+   }
+
+   @DataProvider
+   public Object[][] ignoreOnWindows() {
+      return TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS
+                                     : TestUtils.SINGLE_NO_ARG_INVOCATION;
+   }
+   
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudSessionRefreshLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudSessionRefreshLiveTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudSessionRefreshLiveTest.java
new file mode 100755
index 0000000..7c1221d
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudSessionRefreshLiveTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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;
+
+import org.jclouds.vcloud.internal.BaseVCloudApiLiveTest;
+import org.testng.annotations.Test;
+
+/**
+ * Tests session refresh works
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "live", singleThreaded = true)
+public class VCloudSessionRefreshLiveTest extends BaseVCloudApiLiveTest {
+
+   private static final int timeOut = 40;
+
+   @Test
+   public void testSessionRefresh() throws Exception {
+      VCloudApi connection = view.unwrapApi(VCloudApi.class);
+
+      connection.getOrgApi().findOrgNamed(null);
+      Thread.sleep(timeOut * 1000);
+      connection.getOrgApi().findOrgNamed(null);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudVersionsApiTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudVersionsApiTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudVersionsApiTest.java
new file mode 100755
index 0000000..569903d
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/VCloudVersionsApiTest.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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;
+import static org.jclouds.reflect.Reflection2.method;
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.providers.AnonymousProviderMetadata;
+import org.jclouds.providers.ProviderMetadata;
+import org.jclouds.rest.internal.BaseAsyncClientTest;
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.vcloud.xml.SupportedVersionsHandler;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.reflect.Invokable;
+
+/**
+ * Tests behavior of {@code VCloudVersionsApi}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "VCloudVersionsApiTest")
+public class VCloudVersionsApiTest extends BaseAsyncClientTest<VCloudVersionsApi> {
+
+   public void testVersions() throws SecurityException, NoSuchMethodException, IOException {
+      Invokable<?, ?> method = method(VCloudVersionsApi.class, "getSupportedVersions");
+      GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
+
+      assertEquals(request.getRequestLine(), "GET http://localhost:8080/versions HTTP/1.1");
+      assertNonPayloadHeadersEqual(request, "");
+      assertPayloadEquals(request, null, null, false);
+
+      assertResponseParserClassEquals(method, request, ParseSax.class);
+      assertSaxResponseParserClassEquals(method, SupportedVersionsHandler.class);
+      assertFallbackClassEquals(method, null);
+
+      checkFilters(request);
+   }
+
+   @Override
+   protected void checkFilters(HttpRequest request) {
+      assertEquals(request.getFilters().size(), 1);
+   }
+
+   @Override
+   protected ProviderMetadata createProviderMetadata() {
+      return AnonymousProviderMetadata.forApiOnEndpoint(VCloudVersionsApi.class,
+            "http://localhost:8080");
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCatalogItemToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCatalogItemToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCatalogItemToXmlPayloadTest.java
new file mode 100755
index 0000000..93ea7cb
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCatalogItemToXmlPayloadTest.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.jclouds.vcloud.options.CatalogItemOptions;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Tests behavior of {@code BindCatalogItemToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindCatalogItemToXmlPayloadTest extends BasePayloadTest {
+   
+   public void testDefault() throws IOException {
+      String expected = "<CatalogItem xmlns=\"http://www.vmware.com/vcloud/v1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" name=\"myname\" xsi:schemaLocation=\"http://www.vmware.com/vcloud/v1 http://vcloud.safesecureweb.com/ns/vcloud.xsd\"><Description>mydescription</Description><Entity href=\"http://fooentity\"/><Property key=\"foo\">bar</Property></CatalogItem>";
+
+      CatalogItemOptions options = CatalogItemOptions.Builder.description("mydescription").properties(
+            ImmutableMap.of("foo", "bar"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+
+      BindCatalogItemToXmlPayload binder = injector.getInstance(BindCatalogItemToXmlPayload.class);
+
+      Map<String, Object> map = ImmutableMap.<String, Object> of("name", "myname", "Entity", "http://fooentity");
+
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppParamsToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppParamsToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppParamsToXmlPayloadTest.java
new file mode 100755
index 0000000..6fbcd8d
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppParamsToXmlPayloadTest.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.testng.Assert.assertEquals;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.util.Strings2;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.jclouds.vcloud.options.CloneVAppOptions;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ * Tests behavior of {@code BindCloneVAppParamsToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindCloneVAppParamsToXmlPayloadTest extends BasePayloadTest {
+   
+   public void testWithDescriptionDeployOn() throws Exception {
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/copyVApp.xml"));
+
+      CloneVAppOptions options = new CloneVAppOptions().deploy().powerOn().description(
+               "The description of the new vApp");
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+      
+      BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "new-linux-server");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/201");
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+
+   public void testWithDescriptionDeployOnSourceDelete() throws Exception {
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/moveVApp.xml"));
+
+      CloneVAppOptions options = new CloneVAppOptions().deploy().powerOn().description(
+               "The description of the new vApp");
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+
+      BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "new-linux-server");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/201");
+      map.put("IsSourceDelete", "true");
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+
+   public void testDefault() throws Exception {
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/copyVApp-default.xml"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "my-vapp");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/4181");
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppTemplateParamsToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppTemplateParamsToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppTemplateParamsToXmlPayloadTest.java
new file mode 100755
index 0000000..e309e67
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindCloneVAppTemplateParamsToXmlPayloadTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.jclouds.util.Strings2.toStringAndClose;
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.jclouds.vcloud.options.CloneVAppTemplateOptions;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ * Tests behavior of {@code BindCloneVAppTemplateParamsToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindCloneVAppTemplateParamsToXmlPayloadTest extends BasePayloadTest {
+   public void testWithDescription() throws IOException {
+      String expected = toStringAndClose(getClass().getResourceAsStream("/copyVAppTemplate.xml"));
+      
+      CloneVAppTemplateOptions options = new CloneVAppTemplateOptions()
+            .description("The description of the new vAppTemplate");
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+
+      BindCloneVAppTemplateParamsToXmlPayload binder = injector
+            .getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "new-linux-server");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/201");
+
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+
+   public void testWithDescriptionSourceDelete() throws IOException {
+      String expected = toStringAndClose(getClass().getResourceAsStream("/moveVAppTemplate.xml"));
+
+      CloneVAppTemplateOptions options = new CloneVAppTemplateOptions()
+            .description("The description of the new vAppTemplate");
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+
+      BindCloneVAppTemplateParamsToXmlPayload binder = injector
+            .getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "new-linux-server");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/201");
+      map.put("IsSourceDelete", "true");
+
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+
+   public void testDefault() throws IOException {
+      String expected = toStringAndClose(getClass().getResourceAsStream("/copyVAppTemplate-default.xml"));
+
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindCloneVAppTemplateParamsToXmlPayload binder = injector
+            .getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
+
+      Builder<String, Object> map = ImmutableMap.builder();
+      map.put("name", "my-vapptemplate");
+      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/4181");
+
+      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindDeployVAppParamsToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindDeployVAppParamsToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindDeployVAppParamsToXmlPayloadTest.java
new file mode 100755
index 0000000..d943b37
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindDeployVAppParamsToXmlPayloadTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
+
+/**
+ * Tests behavior of {@code BindDeployVAppParamsToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindDeployVAppParamsToXmlPayloadTest extends BasePayloadTest {
+
+   public void testPowerOnTrue() throws IOException {
+      String expected = "<DeployVAppParams xmlns=\"http://www.vmware.com/vcloud/v1\" powerOn=\"true\"/>";
+
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindDeployVAppParamsToXmlPayload binder = injector.getInstance(BindDeployVAppParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("powerOn", "true");
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+
+   public void testDefault() throws IOException {
+      String expected = "<DeployVAppParams xmlns=\"http://www.vmware.com/vcloud/v1\"/>";
+
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindDeployVAppParamsToXmlPayload binder = injector.getInstance(BindDeployVAppParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindInstantiateVAppTemplateParamsToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindInstantiateVAppTemplateParamsToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindInstantiateVAppTemplateParamsToXmlPayloadTest.java
new file mode 100755
index 0000000..b937c85
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindInstantiateVAppTemplateParamsToXmlPayloadTest.java
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.replay;
+import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;
+import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_DEFAULT_FENCEMODE;
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.util.Strings2;
+import org.jclouds.vcloud.VCloudApiMetadata;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.VAppTemplate;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.domain.network.FenceMode;
+import org.jclouds.vcloud.domain.network.NetworkConfig;
+import org.jclouds.vcloud.endpoints.Network;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
+import org.nnsoft.guice.rocoto.Rocoto;
+import org.nnsoft.guice.rocoto.configuration.ConfigurationModule;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Function;
+import com.google.common.base.Functions;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Provides;
+
+/**
+ * Tests behavior of {@code BindInstantiateVAppTemplateParamsToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindInstantiateVAppTemplateParamsToXmlPayloadTest extends BasePayloadTest {
+   Injector createInjector(final URI vAppTemplate, final VAppTemplate value) {
+
+      return Guice.createInjector(Rocoto.expandVariables(new ConfigurationModule() {
+
+         @Provides
+         @Singleton
+         @Network
+         protected Function<VAppTemplate, String> templateToDefaultNetworkName() {
+            return Functions.forMap(ImmutableMap.of(value, "vAppNet-vApp Internal"));
+         }
+
+         @Provides
+         @Singleton
+         protected LoadingCache<URI, VAppTemplate> templateIdToVAppTemplate() {
+            return CacheBuilder.newBuilder().build(
+                     CacheLoader.from(Functions.forMap(ImmutableMap.of(vAppTemplate, value))));
+         }
+
+         @Override
+         protected void bindConfigurations() {
+            bindProperties(new VCloudApiMetadata().getDefaultProperties());
+         }
+
+         @Provides
+         @Singleton
+         public FenceMode defaultFenceMode(@Named(PROPERTY_VCLOUD_DEFAULT_FENCEMODE) String fenceMode) {
+            return FenceMode.fromValue(fenceMode);
+         }
+
+         @Network
+         @Provides
+         @Singleton
+         Supplier<ReferenceType> provideNetwork() {
+            return Suppliers.<ReferenceType>ofInstance(new ReferenceTypeImpl(null, null, URI
+                     .create("https://vcenterprise.bluelock.com/api/v1.0/network/1990")));
+         }
+      }));
+   }
+
+   public void testDefault() throws IOException {
+      URI templateUri = URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/3");
+      VAppTemplate template = createMock(VAppTemplate.class);
+      replay(template);
+
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/instantiationparams.xml"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(new InstantiateVAppTemplateOptions()));
+
+      BindInstantiateVAppTemplateParamsToXmlPayload binder = createInjector(templateUri, template).getInstance(
+               BindInstantiateVAppTemplateParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("name", "my-vapp");
+      map.put("template", templateUri.toASCIIString());
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+
+   public void testDescription() throws IOException {
+      URI templateUri = URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/3");
+      VAppTemplate template = createMock(VAppTemplate.class);
+      replay(template);
+
+      String expected = Strings2.toStringAndClose(getClass()
+               .getResourceAsStream("/instantiationparams-description.xml"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(new InstantiateVAppTemplateOptions().description("my foo")));
+
+      BindInstantiateVAppTemplateParamsToXmlPayload binder = createInjector(templateUri, template).getInstance(
+               BindInstantiateVAppTemplateParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("name", "my-vapp");
+      map.put("template", templateUri.toASCIIString());
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+
+   public void testWhenTemplateDoesntExist() throws IOException {
+      URI templateUri = URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/3");
+      VAppTemplate template = createMock(VAppTemplate.class);
+      replay(template);
+
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/instantiationparams.xml"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindInstantiateVAppTemplateParamsToXmlPayload binder = createInjector(templateUri, template).getInstance(
+               BindInstantiateVAppTemplateParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("name", "my-vapp");
+      map.put("template", templateUri.toASCIIString());
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+
+   public void testWithNetworkNameFenceMode() throws IOException {
+      URI templateUri = URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/3");
+      VAppTemplate template = createMock(VAppTemplate.class);
+      replay(template);
+
+      InstantiateVAppTemplateOptions options = addNetworkConfig(new NetworkConfig("aloha", URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/network/1991"), FenceMode.NAT_ROUTED));
+
+      String expected = Strings2.toStringAndClose(getClass().getResourceAsStream("/instantiationparams-network.xml"));
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(options));
+
+      BindInstantiateVAppTemplateParamsToXmlPayload binder = createInjector(templateUri, template).getInstance(
+               BindInstantiateVAppTemplateParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("name", "my-vapp");
+      map.put("template", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/3");
+
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindNetworkConnectionSectionToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindNetworkConnectionSectionToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindNetworkConnectionSectionToXmlPayloadTest.java
new file mode 100755
index 0000000..d207fb0
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindNetworkConnectionSectionToXmlPayloadTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.vcloud.domain.NetworkConnection;
+import org.jclouds.vcloud.domain.NetworkConnectionSection;
+import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests behavior of {@code BindNetworkConnectionSectionToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit", testName = "BindNetworkConnectionSectionToXmlPayloadTest")
+public class BindNetworkConnectionSectionToXmlPayloadTest extends BasePayloadTest {
+
+   public void testWithIpAllocationModeNONE() throws IOException {
+
+      HttpRequest request = HttpRequest.builder().endpoint("http://localhost/key").method("GET")
+            .build();
+
+      BindNetworkConnectionSectionToXmlPayload binder = injector
+            .getInstance(BindNetworkConnectionSectionToXmlPayload.class);
+
+      binder.bindToRequest(
+            request,
+            NetworkConnectionSection
+                  .builder()
+                  .type("application/vnd.vmware.vcloud.networkConnectionSection+xml")
+                  .info("Specifies the available VM network connections")
+                  .href(URI.create("https://1.1.1.1/api/v1.0/vApp/vm-1/networkConnectionSection/"))
+                  .connections(
+                        ImmutableSet.<NetworkConnection> of(NetworkConnection.builder().network("none")
+                              .ipAddressAllocationMode(IpAddressAllocationMode.NONE).build())).build());
+      assertEquals(request.getPayload().getContentMetadata().getContentType(),
+            "application/vnd.vmware.vcloud.networkConnectionSection+xml");
+
+      assertEquals(
+            request.getPayload().getRawContent(),
+            "<NetworkConnectionSection xmlns=\"http://www.vmware.com/vcloud/v1\" xmlns:ovf=\"http://schemas.dmtf.org/ovf/envelope/1\" href=\"https://1.1.1.1/api/v1.0/vApp/vm-1/networkConnectionSection/\" ovf:required=\"false\" type=\"application/vnd.vmware.vcloud.networkConnectionSection+xml\"><ovf:Info>Specifies the available VM network connections</ovf:Info><NetworkConnection network=\"none\"><NetworkConnectionIndex>0</NetworkConnectionIndex><IsConnected>false</IsConnected><IpAddressAllocationMode>NONE</IpAddressAllocationMode></NetworkConnection></NetworkConnectionSection>");
+
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindUndeployVAppParamsToXmlPayloadTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindUndeployVAppParamsToXmlPayloadTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindUndeployVAppParamsToXmlPayloadTest.java
new file mode 100755
index 0000000..4f4a115
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/binders/BindUndeployVAppParamsToXmlPayloadTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.binders;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+import org.jclouds.vcloud.internal.BasePayloadTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
+
+/**
+ * Tests behavior of {@code BindUndeployVAppParamsToXmlPayload}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class BindUndeployVAppParamsToXmlPayloadTest extends BasePayloadTest {
+   
+   public void testSaveStateTrue() throws IOException {
+      String expected = "<UndeployVAppParams xmlns=\"http://www.vmware.com/vcloud/v1\" saveState=\"true\"/>";
+
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindUndeployVAppParamsToXmlPayload binder = injector.getInstance(BindUndeployVAppParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      map.put("saveState", "true");
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+
+   public void testDefault() throws IOException {
+      String expected = "<UndeployVAppParams xmlns=\"http://www.vmware.com/vcloud/v1\"/>";
+
+      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
+
+      BindUndeployVAppParamsToXmlPayload binder = injector.getInstance(BindUndeployVAppParamsToXmlPayload.class);
+
+      Map<String, Object> map = Maps.newHashMap();
+      assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/BaseVCloudComputeServiceExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/BaseVCloudComputeServiceExpectTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/BaseVCloudComputeServiceExpectTest.java
new file mode 100755
index 0000000..bc4be3a
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/BaseVCloudComputeServiceExpectTest.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.compute;
+
+import java.net.URI;
+import java.util.Properties;
+
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.apis.ApiMetadata;
+import org.jclouds.compute.ComputeService;
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.rest.internal.BaseRestClientExpectTest;
+import org.jclouds.vcloud.VCloudApiMetadata;
+import org.jclouds.vcloud.VCloudMediaType;
+
+import com.google.common.base.Function;
+import com.google.common.net.HttpHeaders;
+import com.google.inject.Module;
+
+/**
+ * Base class for writing VCloud Expect tests for ComputeService operations
+ * 
+ * @author Adrian Cole
+ */
+public abstract class BaseVCloudComputeServiceExpectTest extends BaseRestClientExpectTest<ComputeService> {
+   protected static final String ENDPOINT = "https://zone.myvcloud.com/api";
+
+   protected HttpRequest versionsRequest = HttpRequest.builder().method("GET").endpoint(
+            URI.create(ENDPOINT + "/versions")).addHeader(HttpHeaders.ACCEPT, "*/*").build();
+
+   protected HttpResponse versionsResponseFromVCD1_5 = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/versions-vcd15.xml", "text/xml"))
+            .build();
+
+   // initial auth is using basic
+   protected HttpRequest version1_0LoginRequest = HttpRequest.builder().method("POST").endpoint(ENDPOINT + "/v1.0/login")
+            .addHeader(HttpHeaders.ACCEPT, "application/vnd.vmware.vcloud.session+xml;version=1.0")
+            .addHeader(HttpHeaders.AUTHORIZATION, "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build();
+
+   protected String sessionToken = "AtatAgvJMrwOc9pDQq4RRCRLazThpnTKJDxSVH9oB2I=";
+   
+   // login response includes a cookie and also a vcloud extended header with the session token in it
+   // NOTE: vCloud Director 1.5 returns ;version=1.0 on responses to requests made in 1.0 format.
+   protected HttpResponse successfulVersion1_0LoginResponseFromVCD1_5WithSingleOrg = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/orgList1.0-vcd15.xml",  VCloudMediaType.ORGLIST_XML +";version=1.0"))
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.SET_COOKIE, String.format("vcloud-token=%s; Secure; Path=/", sessionToken)).build();
+
+   // objects are looked up by id and the format of the id is hex-hyphen
+   protected String orgId = "c076f90a-397a-49fa-89b8-b294c1599cd0";
+   
+   protected HttpRequest version1_0GetOrgRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/org/" + orgId)
+            .addHeader(HttpHeaders.ACCEPT, VCloudMediaType.ORG_XML+";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+   
+   protected HttpResponse successfulVersion1_0GetOrgResponseFromVCD1_5WithSingleTasksListVDCAndNetwork = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/org1.0-vcd15.xml",  VCloudMediaType.ORG_XML +";version=1.0"))
+            .build();
+   
+   protected String catalogId = "3155f393-1e1d-4572-8c9c-d76f72ddb658";
+   protected String vdcId = "e9cd3387-ac57-4d27-a481-9bee75e0690f";
+
+   protected HttpRequest version1_0GetCatalogRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/catalog/" + catalogId)
+            .addHeader(HttpHeaders.ACCEPT, VCloudMediaType.CATALOG_XML +";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+   
+   protected HttpResponse successfulVersion1_0GetCatalogResponseFromVCD1_5WithSingleTemplate = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/catalog1.0-vcd15.xml",  VCloudMediaType.CATALOG_XML +";version=1.0"))
+            .build();   
+   
+   protected String catalogItemId = "ceb369f7-1d07-4e32-9dbd-ebb5aa6ca55c";
+   
+   protected HttpRequest version1_0GetCatalogItemRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/catalogItem/" + catalogItemId)
+            .addHeader(HttpHeaders.ACCEPT, VCloudMediaType.CATALOGITEM_XML +";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+   
+   protected HttpResponse successfulVersion1_0GetCatalogItemResponseFromVCD1_5ForTemplate = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/catalogItem1.0-vcd15.xml",  VCloudMediaType.CATALOGITEM_XML +";version=1.0"))
+            .build();   
+   
+   // note vAppTemplate has a prefix in its id
+   protected String templateId = "vappTemplate-51891b97-c5dd-47dc-a687-aabae354f728";
+
+   protected HttpRequest version1_0GetVDCRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/vdc/" + vdcId)
+            .addHeader(HttpHeaders.ACCEPT, VCloudMediaType.VDC_XML +";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+            
+   protected HttpResponse successfulVersion1_0GetVDCResponseFromVCD1_5WithSingleTemplateAndNetwork = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/vdc1.0-vcd15.xml",  VCloudMediaType.VDC_XML +";version=1.0"))
+            .build();   
+   
+   protected String networkId = "b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1";
+   
+   protected HttpRequest version1_0GetVAppTemplateRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/vAppTemplate/" + templateId)
+            .addHeader(HttpHeaders.ACCEPT, VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+   
+   protected HttpResponse successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithSingleVMAndVDCParent = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/template1.0-vcd15.xml",  VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0"))
+            .build();   
+
+   protected HttpResponse successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithMultipleVMsAndVDCParent = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/template1.0-vcd15-multi-vm.xml",  VCloudMediaType.VAPPTEMPLATE_XML +";version=1.0"))
+            .build();   
+
+   protected HttpRequest version1_0GetOVFForVAppTemplateRequest = HttpRequest.builder().method("GET").endpoint(ENDPOINT + "/v1.0/vAppTemplate/" + templateId + "/ovf")
+            .addHeader(HttpHeaders.ACCEPT, MediaType.TEXT_XML +";version=1.0")
+            .addHeader("x-vcloud-authorization", sessionToken)
+            .addHeader(HttpHeaders.COOKIE, "vcloud-token=" + sessionToken).build();
+   
+   protected HttpResponse successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithSingleVM = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/ovf-ubuntu64.xml",  MediaType.TEXT_XML +";version=1.0"))
+            .build();   
+
+   protected HttpResponse successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithMultipleVMs = HttpResponse.builder().statusCode(200)
+            .message("HTTP/1.1 200 OK").payload(payloadFromResourceWithContentType("/ovf-multi-vm.xml",  MediaType.TEXT_XML +";version=1.0"))
+            .build();   
+
+   public BaseVCloudComputeServiceExpectTest() {
+      provider = "vcloud";
+   }
+
+   @Override
+   public ComputeService createClient(Function<HttpRequest, HttpResponse> fn, Module module, Properties props) {
+      return createInjector(fn, module, props).getInstance(ComputeService.class);
+   }
+   
+   @Override
+   protected ApiMetadata createApiMetadata() {
+      return new VCloudApiMetadata();
+   }
+
+   @Override
+   protected Properties setupProperties() {
+      Properties props = super.setupProperties();
+      props.setProperty(provider + ".endpoint", ENDPOINT);
+      return props;
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/VCloudComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/VCloudComputeServiceLiveTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/VCloudComputeServiceLiveTest.java
new file mode 100755
index 0000000..2abd06d
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/VCloudComputeServiceLiveTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.compute;
+
+import org.jclouds.compute.internal.BaseComputeServiceLiveTest;
+import org.jclouds.sshj.config.SshjSshClientModule;
+import org.testng.annotations.Test;
+
+import com.google.inject.Module;
+
+/**
+ * 
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "live", enabled = true, singleThreaded = true)
+public class VCloudComputeServiceLiveTest extends BaseComputeServiceLiveTest {
+
+   public VCloudComputeServiceLiveTest() {
+      provider = "vcloud";
+   }
+
+   @Override
+   public void setServiceDefaults() {
+      // extremely short names needed so that we don't get errors relating to
+      // guestCustomization.computerName being too long
+      group = "vcd";
+   }
+
+   @Override
+   public void testOptionToNotBlock() {
+      // start call has to block until deploy
+   }
+
+   @Override
+   protected Module getSshModule() {
+      return new SshjSshClientModule();
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/FindLocationForResourceTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/FindLocationForResourceTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/FindLocationForResourceTest.java
new file mode 100755
index 0000000..39ae435
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/FindLocationForResourceTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.compute.functions;
+
+import static org.testng.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LocationBuilder;
+import org.jclouds.domain.LocationScope;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Suppliers;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Tests behavior of {@code FindLocationForResource}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class FindLocationForResourceTest {
+   public void testMatchWhenIdIsHref() {
+      Location location = new LocationBuilder().id("http://foo").description("description")
+            .scope(LocationScope.PROVIDER).build();
+      FindLocationForResource converter = new FindLocationForResource(
+            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(location)));
+      assertEquals(converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo"))), location);
+   }
+
+   @Test(expectedExceptions = NoSuchElementException.class)
+   public void testGracefulWhenHrefIsntLocationId() {
+      FindLocationForResource converter = new FindLocationForResource(
+            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(new LocationBuilder()
+                  .id("http://bar").description("description").scope(LocationScope.PROVIDER).build())));
+      converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo")));
+   }
+
+   @Test(expectedExceptions = NoSuchElementException.class)
+   public void testGracefulWhenLocationIdIsntURI() {
+      FindLocationForResource converter = new FindLocationForResource(
+            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(new LocationBuilder().id("1")
+                  .description("description").scope(LocationScope.PROVIDER).build())));
+      converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo")));
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/ListImagesInVCloudExpectTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/ListImagesInVCloudExpectTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/ListImagesInVCloudExpectTest.java
new file mode 100755
index 0000000..f95b192
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/ListImagesInVCloudExpectTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.compute.functions;
+
+import static org.testng.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.Set;
+
+import org.jclouds.cim.OSType;
+import org.jclouds.compute.ComputeService;
+import org.jclouds.compute.domain.CIMOperatingSystem;
+import org.jclouds.compute.domain.Image;
+import org.jclouds.compute.domain.ImageBuilder;
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LocationBuilder;
+import org.jclouds.domain.LocationScope;
+import org.jclouds.domain.LoginCredentials;
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.location.suppliers.all.JustProvider;
+import org.jclouds.vcloud.compute.BaseVCloudComputeServiceExpectTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+
+/**
+ * 
+ * @author Adrian Cole
+ */
+@Test(singleThreaded = true, testName = "ListImagesInVCloudExpectTest")
+public class ListImagesInVCloudExpectTest extends BaseVCloudComputeServiceExpectTest {
+
+   public void testListImagesUsingVCloud1_0ApiOnServerRunningVCloudDirector1_5ReturnsImageWithLocationForVAppTemplateInVDC() throws Exception {
+      ComputeService compute = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse>builder()
+               .put(versionsRequest, versionsResponseFromVCD1_5)
+               .put(version1_0LoginRequest, successfulVersion1_0LoginResponseFromVCD1_5WithSingleOrg)
+               .put(version1_0GetOrgRequest, successfulVersion1_0GetOrgResponseFromVCD1_5WithSingleTasksListVDCAndNetwork)
+               .put(version1_0GetCatalogRequest, successfulVersion1_0GetCatalogResponseFromVCD1_5WithSingleTemplate)
+               .put(version1_0GetCatalogItemRequest, successfulVersion1_0GetCatalogItemResponseFromVCD1_5ForTemplate)
+               .put(version1_0GetVDCRequest, successfulVersion1_0GetVDCResponseFromVCD1_5WithSingleTemplateAndNetwork)
+               .put(version1_0GetVAppTemplateRequest, successfulVersion1_0GetVAppTemplateResponseFromVCD1_5WithSingleVMAndVDCParent)
+               .put(version1_0GetOVFForVAppTemplateRequest, successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithSingleVM)
+               .build());
+
+      Location provider = Iterables.getOnlyElement(compute.getContext().utils().injector().getInstance(JustProvider.class).get());
+
+      Location orgLocation = new LocationBuilder().id(ENDPOINT + "/v1.0/org/" + orgId).scope(LocationScope.REGION)
+               .description("jclouds").parent(provider).build();
+
+      Location vdcLocation = new LocationBuilder().id(ENDPOINT + "/v1.0/vdc/" + vdcId).scope(LocationScope.ZONE)
+               .description("orgVDC-jclouds-Tier1-PAYG").parent(orgLocation).build();
+
+      Set<? extends Image> currentImages = compute.listImages();
+      assertEquals(compute.listImages().size(), 1);
+      Image onlyImage = Iterables.get(currentImages, 0);
+      
+      
+      Image expectedImage = new ImageBuilder()
+               .ids(ENDPOINT + "/v1.0/vAppTemplate/" + templateId)
+               .uri(URI.create(ENDPOINT + "/v1.0/vAppTemplate/" + templateId))
+               .name("UbuntuServer-x64-2GB")
+               .operatingSystem(new CIMOperatingSystem(OSType.UBUNTU_64, "", null, "Ubuntu Linux (64-bit)"))
+               // TODO: this looks like a bug, as it says network interfaces
+               .description("This is a special place-holder used for disconnected network interfaces.")
+               .defaultCredentials(LoginCredentials.builder().identity("root").build())
+               .status(Image.Status.AVAILABLE)
+               .location(vdcLocation).build();
+      
+      assertEquals(onlyImage, expectedImage);
+      assertEquals(onlyImage.getStatus(), Image.Status.AVAILABLE);
+
+   }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/19c8cdaf/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java
new file mode 100755
index 0000000..32bb50d
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.compute.functions;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import javax.inject.Singleton;
+
+import org.jclouds.cim.xml.ResourceAllocationSettingDataHandler;
+import org.jclouds.collect.Memoized;
+import org.jclouds.compute.domain.Hardware;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.jclouds.domain.Credentials;
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LocationBuilder;
+import org.jclouds.domain.LocationScope;
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.VCloudApiMetadata;
+import org.jclouds.vcloud.compute.config.VCloudComputeServiceDependenciesModule;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.Status;
+import org.jclouds.vcloud.domain.VApp;
+import org.jclouds.vcloud.domain.internal.VAppImpl;
+import org.jclouds.vcloud.xml.VAppHandler;
+import org.jclouds.vcloud.xml.ovf.VCloudResourceAllocationSettingDataHandler;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Provides;
+import com.google.inject.TypeLiteral;
+import com.google.inject.name.Names;
+
+/**
+ * Tests behavior of {@code VAppToNodeMetadata}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class VAppToNodeMetadataTest {
+
+   public Injector createInjectorWithLocation(final Location location) {
+      return Guice.createInjector(new SaxParserModule(), new AbstractModule() {
+
+         @Override
+         protected void configure() {
+            Names.bindProperties(binder(), new VCloudApiMetadata().getDefaultProperties());
+            bind(new TypeLiteral<Function<ReferenceType, Location>>() {
+            }).to(new TypeLiteral<FindLocationForResource>() {
+            });
+            bind(new TypeLiteral<Function<VApp, Hardware>>() {
+            }).to(new TypeLiteral<HardwareForVApp>() {
+            });
+            bind(ResourceAllocationSettingDataHandler.class).to(VCloudResourceAllocationSettingDataHandler.class);
+         }
+
+         @Memoized
+         @Singleton
+         @Provides
+         Supplier<Set<? extends Location>> supplyLocations() {
+            return Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(location));
+         }
+
+         @Singleton
+         @Provides
+         Map<String, Credentials> supplyCreds() {
+            return Maps.newConcurrentMap();
+         }
+
+         @Singleton
+         @Provides
+         protected Map<Status, NodeMetadata.Status> provideVAppStatusToNodeStatus() {
+            return VCloudComputeServiceDependenciesModule.toPortableNodeStatus;
+         }
+
+      });
+   }
+
+   public void testWhenVDCIsLocation() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
+            .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getUserMetadata(), ImmutableMap.<String, String>of());
+      assertEquals(node.getTags(), ImmutableSet.<String>of());
+      assertEquals(node.getLocation(), location);
+      assertEquals(node.getPrivateAddresses(), ImmutableSet.of("172.16.7.230"));
+      assertEquals(node.getPublicAddresses(), ImmutableSet.of());
+   }
+
+   public void testWithMetadataParseException() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
+         .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      ImmutableMap<String, String> metadata = ImmutableMap.<String, String>of();
+      ImmutableSet<String> tags = ImmutableSet.<String>of();
+
+      String description = " user=user_ssoid_1\nuid=3b7bb605-bb30-4e62-a3de-9076b052dee7 label='foo-DEVELOPMENT' date=2013-01-22 17:39:28.252";
+
+      result = new VAppImpl(result.getName(), result.getType(), result.getHref(), result.getStatus(), result.getVDC(),
+         description, result.getTasks(), result.isOvfDescriptorUploaded(), result.getChildren(),
+         result.getNetworkSection());
+
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getUserMetadata(), metadata);
+      assertEquals(node.getTags(), tags);
+   }
+
+   public void testWithMetadataNoNewLines() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
+         .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      ImmutableMap<String, String> metadata = ImmutableMap.<String, String>of();
+      ImmutableSet<String> tags = ImmutableSet.<String>of();
+
+      String description = " user=user_ssoid_1 uid=3b7bb605-bb30-4e62-a3de-9076b052dee7 label='foo-DEVELOPMENT' date=2013-01-22 17:39:28.252";
+
+      result = new VAppImpl(result.getName(), result.getType(), result.getHref(), result.getStatus(), result.getVDC(),
+         description, result.getTasks(), result.isOvfDescriptorUploaded(), result.getChildren(),
+         result.getNetworkSection());
+
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getUserMetadata(), metadata);
+      assertEquals(node.getTags(), tags);
+   }
+
+   public void testWithEncodedMetadata() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
+            .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      ImmutableMap<String, String> metadata = ImmutableMap.<String, String>of("foo", "bar");
+      ImmutableSet<String> tags = ImmutableSet.<String>of("tag1", "tag2");
+      
+      String description = Joiner
+               .on('\n')
+               .withKeyValueSeparator("=")
+               .join(ImmutableMap.<String, String> builder().putAll(metadata)
+                        .put("jclouds_tags", Joiner.on(',').join(tags)).build());
+      
+      result = new VAppImpl(result.getName(), result.getType(), result.getHref(), result.getStatus(), result.getVDC(),
+               description, result.getTasks(), result.isOvfDescriptorUploaded(), result.getChildren(),
+               result.getNetworkSection());
+      
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getUserMetadata(), metadata);
+      assertEquals(node.getTags(), tags);
+
+   }
+
+   public void testGracefulWhenNoIPs() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/1").description("description")
+            .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-none.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getLocation(), location);
+      assertEquals(node.getPrivateAddresses(), ImmutableSet.of());
+      assertEquals(node.getPublicAddresses(), ImmutableSet.of());
+   }
+
+   @Test(expectedExceptions = NoSuchElementException.class)
+   public void testGracefulWhenVDCIsNotLocation() {
+      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/11111").description("description")
+            .scope(LocationScope.PROVIDER).build();
+      Injector injector = createInjectorWithLocation(location);
+      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class);
+      NodeMetadata node = converter.apply(result);
+      assertNotNull(node);
+      assertEquals(node.getLocation(), location);
+   }
+}