@Test( expected = TargetException.class ) public void testInvalidConfiguration() throws Exception { Ec2IaasHandler.parseProperties( new HashMap<String,String> ()); }
static void parseProperties( Map<String, String> targetProperties ) throws TargetException { String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NAME, Ec2Constants.SECURITY_GROUP_NAME }; for( String property : properties ) { if( StringUtils.isBlank( targetProperties.get( property ))) throw new TargetException( "The value for " + property + " cannot be null or empty." ); } }
Ec2IaasHandler extends AbstractThreadedTargetHandler { static void parseProperties( Map<String, String> targetProperties ) throws TargetException { String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NAME, Ec2Constants.SECURITY_GROUP_NAME }; for( String property : properties ) { if( StringUtils.isBlank( targetProperties.get( property ))) throw new TargetException( "The value for " + property + " cannot be null or empty." ); } } }
Ec2IaasHandler extends AbstractThreadedTargetHandler { static void parseProperties( Map<String, String> targetProperties ) throws TargetException { String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NAME, Ec2Constants.SECURITY_GROUP_NAME }; for( String property : properties ) { if( StringUtils.isBlank( targetProperties.get( property ))) throw new TargetException( "The value for " + property + " cannot be null or empty." ); } }  }
Ec2IaasHandler extends AbstractThreadedTargetHandler { static void parseProperties( Map<String, String> targetProperties ) throws TargetException { String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NAME, Ec2Constants.SECURITY_GROUP_NAME }; for( String property : properties ) { if( StringUtils.isBlank( targetProperties.get( property ))) throw new TargetException( "The value for " + property + " cannot be null or empty." ); } }  @Override String getTargetId(); @Override String createMachine( TargetHandlerParameters parameters ); @Override MachineConfigurator machineConfigurator( TargetHandlerParameters parameters, String machineId ); @Override boolean isMachineRunning( TargetHandlerParameters parameters, String machineId ); @Override void terminateMachine( TargetHandlerParameters parameters, String machineId ); @Override String retrievePublicIpAddress( TargetHandlerParameters parameters, String machineId ); static AmazonEC2 createEc2Client( Map<String,String> targetProperties ); }
Ec2IaasHandler extends AbstractThreadedTargetHandler { static void parseProperties( Map<String, String> targetProperties ) throws TargetException { String[] properties = { Ec2Constants.EC2_ENDPOINT, Ec2Constants.EC2_ACCESS_KEY, Ec2Constants.EC2_SECRET_KEY, Ec2Constants.AMI_VM_NODE, Ec2Constants.VM_INSTANCE_TYPE, Ec2Constants.SSH_KEY_NAME, Ec2Constants.SECURITY_GROUP_NAME }; for( String property : properties ) { if( StringUtils.isBlank( targetProperties.get( property ))) throw new TargetException( "The value for " + property + " cannot be null or empty." ); } }  @Override String getTargetId(); @Override String createMachine( TargetHandlerParameters parameters ); @Override MachineConfigurator machineConfigurator( TargetHandlerParameters parameters, String machineId ); @Override boolean isMachineRunning( TargetHandlerParameters parameters, String machineId ); @Override void terminateMachine( TargetHandlerParameters parameters, String machineId ); @Override String retrievePublicIpAddress( TargetHandlerParameters parameters, String machineId ); static AmazonEC2 createEc2Client( Map<String,String> targetProperties ); static final String TARGET_ID; }