try {
// just make sure we don't get an "option not recognized" warning
system.getOptions(WarProbeOption.class);
LOG.info("deploying probe");
Deployer deployer = glassFish.getDeployer();
/*
* FIXME The following should work, but does not. For some reason, we cannot directly
* deploy from a stream. As a workaround, we copy the stream to a temp file and deploy
* the file.
*
* deployer.deploy( stream, "--name", "Pax-Exam-Probe", "--contextroot",
* "Pax-Exam-Probe" );
*/
File tempFile = File.createTempFile("pax-exam", ".war");
tempFile.deleteOnExit();
StreamUtils.copyStream(stream, new FileOutputStream(tempFile), true);
deployer.deploy(tempFile, "--name", PROBE_APPLICATION_NAME, "--contextroot",
PROBE_APPLICATION_NAME);
deployed.push(PROBE_APPLICATION_NAME);
}
catch (GlassFishException exc) {
throw new TestContainerException(exc);