Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/jboss/JBoss3xContainer.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/jboss/JBoss3xContainer.java,v retrieving revision 1.10 diff -r1.10 JBoss3xContainer.java 59,64d58 < import java.io.File; < import java.io.IOException; < import java.util.jar.Attributes; < import java.util.jar.JarFile; < import java.util.jar.Manifest; < 69a64,81 > import org.w3c.dom.Document; > import org.w3c.dom.Element; > import org.w3c.dom.Node; > import org.xml.sax.EntityResolver; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; > > import javax.xml.parsers.DocumentBuilder; > import javax.xml.parsers.DocumentBuilderFactory; > import javax.xml.parsers.ParserConfigurationException; > import java.io.File; > import java.io.IOException; > import java.io.StringReader; > import java.util.Properties; > import java.util.jar.Attributes; > import java.util.jar.JarFile; > import java.util.jar.Manifest; > import java.util.zip.ZipEntry; 73c85 < * --- > * 75c87 < * --- > * 102a115,119 > /** > * The context root of the tested application > */ > private String testContextRoot; > 107c124 < * --- > * 119c136 < * --- > * 132,133c149,150 < * than the default one. < * --- > * than the default one. > * 138c155 < * --- > * 158c175 < * --- > * 165c182,190 < --- > > /** > * @return The root context, if found in jboss-web.xml > */ > public String getTestContext() > { > return testContextRoot; > } > 176c201 < + " not recognized as a JBoss 3.x installation"); --- > + " not recognized as a JBoss 3.x installation"); 181,182c206,207 < "This element doesn't support version " + this.version < + " of JBoss"); --- > "This element doesn't support version " + this.version > + " of JBoss"); 185c210,224 < // TODO: as long as we don't have a way to set the port on the JBoss --- > Document doc = null; > try > { > doc = getJBossWebXML(); > Element root = doc.getDocumentElement(); > Node context = > root.getElementsByTagName("context-root").item(0); > testContextRoot = context.getFirstChild().getNodeValue(); > } > catch (Exception e) > { > // no worries if we can't find what we are looking for (for now). > } > > // TODO: as long as we don't have a way to set the port on the JBoss 190a230,269 > * Get a Document object for the jboss-web.xml file > * @return The parsed XML Document object > * @throws IOException If there is a problem reading files > * @throws ParserConfigurationException If there is a problem w/ parser > * @throws SAXException If there is a problem with parsing > */ > private Document getJBossWebXML() throws > IOException, ParserConfigurationException, SAXException > { > Document doc = null; > File configDir = new File(this.dir, "server"); > File deployDir = new File(configDir, this.config + "/deploy"); > File warFile = new File(deployDir, > getDeployableFile().getFile().getName()); > > JarFile war = new JarFile(warFile); > ZipEntry entry = war.getEntry("WEB-INF/jboss-web.xml"); > if (entry != null) > { > DocumentBuilderFactory factory = > DocumentBuilderFactory.newInstance(); > factory.setValidating(false); > factory.setNamespaceAware(false); > > DocumentBuilder builder = factory.newDocumentBuilder(); > builder.setEntityResolver(new EntityResolver() > { > public InputSource resolveEntity(String thePublicId, > String theSystemId) throws SAXException > { > return new InputSource(new StringReader("")); > } > }); > doc = builder.parse(war.getInputStream(entry)); > } > war.close(); > return doc; > } > > /** 198c277 < --- > 201c280 < --- > 204c283 < --- > 206,207c285,286 < createSysProperty("program.name", < new File(binDir, "run.bat"))); --- > createSysProperty("program.name", > new File(binDir, "run.bat"))); 209,210c288,289 < createSysProperty("jboss.server.home.dir", < new File(configDir, this.config))); --- > createSysProperty("jboss.server.home.dir", > new File(configDir, this.config))); 212,213c291,292 < createSysProperty("jboss.server.home.url", < new File(configDir, this.config).toURL().toString())); --- > createSysProperty("jboss.server.home.url", > new File(configDir, this.config).toURL().toString())); 217c296 < new File(binDir, "run.jar")); --- > new File(binDir, "run.jar")); 237c316 < --- > 243c322 < new File(binDir, "shutdown.jar")); --- > new File(binDir, "shutdown.jar")); 261c340 < * Prepares a temporary installation of the container and deploys the --- > * Prepares a temporary installation of the container and deploys the 263c342 < * --- > * 274c353 < --- > 280,281c359,360 < new File(deployDir, getDeployableFile().getFile().getName()), < null, true); --- > new File(deployDir, getDeployableFile().getFile().getName()), > null, true); 286,287c365,366 < * < * @param theDir The JBoss installation directory --- > * > * @param theDir The JBoss installation directory Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/Container.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/Container.java,v retrieving revision 1.8 diff -r1.8 Container.java 110c110,116 < --- > > /** > * @return the context that the webapp will load on, null if the client > * should determine on it's own > */ > String getTestContext(); > Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractContainer.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractContainer.java,v retrieving revision 1.11 diff -r1.11 AbstractContainer.java 320c320,329 < --- > > /** > * @return the context that the webapp will load on, null if the client > * should determine on it's own > */ > public String getTestContext() > { > return null; > } > Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractDeployableFile.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractDeployableFile.java,v retrieving revision 1.2 diff -r1.2 AbstractDeployableFile.java 72c72,73 < public abstract class AbstractDeployableFile implements DeployableFile --- > public abstract class AbstractDeployableFile > implements DeployableFile, Cloneable 202a204,219 > } > > /** > * @return Cloned object > * @throws CloneNotSupportedException If clone is not supported (duh) > */ > public Object clone() throws CloneNotSupportedException > { > AbstractDeployableFile file = (AbstractDeployableFile) super.clone(); > file.deployableFile = this.deployableFile; > file.warArchive = this.warArchive; > file.testContext = this.testContext; > file.servletRedirectorMapping = this.servletRedirectorMapping; > file.filterRedirectorMapping = this.filterRedirectorMapping; > file.jspRedirectorMapping = this.jspRedirectorMapping; > return file; Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/DeployableFile.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/DeployableFile.java,v retrieving revision 1.2 diff -r1.2 DeployableFile.java 104a105,110 > * @param theTestContext the test context that will be used to test if the > * container is started or not > */ > void setTestContext(String theTestContext); > > /** 129a136,142 > > /** > * Standard Cloneable > * @return Clone of object > * @throws CloneNotSupportedException If clone is not supported (duh) > */ > Object clone() throws CloneNotSupportedException; Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/EarDeployableFile.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/EarDeployableFile.java,v retrieving revision 1.4 diff -r1.4 EarDeployableFile.java 67a68 > implements Cloneable Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/WarDeployableFile.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/WarDeployableFile.java,v retrieving revision 1.2 diff -r1.2 WarDeployableFile.java 67a68 > implements Cloneable Index: integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java,v retrieving revision 1.8 diff -r1.8 ContainerWrapper.java 140c140,149 < --- > > /** > * @return the context that the webapp will load on, null if the client > * should determine on it's own > */ > public String getTestContext() > { > return this.container.getTestContext(); > } > Index: integration/ant/src/java/org/apache/cactus/integration/ant/CactusTask.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/CactusTask.java,v retrieving revision 1.25 diff -r1.25 CactusTask.java 208a209,218 > DeployableFile thisDeployable = null; > try > { > thisDeployable = (DeployableFile) deployableFile.clone(); > } > catch (CloneNotSupportedException e) > { > throw new BuildException(e); > } > 211c221 < containers[i].setDeployableFile(deployableFile); --- > containers[i].setDeployableFile(thisDeployable); 217a228,232 > if (containers[i].getTestContext() != null) > { > thisDeployable.setTestContext( > containers[i].getTestContext()); > } 228,229c243,244 < + deployableFile.getTestContext()); < executeInContainer(containers[i], deployableFile); --- > + thisDeployable.getTestContext()); > executeInContainer(containers[i], thisDeployable); Index: integration/ant/src/test/org/apache/cactus/integration/ant/container/MockContainer.java =================================================================== RCS file: /home/cvspublic/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/MockContainer.java,v retrieving revision 1.9 diff -r1.9 MockContainer.java 158a159,167 > * @return the context that the webapp will load on, null if the client > * should determine on it's own > */ > public String getTestContext() > { > return null; > } > > /**