Package org.jclouds.vcloud.domain.internal

Examples of org.jclouds.vcloud.domain.internal.ReferenceTypeImpl


   @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")));
   }
View Full Code Here


   @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")));
   }
View Full Code Here

      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")));
   }
View Full Code Here

      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")));
   }
View Full Code Here

      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")));
   }
View Full Code Here

      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()));

   }
View Full Code Here

      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()));
   }
View Full Code Here

      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Jclouds-Commit-compG1xstorA01");
      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/vdc/1014839439"));
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vdc+xml");
      assertEquals(result.getStatus(), VDCStatus.READY);
      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());
      assertEquals(result.getAllocationModel(), AllocationModel.ALLOCATION_POOL);
      assertEquals(result.getStorageCapacity(), new Capacity("MB", 1024000, 1024000, 0, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("MHz", 20000, 20000, 0, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("MB", 30720, 30720, 0, 0));
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of());
      assertEquals(result.getAvailableNetworks(), ImmutableMap.of("isolation01", new ReferenceTypeImpl("isolation01",
               "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/network/990419644")), "internet01",
               new ReferenceTypeImpl("internet01", "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/network/758634723"))));
      assertEquals(result.getNicQuota(), 0);
      assertEquals(result.getNetworkQuota(), 100);
      assertEquals(result.getVmQuota(), 50);
      assert result.isEnabled();
View Full Code Here

      assertEquals(result.getStorageCapacity(), new Capacity("bytes * 10^9", 100, 0, 8, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 5000, 0, 0, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 2^20", 10240, 0, 0, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of("adriantest",
               new ReferenceTypeImpl("adriantest", VCloudMediaType.VAPP_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15124")), "centos-53",
               new ReferenceTypeImpl("centos-53", VCloudMediaType.VAPP_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15120"))));
      assertEquals(result.getAvailableNetworks(), ImmutableMap.of("10.114.34.128/26", new ReferenceTypeImpl(
               "10.114.34.128/26", "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/network/1708"))));
   }
View Full Code Here

      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 0, 0, 2400, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 10^9", 0, 0, 2, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), new ImmutableMap.Builder<String, ReferenceType>().put(
               "Plesk (Linux) 64-bit Template",
               new ReferenceTypeImpl("Plesk (Linux) 64-bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                        URI.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/1"))).put(

               "Windows 2008 Datacenter 64 Bit Template",
               new ReferenceTypeImpl("Windows 2008 Datacenter 64 Bit Template",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                                 .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/2"))).put(
               "Cent OS 64 Bit Template",
               new ReferenceTypeImpl("Cent OS 64 Bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/3"))).put(
               "cPanel (Linux) 64 Bit Template",
               new ReferenceTypeImpl("cPanel (Linux) 64 Bit Template",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                                 .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/4"))).put(
               "188849-1",
               new ReferenceTypeImpl("188849-1", "application/vnd.vmware.vcloud.vApp+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-1"))).put(
               "188849-2",
               new ReferenceTypeImpl("188849-2", "application/vnd.vmware.vcloud.vApp+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-2"))).build());

      assertEquals(result.getAvailableNetworks(), ImmutableMap.<String, ReferenceType> of());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.domain.internal.ReferenceTypeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.