Minor polishing.

This commit is contained in:
Mattias Hellborg Arthursson
2013-11-18 16:46:04 +01:00
parent 086497d66e
commit b9985e5759
42 changed files with 378 additions and 403 deletions

View File

@@ -45,7 +45,7 @@ public abstract class AbstractEc2InstanceLaunchingFactoryBean extends AbstractFa
private static final long DEFAULT_PREPARATION_SLEEP_TIME = 30000;
private static final Logger log = LoggerFactory.getLogger(AbstractEc2InstanceLaunchingFactoryBean.class);
private static final Logger LOG = LoggerFactory.getLogger(AbstractEc2InstanceLaunchingFactoryBean.class);
private String imageName;
@@ -114,7 +114,7 @@ public abstract class AbstractEc2InstanceLaunchingFactoryBean extends AbstractFa
Assert.hasLength(keypairName, "KeyName must be set");
Assert.hasLength(groupName, "GroupName must be set");
log.info("Launching EC2 instance for image: " + imageName);
LOG.info("Launching EC2 instance for image: " + imageName);
Jec2 jec2 = new Jec2(awsKey, awsSecretKey);
LaunchConfiguration launchConfiguration = new LaunchConfiguration(imageName);
@@ -124,18 +124,18 @@ public abstract class AbstractEc2InstanceLaunchingFactoryBean extends AbstractFa
ReservationDescription reservationDescription = jec2.runInstances(launchConfiguration);
instance = reservationDescription.getInstances().get(0);
while (!instance.isRunning() && !instance.isTerminated()) {
log.info("Instance still starting up; sleeping " + INSTANCE_START_SLEEP_TIME + "ms");
LOG.info("Instance still starting up; sleeping " + INSTANCE_START_SLEEP_TIME + "ms");
Thread.sleep(INSTANCE_START_SLEEP_TIME);
reservationDescription = jec2.describeInstances(Collections.singletonList(instance.getInstanceId())).get(0);
instance = reservationDescription.getInstances().get(0);
}
if (instance.isRunning()) {
log.info("EC2 instance is now running");
LOG.info("EC2 instance is now running");
if (preparationSleepTime > 0) {
log.info("Sleeping " + preparationSleepTime + "ms allowing instance services to start up properly.");
LOG.info("Sleeping " + preparationSleepTime + "ms allowing instance services to start up properly.");
Thread.sleep(preparationSleepTime);
log.info("Instance prepared - proceeding");
LOG.info("Instance prepared - proceeding");
}
return doCreateInstance(instance.getDnsName());
} else {
@@ -156,7 +156,7 @@ public abstract class AbstractEc2InstanceLaunchingFactoryBean extends AbstractFa
@Override
protected void destroyInstance(Object ignored) throws Exception {
if (this.instance != null) {
log.info("Shutting down instance");
LOG.info("Shutting down instance");
Jec2 jec2 = new Jec2(awsKey, awsSecretKey);
jec2.terminateInstances(Collections.singletonList(this.instance.getInstanceId()));
}

View File

@@ -49,10 +49,7 @@ import java.util.Set;
* @author Mattias Hellborg Arthursson
*/
public final class LdapTestUtils {
private final static Logger logger = LoggerFactory.getLogger(LdapTestUtils.class);
public static final String DEFAULT_PRINCIPAL = "uid=admin,ou=system";
public static final String DEFAULT_PASSWORD = "secret";
private final static Logger LOGGER = LoggerFactory.getLogger(LdapTestUtils.class);
private static EmbeddedLdapServer embeddedServer;
@@ -194,7 +191,7 @@ public final class LdapTestUtils {
}
}
} catch (NamingException e) {
logger.debug("Error cleaning sub-contexts", e);
LOGGER.debug("Error cleaning sub-contexts", e);
} finally {
try {
enumeration.close();