in src/main/java/org/apache/sling/testing/serversetup/ServerSetup.java [127:157]
public synchronized void setupTestServer() throws Exception {
// On the first call, list our available phases
if(donePhases.isEmpty()) {
if(log.isInfoEnabled()) {
final List<String> ids = new ArrayList<String>();
ids.addAll(phases.keySet());
Collections.sort(ids);
log.info("Will run SetupPhases {} out of {}", phasesToRun, ids);
}
}
// Run all startup phases that didn't run yet
runRemainingPhases(true);
// And setup our shutdown hook
if(shutdownHook == null) {
shutdownHook = new Thread(getClass().getSimpleName() + "Shutdown") {
public void run() {
try {
shutdown();
} catch(Exception e) {
log.warn("Exception in shutdown hook", e);
}
}
};
Runtime.getRuntime().addShutdownHook(shutdownHook);
log.info("Shutdown hook added to run shutdown phases");
}
}