Package org.jclouds.trmk.vcloud_0_8.domain

Examples of org.jclouds.trmk.vcloud_0_8.domain.CatalogItem


      for (Org org : orgs) {
         for (ReferenceType cat : org.getCatalogs().values()) {
            Catalog response = api.getCatalog(cat.getHref());
            for (ReferenceType resource : response.values()) {
               if (resource.getType().equals(TerremarkVCloudMediaType.CATALOGITEM_XML)) {
                  CatalogItem item = api.getCatalogItem(resource.getHref());
                  if (item.getEntity().getType().equals(TerremarkVCloudMediaType.VAPPTEMPLATE_XML)) {
                     assertNotNull(api.getVAppTemplate(item.getEntity().getHref()));
                  }
               }
            }
         }
      }
View Full Code Here


      for (Org org : orgs) {
         for (ReferenceType cat : org.getCatalogs().values()) {
            Catalog response = api.getCatalog(cat.getHref());
            for (ReferenceType resource : response.values()) {
               if (resource.getType().equals(TerremarkVCloudMediaType.CATALOGITEM_XML)) {
                  CatalogItem item = api.getCatalogItem(resource.getHref());
                  if (item.getEntity().getType().equals(TerremarkVCloudMediaType.VAPPTEMPLATE_XML)) {
                     assertNotNull(api.findVAppTemplateInOrgCatalogNamed(org.getName(), response.getName(), item
                           .getEntity().getName()));
                  }
               }
            }
         }
View Full Code Here

   public void testApplyInputStream() {

      InputStream is = getClass().getResourceAsStream("/catalogItem-terremark.xml");

      CatalogItem result = factory.create(
            injector.getInstance(CatalogItemHandler.class)).parse(is);
      assertEquals(
            result,
            new CatalogItemImpl(
                  "Windows Web Server 2008 R2 (64-bit)",
View Full Code Here

   public void test1() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream(
            "/CustomizationParameters.xml");

      CustomizationParameters result = factory
            .create(injector.getInstance(CustomizationParametersHandler.class))
            .parse(is);
      assertEquals(result, new CustomizationParameters(true, false, false));
   }
View Full Code Here

      return returnVal.equals("") ? null : returnVal;
   }

   @Override
   public CustomizationParameters getResult() {
      return new CustomizationParameters(customizeNetwork, customizePassword, customizeSSH);
   }
View Full Code Here

   public void test() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/InternetServices.xml");

      Set<InternetService> result = factory.create(injector.getInstance(InternetServicesHandler.class)).parse(is);
      assertEquals(result.toString(), ImmutableSet.of(new InternetService("IS_for_Jim2", URI
               .create("https://services.vcloudexpress.terremark.com/api/v0.8/InternetServices/524"),
               new PublicIpAddress("10.1.22.159", URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/PublicIps/4208")), 45,
               Protocol.HTTP, false, 1, "Some test service")).toString());
   }
View Full Code Here

public class KeyPairByNameHandlerTest extends BaseHandlerTest {

   public void testGood() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/keysList.xml");

      KeyPair result = factory.create(
            addOrgAndNameToHandler(injector.getInstance(KeyPairByNameHandler.class), "org", "default")).parse(is);
      assertEquals(result,
            new KeyPair(URI.create("https://services.vcloudexpress.terremark.com/api/v0.8a-ext1.6/extensions/key/9"),
                  "default", true, null, "4e:af:8a:9f:e9:d2:72:d7:4b:a0:da:98:72:98:4d:7d"));

   }
View Full Code Here

   }

   public void testNotFound() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/keysList.xml");

      KeyPair result = factory.create(
            addOrgAndNameToHandler(injector.getInstance(KeyPairByNameHandler.class), "org", "monster")).parse(is);
      assertNull(result);
   }
View Full Code Here

      TerremarkVCloudTemplateOptions options = new TerremarkVCloudTemplateOptions();

      // create mocks
      CreateNewKeyPairUnlessUserSpecifiedOtherwise strategy = setupStrategy();
      LoginCredentials keyPairCredentials = LoginCredentials.builder().privateKey(KeyPairHandlerTest.keyPair.getPrivateKey()).build();
      KeyPair keyPair = createMock(KeyPair.class);

      // setup expectations
      expect(strategy.credentialStore.containsKey("group#group")).andReturn(false);
      expect(strategy.createUniqueKeyPair.apply(new OrgAndName(org, "group"))).andReturn(keyPair);
      expect(keyPair.getFingerPrint()).andReturn(KeyPairHandlerTest.keyPair.getFingerPrint()).atLeastOnce();
      expect(strategy.credentialStore.put("group#group", keyPairCredentials)).andReturn(null);

      // replay mocks
      replay(keyPair);
      replayStrategy(strategy);
View Full Code Here

            "fa:69:2c:0c:81:03:80:39:33:4d:de:ef:13:3c:e6:ef");

   public void testGood() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/key.xml");

      KeyPair result = factory.create(injector.getInstance(KeyPairHandler.class)).parse(is);

      assertEquals(result, keyPair);
      assertEquals(result.getFingerPrint(), SshKeys.fingerprintPrivateKey(result.getPrivateKey()));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.trmk.vcloud_0_8.domain.CatalogItem

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.