vmassol 2003/09/07 13:17:11
Modified: integration/ant/src/java/org/apache/cactus/integration/ant/container
Tag: CACTUS_15_BRANCH Container.java
GenericContainer.java AbstractContainer.java
ContainerWrapper.java
integration/ant/src/java/org/apache/cactus/integration/ant
Tag: CACTUS_15_BRANCH CactusTask.java
integration/ant/src/java/org/apache/cactus/integration/ant/container/weblogic
Tag: CACTUS_15_BRANCH WebLogic7xContainer.java
documentation/docs/xdocs Tag: CACTUS_15_BRANCH changes.xml
integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat
Tag: CACTUS_15_BRANCH AbstractTomcatContainer.java
AbstractCatalinaContainer.java
Tomcat3xContainer.java
integration/ant/src/java/org/apache/cactus/integration/ant/deployment
Tag: CACTUS_15_BRANCH WebXmlVersion.java
ApplicationXmlTag.java WebXmlTag.java
ApplicationXmlVersion.java
integration/ant/src/test/org/apache/cactus/integration/ant/container
Tag: CACTUS_15_BRANCH MockContainer.java
TestAll.java TestAbstractContainer.java
integration/ant/src/java/org/apache/cactus/integration/ant/container/orion
Tag: CACTUS_15_BRANCH AbstractOrionContainer.java
integration/ant/src/java/org/apache/cactus/integration/ant/container/resin
Tag: CACTUS_15_BRANCH Resin2xContainer.java
integration/ant/src/java/org/apache/cactus/integration/ant/container/jboss
Tag: CACTUS_15_BRANCH JBoss3xContainer.java
integration/ant/src/test/org/apache/cactus/integration/ant
Tag: CACTUS_15_BRANCH TestCactusTask.java
Added: integration/ant/src/java/org/apache/cactus/integration/ant/container
Tag: CACTUS_15_BRANCH DeployableFile.java
AbstractDeployableFile.java WarDeployableFile.java
EarDeployableFile.java
Log:
Merged from CVS HEAD
Revision Changes Path
No revision
No revision
1.4.2.1 +2 -2
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/Container.java
Index: Container.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/Container.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- Container.java 14 May 2003 13:56:21 -0000 1.4
+++ Container.java 7 Sep 2003 20:17:09 -0000 1.4.2.1
@@ -144,7 +144,7 @@
*
* @param theDeployableFile The file to deploy
*/
- void setDeployableFile(File theDeployableFile);
+ void setDeployableFile(DeployableFile theDeployableFile);
/**
* Subclasses must implement this method to perform the actual task of
1.6.2.2 +0 -0
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/GenericContainer.java
Index: GenericContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/GenericContainer.java,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
1.6.2.2 +6 -32
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractContainer.java
Index: AbstractContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractContainer.java,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- AbstractContainer.java 29 Aug 2003 17:27:58 -0000 1.6.2.1
+++ AbstractContainer.java 7 Sep 2003 20:17:09 -0000 1.6.2.2
@@ -83,7 +83,6 @@
public abstract class AbstractContainer extends ProjectComponent
implements Container
{
-
// Constants ---------------------------------------------------------------
/**
@@ -95,9 +94,9 @@
// Instance Variables ------------------------------------------------------
/**
- * The web or application archive that should be deployed to the container.
+ * The WAR or EAR that should be deployed to the container.
*/
- private File deployableFile;
+ private DeployableFile deployableFile;
/**
* A pattern set which lists patterns for names of test cases that are to be
@@ -253,7 +252,7 @@
/**
* @see Container#setDeployableFile
*/
- public final void setDeployableFile(File theDeployableFile)
+ public final void setDeployableFile(DeployableFile theDeployableFile)
{
this.deployableFile = theDeployableFile;
}
@@ -331,9 +330,7 @@
ReplaceTokens replaceContext = new ReplaceTokens();
token = new ReplaceTokens.Token();
token.setKey("cactus.context");
- String contextPath = getDeployableFile().getName();
- contextPath = contextPath.substring(0, contextPath.length() - 4);
- token.setValue(contextPath);
+ token.setValue(getDeployableFile().getTestContext());
replaceContext.addConfiguredToken(token);
filterChain.addReplaceTokens(replaceContext);
@@ -393,32 +390,9 @@
*
* @return The WAR file
*/
- protected final File getDeployableFile()
+ protected final DeployableFile getDeployableFile()
{
return this.deployableFile;
- }
-
- /**
- * Returns whether the deployable file is an enterprise application archive
- * (EAR).
- *
- * @param theDeployableFile The deployable file to check
- * @return <code>true</code> if the deployable file is a EAR
- */
- protected final boolean isEar(File theDeployableFile)
- {
- return theDeployableFile.getName().toLowerCase().endsWith(".ear");
- }
-
- /**
- * Returns whether the deployable file is a web-app archive (WAR).
- *
- * @param theDeployableFile The deployable file to check
- * @return <code>true</code> if the deployable file is a WAR
- */
- protected final boolean isWar(File theDeployableFile)
- {
- return theDeployableFile.getName().toLowerCase().endsWith(".war");
}
// Private Methods ---------------------------------------------------------
1.5.2.1 +2 -2
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java
Index: ContainerWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- ContainerWrapper.java 14 May 2003 18:20:07 -0000 1.5
+++ ContainerWrapper.java 7 Sep 2003 20:17:09 -0000 1.5.2.1
@@ -180,7 +180,7 @@
/**
* @see Container#setDeployableFile
*/
- public void setDeployableFile(File theWarFile)
+ public void setDeployableFile(DeployableFile theWarFile)
{
this.container.setDeployableFile(theWarFile);
}
No revision
Index: ContainerWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- ContainerWrapper.java 14 May 2003 18:20:07 -0000 1.5
+++ ContainerWrapper.java 7 Sep 2003 20:17:09 -0000 1.5.2.1
@@ -180,7 +180,7 @@
/**
* @see Container#setDeployableFile
*/
- public void setDeployableFile(File theWarFile)
+ public void setDeployableFile(DeployableFile theWarFile)
{
this.container.setDeployableFile(theWarFile);
}
No revision
Index: ContainerWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/ContainerWrapper.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- ContainerWrapper.java 14 May 2003 18:20:07 -0000 1.5
+++ ContainerWrapper.java 7 Sep 2003 20:17:09 -0000 1.5.2.1
@@ -180,7 +180,7 @@
/**
* @see Container#setDeployableFile
*/
- public void setDeployableFile(File theWarFile)
+ public void setDeployableFile(DeployableFile theWarFile)
{
this.container.setDeployableFile(theWarFile);
}
1.1.2.1 +1 -1
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/DeployableFile.java
Index: DeployableFile.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/DeployableFile.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
1.1.2.1 +1 -1
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractDeployableFile.java
Index: AbstractDeployableFile.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/AbstractDeployableFile.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
1.1.2.1 +1 -1
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/WarDeployableFile.java
Index: WarDeployableFile.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/WarDeployableFile.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
1.1.2.1 +1 -1
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/EarDeployableFile.java
Index: EarDeployableFile.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/EarDeployableFile.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
No revision
No revision
1.20.2.1 +53 -234
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/CactusTask.java
Index: CactusTask.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/CactusTask.java,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -r1.20 -r1.20.2.1
--- CactusTask.java 11 Jun 2003 16:19:26 -0000 1.20
+++ CactusTask.java 7 Sep 2003 20:17:10 -0000 1.20.2.1
@@ -57,28 +57,23 @@
package org.apache.cactus.integration.ant;
import java.io.File;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
-import java.util.Iterator;
-
-import javax.xml.parsers.ParserConfigurationException;
import org.apache.cactus.integration.ant.container.Container;
import org.apache.cactus.integration.ant.container.ContainerRunner;
+import org.apache.cactus.integration.ant.container.DeployableFile;
+import org.apache.cactus.integration.ant.container.EarDeployableFile;
+import org.apache.cactus.integration.ant.container.WarDeployableFile;
import org.apache.cactus.integration.ant.util.AntLog;
import org.apache.cactus.integration.ant.util.AntTaskFactory;
-import org.apache.cactus.integration.ant.deployment.ApplicationXml;
-import org.apache.cactus.integration.ant.deployment.EarArchive;
-import org.apache.cactus.integration.ant.deployment.WarArchive;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.optional.junit.JUnitTask;
import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
import org.apache.tools.ant.types.Environment.Variable;
-import org.xml.sax.SAXException;
/**
* An Ant task that extends the optional JUnit task to provide support for
@@ -110,6 +105,13 @@
private File warFile;
/**
+ * The WAR context where the cactus tests are located. If not specified
+ * this task will try to guess the context from the WAR file name or if
+ * an EAR is used from parsing the <code>application.xml</code> file.
+ */
+ private String contextName;
+
+ /**
* The factory for creating ant tasks that is passed to the containers.
*/
private AntTaskFactory antTaskFactory = new AntTaskFactory()
@@ -136,6 +138,8 @@
*/
public CactusTask() throws Exception
{
+ // TODO: Fix comment for this constructor as it doesn't seem quite
+ // right. Explain why we don't call the super constructor?
}
// Public Methods ----------------------------------------------------------
@@ -166,54 +170,24 @@
+ "the [earfile] attribute");
}
- // Open the archive as JAR file and extract the deployment descriptor
- WarArchive war = null;
- String contextPath = null;
- try
+ if ((this.warFile != null) && (this.earFile != null))
{
- if (this.warFile != null)
- {
- war = new WarArchive(this.warFile);
- contextPath = this.warFile.getName();
- int warIndex = contextPath.toLowerCase().lastIndexOf(".war");
- if (warIndex >= 0)
- {
- contextPath = contextPath.substring(0, warIndex);
- }
- }
- else
- {
- EarArchive ear = new EarArchive(this.earFile);
- String webUri = getUriOfCactifiedWebModule(ear);
- if (webUri == null)
- {
- throw new BuildException("Could not find cactified web "
- + "module in the EAR");
- }
- war = ear.getWebModule(webUri);
- if (war == null)
- {
- throw new BuildException("Could not find the WAR " + webUri
- + " in the EAR");
- }
- contextPath =
- ear.getApplicationXml().getWebModuleContextRoot(webUri);
- }
- addRedirectorNameProperties(war);
- }
- catch (SAXException e)
- {
- throw new BuildException(
- "Parsing of deployment descriptor failed", e);
+ throw new BuildException("You must specify either the [warfile] or "
+ + "the [earfile] attribute but not both");
}
- catch (IOException e)
+
+ // Parse deployment descriptors for WAR or EAR files
+ DeployableFile deployableFile;
+ if (this.warFile != null)
{
- throw new BuildException("Failed to open WAR", e);
+ deployableFile = new WarDeployableFile(this.warFile);
}
- catch (ParserConfigurationException e)
+ else
{
- throw new BuildException("XML parser configuration error", e);
- }
+ deployableFile = new EarDeployableFile(this.earFile);
+ }
+
+ addRedirectorNameProperties(deployableFile);
if (this.containerSet == null)
{
@@ -231,8 +205,7 @@
{
containers[i].setAntTaskFactory(this.antTaskFactory);
containers[i].setLog(new AntLog(this));
- containers[i].setDeployableFile(
- this.earFile != null ? this.earFile : this.warFile);
+ containers[i].setDeployableFile(deployableFile);
if (containers[i].isEnabled())
{
containers[i].init();
@@ -246,8 +219,8 @@
Project.MSG_INFO);
contextUrl.setValue(
"http://localhost:" + containers[i].getPort() + "/"
- + contextPath);
- executeInContainer(containers[i], war, contextPath);
+ + deployableFile.getTestContext());
+ executeInContainer(containers[i], deployableFile);
}
}
}
@@ -301,6 +274,15 @@
this.warFile = theWarFile;
}
+ /**
+ * @param theContextName the context name of the webapp where the Cactus
+ * tests are located
+ */
+ public final void setContext(String theContextName)
+ {
+ this.contextName = theContextName;
+ }
+
// Private Methods ---------------------------------------------------------
/**
@@ -323,18 +305,12 @@
* Extracts the redirector mappings from the deployment descriptor and sets
* the corresponding system properties.
*
- * @param theWar The web-app archive
- * @throws IOException If there was a problem reading the deployment
- * descriptor in the WAR
- * @throws SAXException If the deployment descriptor of the WAR could not
- * be parsed
- * @throws ParserConfigurationException If there is an XML parser
- * configration problem
+ * @param theFile The file to deploy in the container
*/
- private void addRedirectorNameProperties(WarArchive theWar)
- throws SAXException, IOException, ParserConfigurationException
+ private void addRedirectorNameProperties(DeployableFile theFile)
{
- String filterRedirectorMapping = getFilterRedirectorMapping(theWar);
+ String filterRedirectorMapping =
+ theFile.getFilterRedirectorMapping();
if (filterRedirectorMapping != null)
{
addCactusProperty("filterRedirectorName",
@@ -345,7 +321,9 @@
log("No mapping of the filter redirector found",
Project.MSG_VERBOSE);
}
- String jspRedirectorMapping = getJspRedirectorMapping(theWar);
+
+ String jspRedirectorMapping =
+ theFile.getJspRedirectorMapping();
if (jspRedirectorMapping != null)
{
addCactusProperty("jspRedirectorName",
@@ -356,7 +334,9 @@
log("No mapping of the JSP redirector found",
Project.MSG_VERBOSE);
}
- String servletRedirectorMapping = getServletRedirectorMapping(theWar);
+
+ String servletRedirectorMapping =
+ theFile.getServletRedirectorMapping();
if (servletRedirectorMapping != null)
{
addCactusProperty("servletRedirectorName",
@@ -372,12 +352,10 @@
* Executes the unit tests in the given container.
*
* @param theContainer The container to run the tests against
- * @param theWar The web-app archive
- * @param theContextPath The context path to which the test web-app will be
- * deployed
+ * @param theFile the file to deploy in the container
*/
- private void executeInContainer(Container theContainer, WarArchive theWar,
- String theContextPath)
+ private void executeInContainer(Container theContainer,
+ DeployableFile theFile)
{
log("Starting up container", Project.MSG_VERBOSE);
ContainerRunner runner = new ContainerRunner(theContainer);
@@ -386,7 +364,8 @@
{
URL url =
new URL("http", "localhost", theContainer.getPort(), "/"
- + theContextPath + getServletRedirectorMapping(theWar)
+ + theFile.getTestContext()
+ + theFile.getServletRedirectorMapping()
+ "?Cactus_Service=RUN_TEST");
runner.setUrl(url);
if (this.containerSet.getTimeout() > 0)
@@ -424,165 +403,5 @@
{
throw new BuildException("Malformed test URL", mue);
}
- catch (SAXException saxe)
- {
- throw new BuildException("Error parsing a deployment descriptor",
- saxe);
- }
- catch (IOException ioe)
- {
- throw new BuildException(ioe);
- }
- catch (ParserConfigurationException pce)
- {
- throw new BuildException(pce);
- }
}
-
- /**
- * Returns the first URL-pattern to which the Cactus filter redirector is
- * mapped in the deployment descriptor.
- *
- * @param theWar The web-application archive
- * @return The mapping, or <code>null</code> if the filter redirector is not
- * defined or mapped in the descriptor
- * @throws IOException If there was a problem reading the deployment
- * descriptor in the WAR
- * @throws SAXException If the deployment descriptor of the WAR could not
- * be parsed
- * @throws ParserConfigurationException If there is an XML parser
- * configration problem
- */
- private String getFilterRedirectorMapping(WarArchive theWar)
- throws IOException, SAXException, ParserConfigurationException
- {
- Iterator filterNames = theWar.getWebXml().getFilterNamesForClass(
- "org.apache.cactus.server.FilterTestRedirector");
- if (filterNames.hasNext())
- {
- // we only care about the first definition and the first mapping
- String name = (String) filterNames.next();
- Iterator mappings = theWar.getWebXml().getFilterMappings(name);
- if (mappings.hasNext())
- {
- return (String) mappings.next();
- }
- }
- return null;
- }
-
- /**
- * Returns the first URL-pattern to which the Cactus JSP redirector is
- * mapped in the deployment descriptor.
- *
- * @param theWar The web-application archive
- * @return The mapping, or <code>null</code> if the JSP redirector is not
- * defined or mapped in the descriptor
- * @throws IOException If there was a problem reading the deployment
- * descriptor in the WAR
- * @throws SAXException If the deployment descriptor of the WAR could not
- * be parsed
- * @throws ParserConfigurationException If there is an XML parser
- * configration problem
- */
- private String getJspRedirectorMapping(WarArchive theWar)
- throws IOException, SAXException, ParserConfigurationException
- {
- // To get the JSP redirector mapping, we must first get the full path to
- // the corresponding JSP file in the WAR
- String jspRedirectorPath = theWar.findResource("jspRedirector.jsp");
- if (jspRedirectorPath != null)
- {
- jspRedirectorPath = "/" + jspRedirectorPath;
- Iterator jspNames = theWar.getWebXml().getServletNamesForJspFile(
- jspRedirectorPath);
- if (jspNames.hasNext())
- {
- // we only care about the first definition and the first
- // mapping
- String name = (String) jspNames.next();
- Iterator mappings = theWar.getWebXml().getServletMappings(name);
- if (mappings.hasNext())
- {
- return (String) mappings.next();
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the first URL-pattern to which the Cactus servlet redirector is
- * mapped in the deployment descriptor.
- *
- * @param theWar The web-application archive
- * @return The mapping, or <code>null</code> if the servlet redirector is
- * not defined or mapped in the descriptor
- * @throws IOException If there was a problem reading the deployment
- * descriptor in the WAR
- * @throws SAXException If the deployment descriptor of the WAR could not
- * be parsed
- * @throws ParserConfigurationException If there is an XML parser
- * configration problem
- */
- private String getServletRedirectorMapping(WarArchive theWar)
- throws SAXException, IOException, ParserConfigurationException
- {
- Iterator servletNames = theWar.getWebXml().getServletNamesForClass(
- "org.apache.cactus.server.ServletTestRedirector");
- if (servletNames.hasNext())
- {
- // we only care about the first definition and the first mapping
- String name = (String) servletNames.next();
- Iterator mappings = theWar.getWebXml().getServletMappings(name);
- if (mappings.hasNext())
- {
- return (String) mappings.next();
- }
- }
- return null;
- }
-
- /**
- * Finds the web module in the enterprise application archive that contains
- * the servlet test redirector, and returns the web-uri of the module found.
- *
- * <em>A web-app is considered cactified when it contains at least a mapping
- * for the Cactus servlet test redirector</em>
- *
- * @param theEar The enterprise application archive
- * @return The URI of the cactified web-module, or <code>null</code> if no
- * cactified web-app could be found
- */
- private String getUriOfCactifiedWebModule(EarArchive theEar)
- {
- try
- {
- ApplicationXml applicationXml = theEar.getApplicationXml();
- for (Iterator i = applicationXml.getWebModuleUris(); i.hasNext();)
- {
- String webUri = (String) i.next();
- WarArchive war = theEar.getWebModule(webUri);
- if ((war != null) && (getServletRedirectorMapping(war) != null))
- {
- return webUri;
- }
- }
- }
- catch (SAXException e)
- {
- throw new BuildException(
- "Parsing of deployment descriptor failed", e);
- }
- catch (IOException e)
- {
- throw new BuildException("Failed to open WAR", e);
- }
- catch (ParserConfigurationException e)
- {
- throw new BuildException("XML parser configuration error", e);
- }
- return null;
- }
-
}
No revision
No revision
1.5.2.3 +4 -4
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/weblogic/WebLogic7xContainer.java
Index: WebLogic7xContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/weblogic/WebLogic7xContainer.java,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -r1.5.2.2 -r1.5.2.3
--- WebLogic7xContainer.java 9 Aug 2003 16:46:27 -0000 1.5.2.2
+++ WebLogic7xContainer.java 7 Sep 2003 20:17:10 -0000 1.5.2.3
@@ -71,7 +71,7 @@
/**
* Special container support for the Bea WebLogic 7.x application server.
*
- * FIXME: this doesn't work for me on JDK 1.3.1 and WL 7.0 SP2
+ * TODO: this doesn't work for me on JDK 1.3.1 and WL 7.0 SP2
*
* @author <a href="mailto:[EMAIL PROTECTED]">Christopher Lenz</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
@@ -302,9 +302,9 @@
createDirectory(testDomainDir, "applications");
Jar jar = (Jar) createAntTask("jar");
jar.setDestFile(new File(applicationsDir,
- getDeployableFile().getName()));
+ getDeployableFile().getFile().getName()));
ZipFileSet zip = new ZipFileSet();
- zip.setSrc(getDeployableFile());
+ zip.setSrc(getDeployableFile().getFile());
jar.addZipfileset(zip);
ZipFileSet fileSet = new ZipFileSet();
fileSet.setDir(this.tmpDir);
No revision
No revision
1.120.2.6 +2 -4 jakarta-cactus/documentation/docs/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/changes.xml,v
retrieving revision 1.120.2.5
retrieving revision 1.120.2.6
diff -u -r1.120.2.5 -r1.120.2.6
--- changes.xml 31 Aug 2003 14:38:18 -0000 1.120.2.5
+++ changes.xml 7 Sep 2003 20:17:10 -0000 1.120.2.6
@@ -74,10 +74,8 @@
<code>tearDown()</code> methods were not called.
</action>
<action dev="VMA" type="fix" fixes-bug="22794" due-to="Jonathan Kovacs"
due-to-email="[EMAIL PROTECTED]">
- In the Ant integration, the <code>cactus.context</code> filter token
- was not correctly defined for EAR files. However, it is needed. For
- example the default Orion's <code>application.xml</code> config file
- provided by Cactus needs it.
+ In the Ant integration, when using the <cactus> task with
+ an EAR, the test webapp context was not correctly set.
</action>
<action dev="VMA" type="fix" fixes-bug="22249" due-to="James Stangler"
due-to-email="[EMAIL PROTECTED]">
Fixed the <code>JettyTestSetup</code> class so that it stops the
No revision
No revision
1.3.2.1 +2 -2
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/AbstractTomcatContainer.java
Index: AbstractTomcatContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/AbstractTomcatContainer.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- AbstractTomcatContainer.java 13 May 2003 12:39:08 -0000 1.3
+++ AbstractTomcatContainer.java 7 Sep 2003 20:17:10 -0000 1.3.2.1
@@ -189,7 +189,7 @@
throw new BuildException(this.dir + " is not a directory");
}
- if (!getDeployableFile().getName().toLowerCase().endsWith(".war"))
+ if (!getDeployableFile().isWar())
{
throw new BuildException("Tomcat doesn't support the "
+ "deployment of EAR files");
1.4.2.1 +4 -3
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/AbstractCatalinaContainer.java
Index: AbstractCatalinaContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/AbstractCatalinaContainer.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- AbstractCatalinaContainer.java 25 May 2003 15:41:42 -0000 1.4
+++ AbstractCatalinaContainer.java 7 Sep 2003 20:17:10 -0000 1.4.2.1
@@ -256,8 +256,9 @@
// deploy the web-app by copying the WAR file into the webapps
// directory
File webappsDir = createDirectory(tmpDir, "webapps");
- fileUtils.copyFile(getDeployableFile(),
- new File(webappsDir, getDeployableFile().getName()), null, true);
+ fileUtils.copyFile(getDeployableFile().getFile(),
+ new File(webappsDir, getDeployableFile().getFile().getName()),
+ null, true);
}
}
1.5.2.1 +4 -3
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/Tomcat3xContainer.java
Index: Tomcat3xContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/tomcat/Tomcat3xContainer.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- Tomcat3xContainer.java 15 Jun 2003 19:01:04 -0000 1.5
+++ Tomcat3xContainer.java 7 Sep 2003 20:17:10 -0000 1.5.2.1
@@ -197,8 +197,9 @@
// deploy the web-app by copying the WAR file
File webappsDir = createDirectory(tmpDir, "webapps");
- fileUtils.copyFile(getDeployableFile(),
- new File(webappsDir, getDeployableFile().getName()), null, true);
+ fileUtils.copyFile(getDeployableFile().getFile(),
+ new File(webappsDir, getDeployableFile().getFile().getName()),
+ null, true);
}
}
No revision
No revision
1.3.2.2 +0 -0
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlVersion.java
Index: WebXmlVersion.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlVersion.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
1.2.2.2 +0 -0
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlTag.java
Index: ApplicationXmlTag.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlTag.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
1.7.2.2 +0 -0
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlTag.java
Index: WebXmlTag.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/WebXmlTag.java,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -r1.7.2.1 -r1.7.2.2
1.3.2.2 +0 -0
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlVersion.java
Index: ApplicationXmlVersion.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/deployment/ApplicationXmlVersion.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
No revision
No revision
1.6.2.1 +2 -2
jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/MockContainer.java
Index: MockContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/MockContainer.java,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- MockContainer.java 11 Jun 2003 16:16:41 -0000 1.6
+++ MockContainer.java 7 Sep 2003 20:17:10 -0000 1.6.2.1
@@ -187,7 +187,7 @@
/**
* @see Container#setDeployableFile
*/
- public void setDeployableFile(File theWarFile)
+ public void setDeployableFile(DeployableFile theWarFile)
{
}
1.3.2.2 +0 -0
jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/TestAll.java
Index: TestAll.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/TestAll.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
1.1.2.3 +16 -4
jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/TestAbstractContainer.java
Index: TestAbstractContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/container/TestAbstractContainer.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- TestAbstractContainer.java 30 Aug 2003 16:41:16 -0000 1.1.2.2
+++ TestAbstractContainer.java 7 Sep 2003 20:17:10 -0000 1.1.2.3
@@ -115,8 +115,20 @@
*/
public void testCreateFilterChainOk() throws Exception
{
- File earFile = new File("test.ear");
- this.container.setDeployableFile(earFile);
+ String testInputDirProperty = System.getProperty("testinput.dir");
+ assertTrue("The system property 'testinput.dir' must be set",
+ testInputDirProperty != null);
+ File testInputDir = new File(testInputDirProperty);
+ assertTrue("The system property 'testinput.dir' must point to an "
+ + "existing directory", testInputDir.isDirectory());
+ String fileName =
+ "org/apache/cactus/integration/ant/cactified.ear";
+ File earFile = new File(testInputDir, fileName);
+ assertTrue("The test input " + fileName + " does not exist",
+ earFile.exists());
+
+ this.container.setDeployableFile(
+ new EarDeployableFile(earFile));
// Note that we needed to add a last character to the string
// after the @cactus.context@ token as otherwise the Ant code
@@ -131,6 +143,6 @@
helper.setFilterChains(chains);
helper.setPrimaryReader(new StringReader(buffer));
Reader reader = helper.getAssembledReader();
- assertEquals("8080:test:", helper.readFully(reader));
+ assertEquals("8080:/empty:", helper.readFully(reader));
}
}
No revision
No revision
1.4.2.1 +4 -3
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion/AbstractOrionContainer.java
Index: AbstractOrionContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion/AbstractOrionContainer.java,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- AbstractOrionContainer.java 25 May 2003 15:41:42 -0000 1.4
+++ AbstractOrionContainer.java 7 Sep 2003 20:17:11 -0000 1.4.2.1
@@ -249,8 +249,9 @@
// throws an error
createDirectory(tmpDir, "persistence");
- fileUtils.copyFile(getDeployableFile(),
- new File(tmpDir, getDeployableFile().getName()), null, true);
+ fileUtils.copyFile(getDeployableFile().getFile(),
+ new File(tmpDir, getDeployableFile().getFile().getName()),
+ null, true);
}
}
No revision
No revision
1.5.2.1 +4 -3
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/resin/Resin2xContainer.java
Index: Resin2xContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/resin/Resin2xContainer.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- Resin2xContainer.java 15 Jun 2003 19:01:04 -0000 1.5
+++ Resin2xContainer.java 7 Sep 2003 20:17:11 -0000 1.5.2.1
@@ -262,8 +262,9 @@
new File(tmpDir, "resin.conf"), filterChain);
}
- fileUtils.copyFile(getDeployableFile(),
- new File(tmpDir, getDeployableFile().getName()), null, true);
+ fileUtils.copyFile(getDeployableFile().getFile(),
+ new File(tmpDir, getDeployableFile().getFile().getName()),
+ null, true);
}
}
No revision
No revision
1.6.2.2 +4 -3
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/jboss/JBoss3xContainer.java
Index: JBoss3xContainer.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/jboss/JBoss3xContainer.java,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- JBoss3xContainer.java 9 Aug 2003 14:52:16 -0000 1.6.2.1
+++ JBoss3xContainer.java 7 Sep 2003 20:17:11 -0000 1.6.2.2
@@ -287,8 +287,9 @@
// directory
File configDir = new File(this.dir, "server");
File deployDir = new File(configDir, this.config + "/deploy");
- fileUtils.copyFile(getDeployableFile(),
- new File(deployDir, getDeployableFile().getName()), null, true);
+ fileUtils.copyFile(getDeployableFile().getFile(),
+ new File(deployDir, getDeployableFile().getFile().getName()),
+ null, true);
}
/**
No revision
No revision
1.10.2.1 +2 -2
jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/TestCactusTask.java
Index: TestCactusTask.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/test/org/apache/cactus/integration/ant/TestCactusTask.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- TestCactusTask.java 26 May 2003 13:27:18 -0000 1.10
+++ TestCactusTask.java 7 Sep 2003 20:17:11 -0000 1.10.2.1
@@ -127,7 +127,7 @@
}
catch (BuildException expected)
{
- assertEquals("Failed to open WAR", expected.getMessage());
+ assertEquals("Failed to open archive", expected.getMessage());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]