public static JBossAsManagedConfiguration getSlaveConfiguration(String hostConfigPath, String testName) throws URISyntaxException {
File domains = new File("target" + File.separator + "domains" + File.separator + testName);
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
final JBossAsManagedConfiguration slaveConfig = new JBossAsManagedConfiguration();
slaveConfig.setHostName("slave");
slaveConfig.setHostControllerManagementAddress(slaveAddress);
slaveConfig.setHostControllerManagementPort(19999);
slaveConfig.setHostCommandLineProperties("-Djboss.test.host.master.address=" + masterAddress +
" -Djboss.test.host.slave.address=" + slaveAddress);
URL url = tccl.getResource(hostConfigPath);
slaveConfig.setHostConfigFile(new File(url.toURI()).getAbsolutePath());
System.out.println(slaveConfig.getHostConfigFile());
File slaveDir = new File(domains, "slave");
// TODO this should not be necessary
new File(slaveDir, "configuration").mkdirs();
slaveConfig.setDomainDirectory(slaveDir.getAbsolutePath());
System.out.println(slaveConfig.getDomainDirectory());
return slaveConfig;
}