Package org.jclouds.trmk.vcloud_0_8.domain

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


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

public class NetworkExtendedInfoHandlerTest extends BaseHandlerTest {

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

      NetworkExtendedInfo result = factory.create(injector.getInstance(NetworkExtendedInfoHandler.class)).parse(is);
      assertEquals(result, new NetworkExtendedInfo("XXXXX", URI
               .create("https://services.enterprisecloud.terremark.com/api/v0.8b-ext2.5/extensions/network/XXXXX"),
               "10.X.X.0/27", "209.X.X.X", "10.X.X.0", "10.X.X.X", "10.X.X.1", NetworkExtendedInfo.Type.DMZ, "279",
               "10.X.X.0/27 (DMZ_279)"));
   }
View Full Code Here

public class NodeHandlerTest extends BaseHandlerTest {

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

      Node result = factory.create(injector.getInstance(NodeHandler.class)).parse(is);
      assertEquals(result, new Node("Node for Jim", URI
            .create("https://services.vcloudexpress.terremark.com/api/v0.8/NodeServices/242"), "172.16.20.3", 80,
            false, "Some test node"));
   }
View Full Code Here

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

   @Override
   public Node getResult() {
      return new Node(serviceName, location, address, port, enabled, description);
   }
View Full Code Here

         }
         logger.debug("<< created InternetService(%s) %s:%s:%d", is.getName(), is.getPublicIpAddress().getAddress(),
               is.getProtocol(), is.getPort());
         logger.debug(">> adding Node %s:%d -> %s:%d", is.getPublicIpAddress().getAddress(), is.getPort(),
               privateAddress, port);
         Node node = client.addNode(is.getId(), privateAddress, vApp.getName() + "-" + port, port);
         logger.debug("<< added Node(%s)", node.getName());
      }
      return ip != null ? ip.getAddress() : null;
   }
View Full Code Here

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

      Set<Node> result = factory.create(injector.getInstance(NodesHandler.class)).parse(is);
      assertEquals(result, ImmutableSet.of(new Node("Node for Jim", URI
            .create("https://services.vcloudexpress.terremark.com/api/v0.8/NodeServices/242"), "172.16.20.3", 80,
            false, "Some test node")));
   }
View Full Code Here

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

      Set<Node> result = factory.create(injector.getInstance(NodesHandler.class)).parse(is);
      assertEquals(result, ImmutableSet.of(new Node("Node for Jim", URI
            .create("https://services.vcloudexpress.terremark.com/api/v0.8/NodeServices/242"), "172.16.20.3", 80,
            false, "Some test node")));
   }
View Full Code Here

public class NodeHandlerTest extends BaseHandlerTest {

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

      Node result = factory.create(injector.getInstance(NodeHandler.class)).parse(is);
      assertEquals(result, new Node("Node for Jim", URI
            .create("https://services.vcloudexpress.terremark.com/api/v0.8/NodeServices/242"), "172.16.20.3", 80,
            false, "Some test node"));
   }
View Full Code Here

TOP

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

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.