System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
System.setProperty("org.jboss.logging.provider", "slf4j");
wildFlyHome = cm.getProperty("pax.exam.wildfly80.home");
if (wildFlyHome == null) {
throw new TestContainerException(
"System property pax.exam.wildfly80.home must be set to WildFly 8.0 install root");
}
String configDirName = cm.getProperty(WILDFLY80_CONFIG_DIR_KEY,
"src/test/resources/wildfly80-config");
configSourceDir = new File(configDirName);
boolean overwriteConfig = Boolean.parseBoolean(cm.getProperty(WILDFLY80_CONFIG_OVERWRITE_KEY,
"false"));
if (isValidInstallation()) {
if (overwriteConfig) {
installConfiguration();
}
}
else {
LOG.info("installing WildFly 8.0 in {}", wildFlyHome);
String distUrl = cm.getProperty(WILDFLY80_DIST_URL_KEY, WILDFLY80_DIST_URL_DEFAULT);
LOG.info("installing WildFly 8.0 from {} in {}", distUrl, wildFlyHome);
try {
URL url = new URL(distUrl);
File installDir = new File(wildFlyHome);
File installParent = installDir.getParentFile();
File tempInstall = new File(installParent, UUID.randomUUID().toString());
ZipInstaller installer = new ZipInstaller(url, tempInstall.getAbsolutePath());
installer.downloadAndInstall();
File unpackedRoot = tempInstall.listFiles()[0];
unpackedRoot.renameTo(installDir);
installWildFlyModules();
installConfiguration();
}
catch (IOException exc) {
throw new TestContainerException("error during WildFly 8.0 installation", exc);
}
}
}