use of org.jboss.shrinkwrap.api.exporter.ZipExporter in project wildfly by wildfly.
the class AppClientWrapper method getAppClientCommand.
private String getAppClientCommand() throws Exception {
if (appClientCommand != null)
return appClientCommand;
final String tempDir = System.getProperty("java.io.tmpdir");
archiveOnDisk = new File(tempDir + File.separator + archive.getName());
if (archiveOnDisk.exists()) {
archiveOnDisk.delete();
}
final ZipExporter exporter = archive.as(ZipExporter.class);
exporter.exportTo(archiveOnDisk);
final String archiveArg;
if (clientArchiveName == null) {
archiveArg = archiveOnDisk.getAbsolutePath();
} else {
archiveArg = archiveOnDisk.getAbsolutePath() + "#" + clientArchiveName;
}
// TODO: Move to a shared testsuite lib.
String asDist = System.getProperty("jboss.dist");
if (asDist == null)
throw new Exception("'jboss.dist' property is not set.");
if (!new File(asDist).exists())
throw new Exception("AS dir from 'jboss.dist' doesn't exist: " + asDist + " user.dir: " + System.getProperty("user.dir"));
// TODO: Move to a shared testsuite lib.
String asInst = System.getProperty("jboss.inst");
if (asInst == null)
throw new Exception("'jboss.inst' property is not set. Perhaps this test is in a multi-node tests group but runs outside container?");
if (!new File(asInst).exists())
throw new Exception("AS dir from 'jboss.inst' doesn't exist: " + asInst + " user.dir: " + System.getProperty("user.dir"));
String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
appClientCommand = java + " -Djboss.modules.dir=" + asDist + "/modules" + " -Djline.WindowsTerminal.directConsole=false" + TestSuiteEnvironment.getIpv6Args() + "-Djboss.bind.address=" + TestSuiteEnvironment.getServerAddress() + " -jar " + asDist + "/jboss-modules.jar" + " -mp " + asDist + "/modules" + " org.jboss.as.appclient" + " -Djboss.server.base.dir=" + asInst + "/appclient" + " -Djboss.home.dir=" + asInst + " " + this.appClientArgs + " " + archiveArg + " " + args;
return appClientCommand;
}
Aggregations