Package org.jclouds.aws.ec2.compute

Examples of org.jclouds.aws.ec2.compute.AWSEC2TemplateOptions$Builder


   }

   @Test
   public void testsecurityGroupsIterableStatic() {
      AWSEC2TemplateOptions options = securityGroups(ImmutableSet.of("group1", "group2"));
      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }


      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }

   @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "all security groups must be non-empty")
   public void testsecurityGroupsVarArgsBadFormat() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.securityGroups("mygroup", "");
   }

      options.securityGroups("mygroup", "");
   }

   @Test
   public void testsecurityGroupsVarArgs() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.securityGroups("group1", "group2");
      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }

      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testsecurityGroupsVarArgsEmptyNotOk() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.securityGroups();
   }

      options.securityGroups();
   }

   @Test
   public void testDefaultGroupsVarArgsEmpty() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      assertEquals(options.getGroups(), ImmutableSet.of());
   }

      assertEquals(options.getGroups(), ImmutableSet.of());
   }

   @Test
   public void testsecurityGroupsVarArgsStatic() {
      AWSEC2TemplateOptions options = securityGroups("group1", "group2");
      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }

      assertEquals(options.getGroups(), ImmutableSet.of("group1", "group2"));
   }

   @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "use noKeyPair option to request boot without a keypair")
   public void testkeyPairBadFormat() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.keyPair("");
   }

      options.keyPair("");
   }

   @Test(expectedExceptions = IllegalStateException.class)
   public void testkeyPairAndNoKeyPair() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.keyPair("mykeypair");
      options.noKeyPair();
   }

      options.noKeyPair();
   }

   @Test(expectedExceptions = IllegalStateException.class)
   public void testNoKeyPairAndKeyPair() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.noKeyPair();
      options.keyPair("mykeypair");
   }

      options.keyPair("mykeypair");
   }

   @Test
   public void testkeyPair() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.keyPair("mykeypair");
      assertEquals(options.getKeyPair(), "mykeypair");
   }

TOP

Related Classes of org.jclouds.aws.ec2.compute.AWSEC2TemplateOptions$Builder

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.