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:32 UTC

[19/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/test/java/org/jclouds/vcloud/options/InstantiateVAppTemplateOptionsTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/options/InstantiateVAppTemplateOptionsTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/options/InstantiateVAppTemplateOptionsTest.java
new file mode 100755
index 0000000..dd84c98
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/options/InstantiateVAppTemplateOptionsTest.java
@@ -0,0 +1,74 @@
+/*
+ * 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.options;
+
+import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;
+import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.description;
+import static org.testng.Assert.assertEquals;
+
+import java.net.URI;
+
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.domain.network.FenceMode;
+import org.jclouds.vcloud.domain.network.NetworkConfig;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code InstantiateVAppTemplateOptions}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class InstantiateVAppTemplateOptionsTest {
+
+   Injector injector = Guice.createInjector(new SaxParserModule());
+
+   @Test
+   public void testAddNetworkConfig() {
+      InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
+      options.addNetworkConfig(new NetworkConfig("default", URI.create("http://localhost"), FenceMode.BRIDGED));
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getNetworkName(), "default");
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getParentNetwork(), URI.create("http://localhost"));
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getFenceMode(), FenceMode.BRIDGED);
+   }
+
+   @Test
+   public void testAddNetworkConfigStatic() {
+      InstantiateVAppTemplateOptions options = addNetworkConfig(new NetworkConfig("default",
+            URI.create("http://localhost"), FenceMode.BRIDGED));
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getNetworkName(), "default");
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getParentNetwork(), URI.create("http://localhost"));
+      assertEquals(Iterables.get(options.getNetworkConfig(), 0).getFenceMode(), FenceMode.BRIDGED);
+   }
+
+   @Test
+   public void testDescription() {
+      InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
+      options.description("foo");
+      assertEquals(options.getDescription(), "foo");
+   }
+
+   @Test
+   public void testDescriptionStatic() {
+      InstantiateVAppTemplateOptions options = description("foo");
+      assertEquals(options.getDescription(), "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/suppliers/OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/suppliers/OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/suppliers/OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest.java
new file mode 100755
index 0000000..d33bb32
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/suppliers/OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest.java
@@ -0,0 +1,115 @@
+/*
+ * 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.suppliers;
+
+import static org.easymock.EasyMock.createMock;
+import static org.testng.Assert.assertEquals;
+
+import java.util.NoSuchElementException;
+
+import org.jclouds.config.ValueOfConfigurationKeyOrNull;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.name.Names;
+
+/**
+ * Tests behavior of
+ * {@code OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during
+// surefire
+@Test(groups = "unit", testName = "OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest")
+public class OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefaultTest {
+   ValueOfConfigurationKeyOrNull valueOfConfigurationKeyOrNull = Guice.createInjector().getInstance(
+         ValueOfConfigurationKeyOrNull.class);
+
+   @Test(expectedExceptions = IllegalArgumentException.class)
+   public void testIllegalArgumentWhenResourcesEmpty() {
+      new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(valueOfConfigurationKeyOrNull, "foo",
+            Predicates.<ReferenceType> alwaysTrue()).apply(ImmutableSet.<ReferenceType> of());
+   }
+
+   @Test
+   public void testReturnsOnlyResource() {
+      ReferenceType reference = createMock(ReferenceType.class);
+
+      assertEquals(new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(valueOfConfigurationKeyOrNull,
+            "foo", Predicates.<ReferenceType> alwaysTrue()).apply(ImmutableSet.<ReferenceType> of(reference)),
+            reference);
+
+   }
+
+   @Test
+   public void testReturnsFirstResourceWhenConfigurationUnspecified() {
+      ReferenceType reference1 = createMock(ReferenceType.class);
+      ReferenceType reference2 = createMock(ReferenceType.class);
+
+      assertEquals(new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(valueOfConfigurationKeyOrNull,
+            "foo", Predicates.<ReferenceType> alwaysTrue()).apply(ImmutableList.<ReferenceType> of(reference1,
+            reference2)), reference1);
+
+   }
+
+   @Test
+   public void testReturnsResourceMatchingDefaultPredicateWhenConfigurationUnspecified() {
+      ReferenceType reference1 = createMock(ReferenceType.class);
+      ReferenceType reference2 = createMock(ReferenceType.class);
+
+      assertEquals(new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(valueOfConfigurationKeyOrNull,
+            "foo", Predicates.equalTo(reference2)).apply(ImmutableList.<ReferenceType> of(reference1, reference2)),
+            reference2);
+
+   }
+
+   @Test
+   public void testReturnsResourceWithNameMatchingConfigurationKey() {
+      ReferenceType reference1 = new ReferenceTypeImpl("travis tritt", null, null);
+      ReferenceType reference2 = new ReferenceTypeImpl("hail mary", null, null);
+
+      assertEquals(
+            new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(Guice.createInjector(
+                  new AbstractModule() {
+                     protected void configure() {
+                        bindConstant().annotatedWith(Names.named("foo")).to(".*mary.*");
+                     }
+                  }).getInstance(ValueOfConfigurationKeyOrNull.class), "foo", Predicates.<ReferenceType> alwaysTrue()).apply(ImmutableList
+                  .<ReferenceType> of(reference1, reference2)), reference2);
+
+   }
+
+   @Test(expectedExceptions = NoSuchElementException.class)
+   public void testThrowsNoSuchElementWhenNoneMatchConfigurationKey() {
+      ReferenceType reference1 = new ReferenceTypeImpl("travis tritt", null, null);
+      ReferenceType reference2 = new ReferenceTypeImpl("hail mary", null, null);
+
+      new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(Guice.createInjector(new AbstractModule() {
+         protected void configure() {
+            bindConstant().annotatedWith(Names.named("foo")).to(".*happy.*");
+         }
+      }).getInstance(ValueOfConfigurationKeyOrNull.class), "foo", Predicates.<ReferenceType> alwaysTrue())
+            .apply(ImmutableList.<ReferenceType> of(reference1, reference2));
+   }
+}

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/utils/TestUtils.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/utils/TestUtils.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/utils/TestUtils.java
new file mode 100755
index 0000000..9a30266
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/utils/TestUtils.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.utils;
+
+
+/**
+ * Utility class for test
+ *
+ * @author Andrew Phillips
+ */
+public class TestUtils {
+    public static final Object[][] NO_INVOCATIONS = new Object[0][0];
+    public static final Object[][] SINGLE_NO_ARG_INVOCATION = { new Object[0] };
+
+    public static boolean isWindowsOs() {
+        return System.getProperty("os.name", "").toLowerCase().contains("windows");
+    }
+}

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/xml/CatalogHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogHandlerTest.java
new file mode 100755
index 0000000..86cb8ac
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogHandlerTest.java
@@ -0,0 +1,135 @@
+/*
+ * 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;
+
+import static org.jclouds.vcloud.VCloudMediaType.CATALOGITEM_XML;
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.domain.Catalog;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.Task;
+import org.jclouds.vcloud.domain.internal.CatalogImpl;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code CatalogHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class CatalogHandlerTest {
+
+   private Injector injector;
+
+   private Factory factory;
+
+   public void testVCloud1_0() {
+      InputStream is = getClass().getResourceAsStream("/catalog-blank.xml");
+      injector = Guice.createInjector(new SaxParserModule());
+      factory = injector.getInstance(ParseSax.Factory.class);
+      Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
+      assertEquals(result, new CatalogImpl("Jclouds-private", "application/vnd.vmware.vcloud.catalog+xml", URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/catalog/921222081"), new ReferenceTypeImpl(null,
+               "application/vnd.vmware.vcloud.org+xml", URI
+                        .create("https://vcenterprise.bluelock.com/api/v1.0/org/9566014")), null, ImmutableMap
+               .<String, ReferenceType> of(), ImmutableList.<Task> of(), false, false));
+   }
+
+   public void testTerremark() {
+      InputStream is = getClass().getResourceAsStream("/catalog.xml");
+      injector = Guice.createInjector(new SaxParserModule());
+      factory = injector.getInstance(ParseSax.Factory.class);
+      Catalog result = factory.create(injector.getInstance(CatalogHandler.class)).parse(is);
+      assertEquals(result.getName(), "Miami Environment 1");
+      assert result.getDescription() == null;
+
+      assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/catalog"));
+      assertEquals(result.get("CentOS 5.3 (32-bit)"), new ReferenceTypeImpl("CentOS 5.3 (32-bit)", CATALOGITEM_XML, URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/5")));
+      assertEquals(result.get("CentOS 5.3 (64-bit)"), new ReferenceTypeImpl("CentOS 5.3 (64-bit)", CATALOGITEM_XML, URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/6")));
+      assertEquals(result.get("RHEL 5.3 (32-bit)"), new ReferenceTypeImpl("RHEL 5.3 (32-bit)", CATALOGITEM_XML, URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/7")));
+      assertEquals(result.get("RHEL 5.3 (64-bit)"), new ReferenceTypeImpl("RHEL 5.3 (64-bit)", CATALOGITEM_XML, URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/8")));
+      assertEquals(result.get("Ubuntu JeOS 9.04 (32-bit)"), new ReferenceTypeImpl("Ubuntu JeOS 9.04 (32-bit)",
+               CATALOGITEM_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/11")));
+      assertEquals(result.get("Ubuntu JeOS 9.04 (64-bit)"), new ReferenceTypeImpl("Ubuntu JeOS 9.04 (64-bit)",
+               CATALOGITEM_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/12")));
+      assertEquals(result.get("Ubuntu Server 9.04 (32-bit)"), new ReferenceTypeImpl("Ubuntu Server 9.04 (32-bit)",
+               CATALOGITEM_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/9")));
+      assertEquals(result.get("Ubuntu Server 9.04 (64-bit)"), new ReferenceTypeImpl("Ubuntu Server 9.04 (64-bit)",
+               CATALOGITEM_XML, URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/10")));
+      assertEquals(result.get("Windows 2003 Enterprise R2 (32-bit)"), new ReferenceTypeImpl(
+               "Windows 2003 Enterprise R2 (32-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/1")));
+      assertEquals(result.get("Windows 2003 Enterprise R2 (64-bit)"), new ReferenceTypeImpl(
+               "Windows 2003 Enterprise R2 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/2")));
+      assertEquals(result.get("Windows 2003 Standard R2 (32-bit)"), new ReferenceTypeImpl(
+               "Windows 2003 Standard R2 (32-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/3")));
+      assertEquals(result.get("Windows 2003 Standard R2 (64-bit)"), new ReferenceTypeImpl(
+               "Windows 2003 Standard R2 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/4")));
+      assertEquals(result.get("Windows 2003 Standard R2 w.SQL 2008 Web (64-bit)"), new ReferenceTypeImpl(
+               "Windows 2003 Standard R2 w.SQL 2008 Web (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/23")));
+      assertEquals(result.get("Windows Server 2008 Enterprise (32-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Enterprise (32-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/13")));
+      assertEquals(result.get("Windows Server 2008 Enterprise (64-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Enterprise (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/15")));
+      assertEquals(result.get("Windows Server 2008 Enterprise R2 (64-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Enterprise R2 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/16")));
+      assertEquals(result.get("Windows Server 2008 Standard (32-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Standard (32-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/17")));
+      assertEquals(result.get("Windows Server 2008 Standard (64-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Standard (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/18")));
+      assertEquals(result.get("Windows Server 2008 Standard R2 (64-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Standard R2 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/19")));
+      assertEquals(result.get("Windows Server 2008 Standard w.SQL 2008 Web (64-bit)"), new ReferenceTypeImpl(
+               "Windows Server 2008 Standard w.SQL 2008 Web (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/14")));
+      assertEquals(result.get("Windows Web Server 2008 (32-bit)"), new ReferenceTypeImpl(
+               "Windows Web Server 2008 (32-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/20")));
+      assertEquals(result.get("Windows Web Server 2008 (64-bit)"), new ReferenceTypeImpl(
+               "Windows Web Server 2008 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/21")));
+      assertEquals(result.get("Windows Web Server 2008 R2 (64-bit)"), new ReferenceTypeImpl(
+               "Windows Web Server 2008 R2 (64-bit)", CATALOGITEM_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/22")));
+   }
+}

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/xml/CatalogItemHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogItemHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogItemHandlerTest.java
new file mode 100755
index 0000000..25c48cd
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/CatalogItemHandlerTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.domain.CatalogItem;
+import org.jclouds.vcloud.domain.internal.CatalogItemImpl;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSortedMap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code CatalogItemHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class CatalogItemHandlerTest {
+
+   public void testApplyInputStream() {
+      InputStream is = getClass().getResourceAsStream("/catalogItem-hosting.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      CatalogItem result = factory.create(injector.getInstance(CatalogItemHandler.class)).parse(is);
+
+      assertEquals(result, new CatalogItemImpl("Windows 2008 Datacenter 64 Bit", URI
+               .create("https://vcloud.safesecureweb.com/api/v0.8/catalogItem/2"), "Windows 2008 Datacenter 64 Bit",
+               new ReferenceTypeImpl("Windows 2008 Datacenter 64 Bit",
+                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
+                                 .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/2")),
+               ImmutableSortedMap.of("Foo", "Bar", "Hello", "World"
+
+               )));
+
+   }
+   
+   public void testApplyInputStreamWithNamespaceUsingVcloud() {
+      InputStream is = getClass().getResourceAsStream("/catalogItem-carrenza-with-vcloud-namespace.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      CatalogItem result = factory.create(injector.getInstance(CatalogItemHandler.class)).parse(is);
+
+      assertEquals(result, new CatalogItemImpl("ubuntu10.10x64", 
+               URI.create("https://myvdc.carrenza.net/api/v1.0/catalogItem/ecd4d3a0-0d12-4195-a6d2-14cdf9f925a3"), 
+               null, new ReferenceTypeImpl("ubuntu10.10x64", "application/vnd.vmware.vcloud.vAppTemplate+xml", 
+                        URI.create("https://myvdc.carrenza.net/api/v1.0/vAppTemplate/vappTemplate-123766ea-2b55-482c-8adf-735ab1952834")),
+               ImmutableSortedMap.<String,String>of()));
+   }
+   
+   public void testApplyInputStreamWithNamespaceUsingDefault() {
+      InputStream is = getClass().getResourceAsStream("/catalogItem-carrenza-with-default-namespace.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      CatalogItem result = factory.create(injector.getInstance(CatalogItemHandler.class)).parse(is);
+
+      assertEquals(result, new CatalogItemImpl("ubuntu10.10x64", 
+               URI.create("https://myvdc.carrenza.net/api/v1.0/catalogItem/ecd4d3a0-0d12-4195-a6d2-14cdf9f925a3"), 
+               null, new ReferenceTypeImpl("ubuntu10.10x64", "application/vnd.vmware.vcloud.vAppTemplate+xml", 
+                        URI.create("https://myvdc.carrenza.net/api/v1.0/vAppTemplate/vappTemplate-123766ea-2b55-482c-8adf-735ab1952834")),
+               ImmutableSortedMap.<String,String>of()));
+   }
+}

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/xml/GuestCustomizationSectionHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/GuestCustomizationSectionHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/GuestCustomizationSectionHandlerTest.java
new file mode 100755
index 0000000..5608d96
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/GuestCustomizationSectionHandlerTest.java
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.net.UnknownHostException;
+
+import org.jclouds.http.functions.BaseHandlerTest;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.GuestCustomizationSection;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code GuestCustomizationSectionHandler}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "GuestCustomizationSectionHandlerTest")
+public class GuestCustomizationSectionHandlerTest extends BaseHandlerTest {
+
+   public void testDefault() throws UnknownHostException {
+      InputStream is = getClass().getResourceAsStream("/guestCustomization.xml");
+
+      GuestCustomizationSection result = factory.create(injector.getInstance(GuestCustomizationSectionHandler.class))
+            .parse(is);
+
+      checkGuestCustomization(result);
+
+   }
+
+   @Test(enabled = false)
+   public static void checkGuestCustomization(GuestCustomizationSection result) {
+      assertEquals(result.getType(), VCloudMediaType.GUESTCUSTOMIZATIONSECTION_XML);
+      assertEquals(result.getHref(),
+            URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/guestCustomizationSection/"));
+      assertEquals(result.getInfo(), "Specifies Guest OS Customization Settings");
+      assertEquals(result.isEnabled(), Boolean.TRUE);
+      assertEquals(result.shouldChangeSid(), Boolean.FALSE);
+      assertEquals(result.getVirtualMachineId(), "2087535248");
+      assertEquals(result.isJoinDomainEnabled(), Boolean.FALSE);
+      assertEquals(result.useOrgSettings(), Boolean.FALSE);
+      assertEquals(result.getDomainName(), null);
+      assertEquals(result.getDomainUserName(), null);
+      assertEquals(result.getDomainUserPassword(), null);
+      assertEquals(result.isAdminPasswordEnabled(), Boolean.TRUE);
+      assertEquals(result.isAdminPasswordAuto(), Boolean.TRUE);
+      assertEquals(result.getAdminPassword(), null);
+      assertEquals(result.isResetPasswordRequired(), Boolean.FALSE);
+      assertEquals(result.getCustomizationScript(), "cat > /root/foo.txt<<EOF\nI '\"love\"' {asc|!}*&\nEOF\n");
+      assertEquals(result.getComputerName(), "RHEL5");
+      assertEquals(
+            result.getEdit(),
+            new ReferenceTypeImpl(null, VCloudMediaType.GUESTCUSTOMIZATIONSECTION_XML, URI
+                  .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/guestCustomizationSection/")));
+   }
+}

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/xml/NetworkConnectionHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionHandlerTest.java
new file mode 100755
index 0000000..03ed047
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionHandlerTest.java
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.UnknownHostException;
+
+import org.jclouds.http.functions.BaseHandlerTest;
+import org.jclouds.vcloud.domain.NetworkConnection;
+import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code NetworkConnectionHandler}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "NetworkConnectionHandlerTest")
+public class NetworkConnectionHandlerTest extends BaseHandlerTest {
+
+   public void testDefault() throws UnknownHostException {
+      InputStream is = getClass().getResourceAsStream("/networkconnection.xml");
+
+      NetworkConnection result = factory.create(injector.getInstance(NetworkConnectionHandler.class)).parse(is);
+
+      checkNetworkConnection(result);
+
+   }
+
+   @Test(enabled = false)
+   public static void checkNetworkConnection(NetworkConnection result) {
+      assertEquals(result.getNetwork(), "internet01");
+      assertEquals(result.getNetworkConnectionIndex(), 0);
+      assertEquals(result.getIpAddress(), "174.47.101.164");
+      assertEquals(result.getExternalIpAddress(), null);
+      assertEquals(result.isConnected(), true);
+      assertEquals(result.getMACAddress(), "00:50:56:01:01:f2");
+      assertEquals(result.getIpAddressAllocationMode(), IpAddressAllocationMode.POOL);
+   }
+}

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/xml/NetworkConnectionSectionHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionSectionHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionSectionHandlerTest.java
new file mode 100755
index 0000000..aec8c25
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/NetworkConnectionSectionHandlerTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.NetworkConnectionSection;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code NetworkConnectionSectionHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class NetworkConnectionSectionHandlerTest {
+   public void testVCloud1_0() {
+      InputStream is = getClass().getResourceAsStream("/networkconnectionsection.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      NetworkConnectionSection result = factory.create(injector.getInstance(NetworkConnectionSectionHandler.class))
+               .parse(is);
+      checkNetworkConnectionSection(result);
+   }
+
+   @Test(enabled = false)
+   static void checkNetworkConnectionSection(NetworkConnectionSection result) {
+      assertEquals(result.getHref(), URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/"));
+      assertEquals(result.getType(), VCloudMediaType.NETWORKCONNECTIONSECTION_XML);
+      assertEquals(result.getInfo(), "Specifies the available VM network connections");
+      assertEquals(result.getPrimaryNetworkConnectionIndex(), Integer.valueOf(0));
+      assertEquals(result.getEdit(), new ReferenceTypeImpl(null, VCloudMediaType.NETWORKCONNECTIONSECTION_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/networkConnectionSection/")));
+      NetworkConnectionHandlerTest.checkNetworkConnection(Iterables.getOnlyElement(result.getConnections()));
+   }
+}

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/xml/OrgHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgHandlerTest.java
new file mode 100755
index 0000000..738a5a1
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgHandlerTest.java
@@ -0,0 +1,124 @@
+/*
+ * 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;
+
+import static org.jclouds.vcloud.VCloudMediaType.CATALOG_XML;
+import static org.jclouds.vcloud.VCloudMediaType.TASKSLIST_XML;
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.Org;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.Task;
+import org.jclouds.vcloud.domain.internal.OrgImpl;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code OrgHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class OrgHandlerTest {
+
+   public void testApplyInputStream() {
+      InputStream is = getClass().getResourceAsStream("/org-1.0.xml");
+
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+
+      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+      assertEquals(result.getName(), "ExampleOrg");
+      assertEquals(result.getFullName(), "ExampleOrg");
+      assertEquals(result.getDescription(), "Example Corp's Primary Organization.");
+      assertEquals(result.getHref(), URI.create("http://vcloud.example.com/api/v1.0/org/5"));
+      assertEquals(result.getCatalogs(), ImmutableMap.of("Main Catalog", new ReferenceTypeImpl("Main Catalog",
+               CATALOG_XML, URI.create("http://vcloud.example.com/api/v1.0/catalog/32")), "Shared Catalog",
+               new ReferenceTypeImpl("Shared Catalog", CATALOG_XML, URI
+                        .create("http://vcloud.example.com/api/v1.0/catalog/37"))));
+      assertEquals(result.getVDCs(), ImmutableMap.of("ExampleVdc01", new ReferenceTypeImpl("ExampleVdc01",
+               VCloudMediaType.VDC_XML, URI.create("http://vcloud.example.com/api/v1.0/vdc/5"))));
+      assertEquals(result.getNetworks(), ImmutableMap.of("TestNetwork", new ReferenceTypeImpl("TestNetwork",
+               VCloudMediaType.NETWORK_XML, URI.create("http://vcloud.example.com/api/v1.0/network/14")),
+               "ProductionNetwork", new ReferenceTypeImpl("ProductionNetwork", VCloudMediaType.NETWORK_XML, URI
+                        .create("http://vcloud.example.com/api/v1.0/network/54"))));
+      assertEquals(result.getTasksList(), new ReferenceTypeImpl(null, TASKSLIST_XML, URI
+               .create("http://vcloud.example.com/api/v1.0/tasksList/5")));
+   }
+
+   public void testTerremark() {
+      InputStream is = getClass().getResourceAsStream("/org.xml");
+
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+
+      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+      assertEquals(result.getName(), "adrian@jclouds.org");
+      assertEquals(result.getFullName(), "adrian@jclouds.org");
+      assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"));
+      assertEquals(result.getCatalogs(), ImmutableMap.of("Miami Environment 1 Catalog", new ReferenceTypeImpl(
+               "Miami Environment 1 Catalog", CATALOG_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/catalog"))));
+      assertEquals(result.getVDCs(), ImmutableMap.of("Miami Environment 1", new ReferenceTypeImpl(
+               "Miami Environment 1", VCloudMediaType.VDC_XML, URI
+                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32"))));
+      assertEquals(result.getTasksList(), new ReferenceTypeImpl("Miami Environment 1 Tasks List", TASKSLIST_XML, URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/tasksList/32")));
+   }
+
+   public void testHosting() {
+      InputStream is = getClass().getResourceAsStream("/org-hosting.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+      assertEquals(result.getName(), "Customer 188849");
+      assertEquals(result.getFullName(), "Customer 188849");
+      assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/org/188849"));
+      assertEquals(result.getCatalogs(), ImmutableMap.of("HMS Shared Catalog", new ReferenceTypeImpl(
+               "HMS Shared Catalog", CATALOG_XML, URI.create("https://vcloud.safesecureweb.com/api/v0.8/catalog/1"))));
+      assertEquals(result.getVDCs(), ImmutableMap.of("188849 Virtual DataCenter", new ReferenceTypeImpl(
+               "188849 Virtual DataCenter", VCloudMediaType.VDC_XML, URI
+                        .create("https://vcloud.safesecureweb.com/api/v0.8/vdc/188849"))));
+      assertEquals(result.getTasksList(), new ReferenceTypeImpl("188849 Task List", TASKSLIST_XML, URI
+               .create("https://vcloud.safesecureweb.com/api/v0.8/tasksList/188849")));
+   }
+
+   public void testSavvis() {
+      InputStream is = getClass().getResourceAsStream("/org-savvis.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
+      assertEquals(result, new OrgImpl("607968.0", null, null, "607968.0", "Gravitant Inc", ImmutableMap
+               .<String, ReferenceType> of(), ImmutableMap.<String, ReferenceType> of("GravDataCenter1(Saved)",
+               new ReferenceTypeImpl("GravDataCenter1(Saved)", "application/vnd.vmware.vcloud.vdc+xml", URI
+                        .create("https://api.symphonyVPDC.savvis.net/rest/api/v0.8/org/607968.0/vdc/2826"))),
+               ImmutableMap.<String, ReferenceType> of(), null, ImmutableSet.<Task> of()));
+
+   }
+}

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/xml/OrgListHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgListHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgListHandlerTest.java
new file mode 100755
index 0000000..7887a56
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgListHandlerTest.java
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Map;
+
+import org.jclouds.http.functions.BaseHandlerTest;
+import org.jclouds.vcloud.domain.ReferenceType;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * Tests behavior of {@code OrgListHandler}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "OrgListHandlerTest")
+public class OrgListHandlerTest extends BaseHandlerTest {
+
+   public void testApplyInputStream() {
+      InputStream is = getClass().getResourceAsStream("/orglist.xml");
+
+      Map<String, ReferenceType> result = factory.create(injector.getInstance(OrgListHandler.class)).parse(is);
+      assertEquals(result, ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
+               "application/vnd.vmware.vcloud.org+xml", URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));
+   }
+   
+
+   public void testSavvis() {
+      InputStream is = getClass().getResourceAsStream("/orglist-savvis.xml");
+
+      Map<String, ReferenceType> result = factory.create(injector.getInstance(OrgListHandler.class)).parse(is);
+      assertEquals(result, ImmutableMap.of("SAVVISStation Integration Testing", new ReferenceTypeImpl("SAVVISStation Integration Testing",
+               "application/vnd.vmware.vcloud.org+xml", URI.create("https://api.sandbox.symphonyvpdc.savvis.net/rest/api/v0.8/org/100000.0"))));
+   }
+}

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/xml/OrgNetworkHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgNetworkHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgNetworkHandlerTest.java
new file mode 100755
index 0000000..e350131
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/OrgNetworkHandlerTest.java
@@ -0,0 +1,104 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.domain.network.DhcpService;
+import org.jclouds.vcloud.domain.network.FenceMode;
+import org.jclouds.vcloud.domain.network.IpRange;
+import org.jclouds.vcloud.domain.network.IpScope;
+import org.jclouds.vcloud.domain.network.OrgNetwork;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code OrgNetworkHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class OrgNetworkHandlerTest {
+   public void testIsolated() {
+      InputStream is = getClass().getResourceAsStream("/orgnetwork-isolated.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      OrgNetwork result = factory.create(injector.getInstance(OrgNetworkHandler.class)).parse(is);
+      assertEquals(result.getName(), "isolation01");
+      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/network/990419644"));
+      assertEquals(result.getType(), "application/vnd.vmware.vcloud.network+xml");
+      assertEquals(result.getOrg(), new ReferenceTypeImpl(null, VCloudMediaType.ORG_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/org/9566014")));
+      assertEquals(result.getDescription(), null);
+      assertEquals(result.getTasks(), ImmutableList.of());
+      assert result.getConfiguration() != null;
+
+      assertEquals(result.getConfiguration().getIpScope(), new IpScope(false, "192.168.15.1", "255.255.255.0",
+               "23.172.173.113", null, null,
+               ImmutableSet.<IpRange> of(new IpRange("192.168.15.100", "192.168.15.199")), ImmutableSet.<String> of()));
+      assertEquals(result.getConfiguration().getParentNetwork(), null);
+      assertEquals(result.getConfiguration().getFenceMode(), FenceMode.ISOLATED);
+      assert result.getConfiguration().getFeatures() != null;
+
+      assertEquals(result.getConfiguration().getFeatures().getDhcpService(), new DhcpService(false, 3600, 7200,
+               new IpRange("192.168.15.2", "192.168.15.99")));
+      assertEquals(result.getConfiguration().getFeatures().getFirewallService(), null);
+      assertEquals(result.getConfiguration().getFeatures().getNatService(), null);
+
+      assertEquals(result.getNetworkPool(), null);
+      assertEquals(result.getAllowedExternalIpAddresses(), ImmutableSet.<String> of());
+
+   }
+
+   public void testBridged() {
+      InputStream is = getClass().getResourceAsStream("/orgnetwork-bridged.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      OrgNetwork result = factory.create(injector.getInstance(OrgNetworkHandler.class)).parse(is);
+      assertEquals(result.getName(), "internet01");
+      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/network/758634723"));
+      assertEquals(result.getType(), "application/vnd.vmware.vcloud.network+xml");
+      assertEquals(result.getOrg(), new ReferenceTypeImpl(null, VCloudMediaType.ORG_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/org/9566014")));
+      assertEquals(result.getDescription(), null);
+      assertEquals(result.getTasks(), ImmutableList.of());
+      assert result.getConfiguration() != null;
+
+      assertEquals(result.getConfiguration().getIpScope(), new IpScope(true, "174.47.101.161", "255.255.255.224",
+               "24.172.173.113", null, null,
+               ImmutableSet.<IpRange> of(new IpRange("174.47.101.164", "174.47.101.190")), ImmutableSet.<String> of()));
+      assertEquals(result.getConfiguration().getParentNetwork(), null);
+      assertEquals(result.getConfiguration().getFenceMode(), FenceMode.BRIDGED);
+      assert result.getConfiguration().getFeatures() == null;
+      assertEquals(result.getNetworkPool(), null);
+      assertEquals(result.getAllowedExternalIpAddresses(), ImmutableSet.<String> of());
+
+   }
+
+}

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/xml/SupportedVersionsHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/SupportedVersionsHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/SupportedVersionsHandlerTest.java
new file mode 100755
index 0000000..e9f8cbb
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/SupportedVersionsHandlerTest.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.xml;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.SortedMap;
+
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSortedMap;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code SupportedVersionsHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class SupportedVersionsHandlerTest {
+
+   public void testApplyInputStream() {
+      InputStream is = getClass().getResourceAsStream("/versions.xml");
+
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+
+      SortedMap<String, URI> result = factory.create(
+               injector.getInstance(SupportedVersionsHandler.class)).parse(is);
+      assertEquals(result, ImmutableSortedMap.of("0.8", URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/login")));
+   }
+}

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/xml/TaskHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TaskHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TaskHandlerTest.java
new file mode 100755
index 0000000..45d5d07
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TaskHandlerTest.java
@@ -0,0 +1,135 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.date.DateService;
+import org.jclouds.http.functions.BaseHandlerTest;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.Task;
+import org.jclouds.vcloud.domain.TaskStatus;
+import org.jclouds.vcloud.domain.VCloudError.MinorCode;
+import org.jclouds.vcloud.domain.internal.ErrorImpl;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.domain.internal.TaskImpl;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+/**
+ * Tests behavior of {@code TaskHandler}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "TaskHandlerTest")
+public class TaskHandlerTest extends BaseHandlerTest {
+
+   private DateService dateService;
+
+   @BeforeTest
+   @Override
+   protected void setUpInjector() {
+      super.setUpInjector();
+      dateService = injector.getInstance(DateService.class);
+   }
+   
+   public void testHrefWhenTaskElementIsNamespaced() {
+      InputStream is = getClass().getResourceAsStream("/task-vcd15.xml");
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+      assertEquals(result.getHref(), URI.create("https://mycloud.greenhousedata.com/api/v1.0/task/77a33fd4-3401-423c-8167-6711fc51ee9a"));
+   }
+
+   public void test() {
+      InputStream is = getClass().getResourceAsStream("/task-1.0.xml");
+
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+
+      Task expects = new TaskImpl(URI.create("https://vcenterprise.bluelock.com/api/v1.0/task/3cc08ir8oczbze3n1a3"),
+               "Creating Virtual Application vApp_acole_2(607806320)", TaskStatus.RUNNING, dateService
+                        .iso8601DateParse("2010-08-23T02:09:52.443-04:00"), dateService
+                        .iso8601DateParse("9999-12-31T23:59:59.999-05:00"), dateService
+                        .iso8601DateParse("2010-11-21T02:09:52.443-05:00"), new ReferenceTypeImpl("vApp_acole_2",
+                        VCloudMediaType.VAPP_XML, URI
+                                 .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vapp-607806320"))
+
+               , null
+
+      );
+      assertEquals(result, expects);
+
+   }
+
+   public void testTerremark() {
+      InputStream is = getClass().getResourceAsStream("/task.xml");
+
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+      Task expects = new TaskImpl(URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/task/3299"), null,
+               TaskStatus.SUCCESS, dateService.iso8601DateParse("2009-08-24T21:29:32.983Z"), dateService
+                        .iso8601DateParse("2009-08-24T21:29:44.65Z"), null, new ReferenceTypeImpl("Server1",
+                        VCloudMediaType.VAPP_XML, URI
+                                 .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null
+
+      );
+      assertEquals(result, expects);
+
+   }
+
+   public void testSelf() {
+      InputStream is = getClass().getResourceAsStream("/task-self.xml");
+
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+
+      Task expects = new TaskImpl(URI.create("https://vcloud.safesecureweb.com/api/v0.8/task/d188849-78"), null,
+               TaskStatus.QUEUED, null, null, null, null, null);
+      assertEquals(result, expects);
+
+   }
+
+   public void testApplyInputStream2() {
+      InputStream is = getClass().getResourceAsStream("/task-hosting.xml");
+
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+
+      Task expects = new TaskImpl(URI.create("https://vcloud.safesecureweb.com/api/v0.8/task/97806"), null,
+               TaskStatus.SUCCESS, dateService.iso8601SecondsDateParse("2010-01-14T20:04:51Z"), dateService
+                        .iso8601SecondsDateParse("2010-01-14T20:05:02Z"), dateService
+                        .iso8601SecondsDateParse("2010-01-15T20:05:02Z"),
+
+               new ReferenceTypeImpl("188849-96", VCloudMediaType.VAPP_XML, URI
+                        .create("https://vcloud.safesecureweb.com/api/v0.8/vapp/188849-96")), null);
+      assertEquals(result, expects);
+   }
+
+   public void testError() {
+      InputStream is = getClass().getResourceAsStream("/task-error.xml");
+
+      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
+
+      Task expects = new TaskImpl(URI.create("http://10.150.4.49/api/v0.8/task/23"), null, TaskStatus.ERROR,
+               dateService.iso8601SecondsDateParse("2009-12-07T19:05:02Z"), dateService
+                        .iso8601SecondsDateParse("2009-12-10T14:40:32Z"), null, new ReferenceTypeImpl("testapp1",
+                        VCloudMediaType.VAPP_XML, URI.create("http://10.150.4.49/api/v0.8/vapp/1")), new ErrorImpl(
+                        "Error processing job", 500, MinorCode.UNRECOGNIZED,
+                        " Error in runDailySummaries date used:2009-12-09 19:40:30.577326+00:00", null));
+      assertEquals(result, expects);
+
+   }
+}

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/xml/TasksListHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TasksListHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TasksListHandlerTest.java
new file mode 100755
index 0000000..a5c83d5
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/TasksListHandlerTest.java
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.date.DateService;
+import org.jclouds.http.functions.BaseHandlerTest;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.Task;
+import org.jclouds.vcloud.domain.TaskStatus;
+import org.jclouds.vcloud.domain.TasksList;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.domain.internal.TaskImpl;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableSortedSet;
+
+/**
+ * Tests behavior of {@code TasksListHandler}
+ * 
+ * @author Adrian Cole
+ */
+// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
+@Test(groups = "unit", testName = "TasksListHandlerTest")
+public class TasksListHandlerTest extends BaseHandlerTest {
+
+   private DateService dateService;
+
+   @BeforeTest
+   @Override
+   protected void setUpInjector() {
+      super.setUpInjector();
+      dateService = injector.getInstance(DateService.class);
+   }
+
+   public void testApplyInputStream() {
+      InputStream is = getClass().getResourceAsStream("/taskslist.xml");
+
+      TasksList result = factory.create(injector.getInstance(TasksListHandler.class)).parse(is);
+      assertEquals(result.getLocation(), URI
+               .create("https://services.vcloudexpress.terremark.com/api/v0.8/tasksList/1"));
+      Task task1 = new TaskImpl(URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/task/3300"),
+               null, TaskStatus.SUCCESS, dateService.iso8601DateParse("2009-08-24T21:30:19.587Z"), dateService
+                        .iso8601DateParse("2009-08-24T21:30:32.63Z"), null, new ReferenceTypeImpl("Server1",
+                        VCloudMediaType.VAPP_XML, URI
+                                 .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null);
+      Task task2 = new TaskImpl(URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/task/3299"),
+               null, TaskStatus.SUCCESS, dateService.iso8601DateParse("2009-08-24T21:29:32.983Z"), dateService
+                        .iso8601DateParse("2009-08-24T21:29:44.65Z"), null, new ReferenceTypeImpl("Server1",
+                        VCloudMediaType.VAPP_XML, URI
+                                 .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null);
+      assertEquals(result.getTasks(), ImmutableSortedSet.of(task1, task2));
+   }
+
+   public void testApplyInputStreamHosting() {
+      InputStream is = getClass().getResourceAsStream("/taskslist-hosting.xml");
+
+      TasksList result = factory.create(injector.getInstance(TasksListHandler.class)).parse(is);
+      assertEquals(result.getLocation(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/tasksList/188849"));
+
+   }
+
+}

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/xml/VAppHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppHandlerTest.java
new file mode 100755
index 0000000..e6c05c7
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppHandlerTest.java
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.cim.xml.ResourceAllocationSettingDataHandler;
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.Status;
+import org.jclouds.vcloud.domain.VApp;
+import org.jclouds.vcloud.domain.Vm;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.xml.ovf.VCloudResourceAllocationSettingDataHandler;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code VAppHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class VAppHandlerTest {
+
+   public void testRhelOffStatic() {
+      InputStream is = getClass().getResourceAsStream("/vapp-rhel-off-static.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule() {
+
+         @Override
+         protected void configure() {
+            super.configure();
+            bind(ResourceAllocationSettingDataHandler.class).to(VCloudResourceAllocationSettingDataHandler.class);
+         }
+      });
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
+      assertEquals(result.getName(), "vApp_acole_2");
+      assertEquals(result.getDescription(), "foo");
+      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vapp-607806320"));
+      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vApp+xml");
+      assertEquals(result.getStatus(), Status.OFF);
+      assertEquals(
+            result.getVDC(),
+            new ReferenceTypeImpl(null, VCloudMediaType.VDC_XML, URI
+                  .create("https://vcenterprise.bluelock.com/api/v1.0/vdc/1014839439")));
+      assertEquals(result.getTasks(), ImmutableList.of());
+      assert result.isOvfDescriptorUploaded();
+      assert result.getNetworkSection() != null;
+      Vm vm = Iterables.getOnlyElement(result.getChildren());
+      VmHandlerTest.checkVm(vm);
+   }
+
+}

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/xml/VAppTemplateHandlerTest.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppTemplateHandlerTest.java b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppTemplateHandlerTest.java
new file mode 100755
index 0000000..0accf60
--- /dev/null
+++ b/dependencies/jclouds/apis/vcloud/1.7.1-stratos/src/test/java/org/jclouds/vcloud/xml/VAppTemplateHandlerTest.java
@@ -0,0 +1,164 @@
+/*
+ * 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;
+
+import static org.testng.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+
+import org.jclouds.date.DateService;
+import org.jclouds.http.functions.ParseSax;
+import org.jclouds.http.functions.ParseSax.Factory;
+import org.jclouds.http.functions.config.SaxParserModule;
+import org.jclouds.ovf.Network;
+import org.jclouds.vcloud.VCloudMediaType;
+import org.jclouds.vcloud.domain.GuestCustomizationSection;
+import org.jclouds.vcloud.domain.Status;
+import org.jclouds.vcloud.domain.TaskStatus;
+import org.jclouds.vcloud.domain.VAppTemplate;
+import org.jclouds.vcloud.domain.Vm;
+import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
+import org.jclouds.vcloud.domain.internal.TaskImpl;
+import org.jclouds.vcloud.domain.ovf.VCloudNetworkSection;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+/**
+ * Tests behavior of {@code VAppTemplateHandler}
+ * 
+ * @author Adrian Cole
+ */
+@Test(groups = "unit")
+public class VAppTemplateHandlerTest {
+
+   public void testUbuntuTemplate() {
+      VAppTemplate result = parseTemplate();
+      assertEquals(result.getName(), "Ubuntu Template");
+      assertEquals(result.getHref(), URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-1201908921"));
+      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vAppTemplate+xml");
+      assertEquals(result.getStatus(), Status.OFF);
+      assertEquals(result.getVDC(), new ReferenceTypeImpl(null, VCloudMediaType.VDC_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vdc/1014839439")));
+      assertEquals(result.getDescription(), null);
+      assertEquals(result.getTasks(), ImmutableList.of());
+      assertEquals(result.getVAppScopedLocalId(), null);
+      assert result.isOvfDescriptorUploaded();
+      Vm vm = Iterables.getOnlyElement(result.getChildren());
+      assertEquals(vm.getName(), "Ubuntu1004");
+      assertEquals(vm.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vm-172837194"));
+      // NOTE this is vAppTemplate not VM!
+      assertEquals(vm.getType(), "application/vnd.vmware.vcloud.vAppTemplate+xml");
+      assertEquals(vm.getStatus(), null);
+      assertEquals(vm.getParent(), new ReferenceTypeImpl(null, VCloudMediaType.VAPPTEMPLATE_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-1201908921")));
+      assertEquals(vm.getDescription(), null);
+      assertEquals(vm.getTasks(), ImmutableList.of());
+      assertEquals(vm.getVAppScopedLocalId(), "02_ubuntu_template");
+
+      GuestCustomizationSection guestC = vm.getGuestCustomizationSection();
+
+      assertEquals(guestC.getType(), VCloudMediaType.GUESTCUSTOMIZATIONSECTION_XML);
+      assertEquals(
+               guestC.getHref(),
+               URI
+                        .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vm-172837194/guestCustomizationSection/"));
+      assertEquals(guestC.getInfo(), "Specifies Guest OS Customization Settings");
+      assertEquals(guestC.isEnabled(), Boolean.TRUE);
+      assertEquals(guestC.shouldChangeSid(), Boolean.FALSE);
+      assertEquals(guestC.getVirtualMachineId(), "172837194");
+      assertEquals(guestC.isJoinDomainEnabled(), Boolean.FALSE);
+      assertEquals(guestC.useOrgSettings(), Boolean.FALSE);
+      assertEquals(guestC.getDomainName(), null);
+      assertEquals(guestC.getDomainUserName(), null);
+      assertEquals(guestC.getDomainUserPassword(), null);
+      assertEquals(guestC.isAdminPasswordEnabled(), Boolean.TRUE);
+      assertEquals(guestC.isAdminPasswordAuto(), Boolean.TRUE);
+      assertEquals(guestC.getAdminPassword(), "%3eD%gmF");
+      assertEquals(guestC.isResetPasswordRequired(), Boolean.FALSE);
+      assertEquals(
+               guestC.getCustomizationScript(),
+               "#!/bin/bash if [ \"$1\" = \"postcustomization\" ]; then echo \"post customization\" touch /root/.postcustomization sleep 30 #regenerate keys /bin/rm /etc/ssh/ssh_host_* /usr/sbin/dpkg-reconfigure openssh-server echo \"completed\" fi");
+      assertEquals(guestC.getComputerName(), "Ubuntu1004");
+      assertEquals(guestC.getEdit(), null);
+
+      VCloudNetworkSection network = result.getNetworkSection();
+      assertEquals(
+               network.getHref(),
+               URI
+                        .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-1201908921/networkSection/"));
+      assertEquals(network.getType(), VCloudMediaType.NETWORKSECTION_XML);
+      assertEquals(network.getInfo(), "The list of logical networks");
+      assertEquals(network.getNetworks(), ImmutableSet.of(new Network("vAppNet-vApp Internal", null)));
+
+   }
+
+   public static VAppTemplate parseTemplate() {
+      InputStream is = VAppTemplateHandlerTest.class.getResourceAsStream("/vAppTemplate.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      VAppTemplate result = factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
+      return result;
+   }
+
+   public void testCopyingTemplate() {
+      InputStream is = getClass().getResourceAsStream("/vAppTemplate-copying.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+      DateService dateService = injector.getInstance(DateService.class);
+
+      VAppTemplate result = factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
+      assertEquals(result.getName(), "Ubuntu10.04_v2");
+      assertEquals(result.getHref(), URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-699683881"));
+      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vAppTemplate+xml");
+      assertEquals(result.getStatus(), Status.UNRESOLVED);
+      assertEquals(result.getVDC(), new ReferenceTypeImpl(null, VCloudMediaType.VDC_XML, URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/vdc/105186609")));
+      assertEquals(result.getDescription(), null);
+      assertEquals(result.getTasks(), ImmutableList.of(new TaskImpl(URI
+               .create("https://vcenterprise.bluelock.com/api/v1.0/task/q62gxhi32xgd9yrqvr"),
+               "Copying Virtual Application Template Ubuntu10.04_v2(699683881)", TaskStatus.RUNNING, dateService
+                        .iso8601DateParse("2010-09-17T23:20:46.039-04:00"), dateService
+                        .iso8601DateParse("9999-12-31T23:59:59.999-05:00"), dateService
+                        .iso8601DateParse("2010-12-16T23:20:46.039-05:00"), new ReferenceTypeImpl("Ubuntu10.04_v2",
+                        "application/vnd.vmware.vcloud.vAppTemplate+xml",
+                        URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/vappTemplate-699683881")),
+               null)));
+      assertEquals(result.getVAppScopedLocalId(), null);
+      assert result.isOvfDescriptorUploaded();
+      assertEquals(result.getChildren(), ImmutableList.of());
+      assertEquals(result.getNetworkSection(), null);
+
+   }
+   
+   public void testVAppTemplateWithNewlinesAndNamespacedElements() {
+      InputStream is = getClass().getResourceAsStream("/vAppTemplate1.0-vcd15_withNewlines.xml");
+      Injector injector = Guice.createInjector(new SaxParserModule());
+      Factory factory = injector.getInstance(ParseSax.Factory.class);
+
+      factory.create(injector.getInstance(VAppTemplateHandler.class)).parse(is);
+   }
+   
+   
+}