Package org.jclouds.trmk.vcloud_0_8.domain.internal

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.ReferenceTypeImpl


   }

   @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


            result,
            new CatalogItemImpl(
                  "Windows Web Server 2008 R2 (64-bit)",
                  URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/22"),
                  null,
                  new ReferenceTypeImpl(
                        "Compute Options",
                        "application/xml",
                        URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/22/options/compute")),
                  new ReferenceTypeImpl(
                        "Customization Options",
                        "application/xml",
                        URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/catalogItem/22/options/customization")),
                  new ReferenceTypeImpl("Windows Web Server 2008 R2 (64-bit)",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                              .create("https://services.vcloudexpress.terremark.com/api/v0.8/vAppTemplate/22")),
                  ImmutableSortedMap.of("LicensingCost", "0")));
   }
View Full Code Here

                  URI.create("https://services.enterprisecloud.terremark.com/api/v0.8b-ext2.5/network/40031"),
                  null,
                  "10.122.209.129",
                  "255.255.255.240",
                  FenceMode.ISOLATED,
                  new ReferenceTypeImpl(
                        "10.122.209.128/28",
                        "application/xml",
                        URI.create("https://services.enterprisecloud.terremark.com/api/v0.8b-ext2.5/extensions/network/40031")),
                  new ReferenceTypeImpl(
                        "IP Addresses",
                        "application/xml",
                        URI.create("https://services.enterprisecloud.terremark.com/api/v0.8b-ext2.5/extensions/network/40031/ips"))));
   }
View Full Code Here

      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",
                              TerremarkVCloudMediaType.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",
                              TerremarkVCloudMediaType.VAPP_XML, URI
                                 .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null);
      assertEquals(result.getTasks(), ImmutableSortedSet.of(task1, task2));
   }
View Full Code Here

      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",
                              TerremarkVCloudMediaType.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",
                              TerremarkVCloudMediaType.VAPP_XML, URI
                                 .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null);
      assertEquals(result.getTasks(), ImmutableSortedSet.of(task1, task2));
   }
View Full Code Here

      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",
                  TerremarkVCloudMediaType.VAPP_XML,
                  URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null

      );
      assertEquals(result, expects);
View Full Code Here

      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",
                  TerremarkVCloudMediaType.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);
View Full Code Here

      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Miami Environment 1");
      assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32"));
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of(
            "adriantest",
            new ReferenceTypeImpl("adriantest", TerremarkVCloudMediaType.VAPP_XML, URI
                  .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15124")),
            "centos-53",
            new ReferenceTypeImpl("centos-53", TerremarkVCloudMediaType.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"))));
      assertEquals(
            result.getCatalog(),
            new ReferenceTypeImpl("Miami Environment 1", CATALOG_XML, URI
                  .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/catalog")));
      assertEquals(
            result.getPublicIps(),
            new ReferenceTypeImpl("Public IPs", "application/xml", URI
                  .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/publicIps")));
      assertEquals(
            result.getInternetServices(),
            new ReferenceTypeImpl("Internet Services", "application/xml", URI
                  .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/internetServices")));
   }
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

   }

   @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

TOP

Related Classes of org.jclouds.trmk.vcloud_0_8.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.