EC2TemplateOptions extends TemplateOptions implements Cloneable { @Override public EC2TemplateOptions blockOnPort(int port, int seconds) { return EC2TemplateOptions.class.cast(super.blockOnPort(port, seconds)); }  @Override EC2TemplateOptions clone(); @Override void copyTo(TemplateOptions to); @Override boolean equals(Object o); @Override int hashCode(); @Override ToStringHelper string(); EC2TemplateOptions securityGroups(String... groupNames); EC2TemplateOptions securityGroups(Iterable<String> groupNames); EC2TemplateOptions userData(byte[] unencodedData); EC2TemplateOptions keyPair(String keyPair); EC2TemplateOptions noKeyPair(); EC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName, String snapshotId,
         @Nullable Integer sizeInGib, boolean deleteOnTermination); EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination); EC2TemplateOptions mapEphemeralDeviceToDeviceName(String deviceName, String virtualName); EC2TemplateOptions unmapDeviceNamed(String deviceName); EC2TemplateOptions blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings); @Override EC2TemplateOptions blockOnPort(int port, int seconds); @Override EC2TemplateOptions inboundPorts(int... ports); @Override EC2TemplateOptions authorizePublicKey(String publicKey); @Override EC2TemplateOptions installPrivateKey(String privateKey); @Override EC2TemplateOptions blockUntilRunning(boolean blockUntilRunning); @Override EC2TemplateOptions dontAuthorizePublicKey(); @Override EC2TemplateOptions nameTask(String name); @Override EC2TemplateOptions runAsRoot(boolean runAsRoot); @Override EC2TemplateOptions runScript(Statement script); @Override EC2TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials); @Override EC2TemplateOptions overrideLoginPassword(String password); @Override EC2TemplateOptions overrideLoginPrivateKey(String privateKey); @Override EC2TemplateOptions overrideLoginUser(String loginUser); @Override EC2TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo); @Override EC2TemplateOptions userMetadata(Map<String, String> userMetadata); @Override EC2TemplateOptions userMetadata(String key, String value); @Override EC2TemplateOptions runScript(String script); @Override EC2TemplateOptions tags(Iterable<String> tags); @Override EC2TemplateOptions wrapInInitScript(boolean wrapInInitScript); @Override EC2TemplateOptions blockOnComplete(boolean blockOnComplete); Set<String> getGroups(); String getKeyPair(); boolean shouldAutomaticallyCreateKeyPair(); byte[] getUserData(); Set<BlockDeviceMapping> getBlockDeviceMappings(); static final EC2TemplateOptions NONE; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testblockOnPortBadFormat() { EC2TemplateOptions options = new EC2TemplateOptions(); options.blockOnPort(-1, -1); }
@Test public void testblockOnPort() { EC2TemplateOptions options = new EC2TemplateOptions(); options.blockOnPort(22, 30); assertEquals(options.getPort(), 22); assertEquals(options.getSeconds(), 30); }
@Test public void testblockOnPortStatic() { EC2TemplateOptions options = blockOnPort(22, 30); assertEquals(options.getPort(), 22); assertEquals(options.getSeconds(), 30); }