Package org.jclouds.vcloud.domain.internal

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


   }

   @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() {
View Full Code Here


   }

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

                  ORG_REF.getName(), ImmutableMap.<String, org.jclouds.vcloud.domain.Catalog> of(
                        CATALOG_REF.getName(),
                        new CatalogImpl(CATALOG_REF.getName(), CATALOG_REF.getType(), CATALOG_REF.getHref(), null,
                              "description", ImmutableMap.<String, ReferenceType> of(
                                    "item",
                                    new ReferenceTypeImpl("item", "application/vnd.vmware.vcloud.catalogItem+xml", URI
                                          .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/1")),
                                    "template",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"))),
                              ImmutableList.<Task> of(), true, false)));
         }
View Full Code Here

                        .<String, Map<String, CatalogItem>> of(CATALOG_REF
                              .getName(), ImmutableMap.<String, CatalogItem> of(
                              "template",
                              new CatalogItemImpl("template", URI
                                    .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"), "description",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/2")),
                                    ImmutableMap.<String, String> of()))));

         }
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

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

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

   @Test(enabled = false)
   public static void checkOs(VCloudOperatingSystemSection result) {
      assertEquals(result.getHref(), URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/"));
      assertEquals(result.getDescription(), "Red Hat Enterprise Linux 5 (64-bit)");
      assertEquals(result.getEdit(), new ReferenceTypeImpl(null,
               "application/vnd.vmware.vcloud.operatingSystemSection+xml",
               URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/")));
      assertEquals(result.getId(), Integer.valueOf(80));
      assertEquals(result.getVmwOsType(), "rhel5_64Guest");
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.operatingSystemSection+xml");
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.