Package org.jclouds.aws.ec2.compute

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


      assertEquals(options.getInboundPorts()[0], 22);
   }

   @Test
   public void testinboundPortsStatic() {
      AWSEC2TemplateOptions options = inboundPorts(22, 30);
      assertEquals(options.getInboundPorts()[0], 22);
      assertEquals(options.getInboundPorts()[1], 30);
   }


      assertEquals(options.getInboundPorts()[1], 30);
   }

   @Test
   public void testIAMInstanceProfileArn() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.iamInstanceProfileArn("arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver");
      assertEquals(options.getIAMInstanceProfileArn(), "arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver");
   }

      assertEquals(options.getIAMInstanceProfileArn(), "arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver");
   }

   @Test
   public void testNullIAMInstanceProfileArn() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      assertEquals(options.getIAMInstanceProfileArn(), null);
   }

      assertEquals(options.getIAMInstanceProfileArn(), null);
   }

   @Test
   public void testIAMInstanceProfileArnStatic() {
      AWSEC2TemplateOptions options = iamInstanceProfileArn("arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver");
      assertEquals(options.getIAMInstanceProfileArn(), "arn:aws:iam::123456789012:instance-profile/application_abc/component_xyz/Webserver");
   }

      iamInstanceProfileArn(null);
   }

   @Test
   public void testIAMInstanceProfileName() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.iamInstanceProfileName("Webserver");
      assertEquals(options.getIAMInstanceProfileName(), "Webserver");
   }

      assertEquals(options.getIAMInstanceProfileName(), "Webserver");
   }

   @Test
   public void testNullIAMInstanceProfileName() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      assertEquals(options.getIAMInstanceProfileName(), null);
   }

      assertEquals(options.getIAMInstanceProfileName(), null);
   }

   @Test
   public void testIAMInstanceProfileNameStatic() {
      AWSEC2TemplateOptions options = iamInstanceProfileName("Webserver");
      assertEquals(options.getIAMInstanceProfileName(), "Webserver");
   }

* @author Adrian Cole
*/
public class AWSEC2TemplateOptionsTest {

   public void testAs() {
      TemplateOptions options = new AWSEC2TemplateOptions();
      assertEquals(options.as(AWSEC2TemplateOptions.class), options);
   }

      assertEquals(options.as(AWSEC2TemplateOptions.class), options);
   }

   @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "all security groups must be non-empty")
   public void testsecurityGroupIdsIterableBadFormat() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.securityGroupIds(ImmutableSet.of("groupId1", ""));
   }

      options.securityGroupIds(ImmutableSet.of("groupId1", ""));
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testsecurityGroupIdsIterableEmptyNotOk() {
      AWSEC2TemplateOptions options = new AWSEC2TemplateOptions();
      options.securityGroupIds(ImmutableSet.<String> of());
   }

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.