Author: julien(a)jboss.com
Date: 2008-04-10 12:40:49 -0400 (Thu, 10 Apr 2008)
New Revision: 10524
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointRequest.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointResponse.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointServlet.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebRequest.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebResponse.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/EndPointTestCase.java
modules/web/trunk/web/src/test/resources/portal-test-endpoint-jar/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/jboss-web.xml
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/web.xml
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/web.xml
Removed:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/request/
modules/web/trunk/web/src/test/resources/portal-test-request-jar/
Modified:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/Body.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebRequest.java
modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebResponse.java
modules/web/trunk/web/src/test/build.xml
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/ServletTestCase.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/TestServlet.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/GetTestCase.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostApplicationXWWWFormURLEncodedTestCase.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostMultipartFormDataTestCase.java
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java
modules/web/trunk/web/src/test/resources/portal-test-endpoint-jar/org/jboss/portal/test/web/server-beans.xml
Log:
start to add notion of endpoint in web module and improved much the build.xml file
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/Body.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/Body.java 2008-04-10 14:24:38
UTC (rev 10523)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/Body.java 2008-04-10 16:40:49
UTC (rev 10524)
@@ -57,7 +57,7 @@
/** . */
private final ParameterMap parameters;
- Form(String characterEncoding, ParameterMap parameters)
+ public Form(String characterEncoding, ParameterMap parameters)
{
super(characterEncoding);
@@ -86,7 +86,7 @@
/** . */
private boolean consumed;
- Raw(String characterEncoding, HttpServletRequest request)
+ public Raw(String characterEncoding, HttpServletRequest request)
{
super(characterEncoding);
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebRequest.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebRequest.java 2008-04-10
14:24:38 UTC (rev 10523)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebRequest.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -22,14 +22,11 @@
******************************************************************************/
package org.jboss.portal.web;
-import org.jboss.portal.common.http.QueryStringParser;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.net.media.MediaType;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import java.util.Map;
import java.nio.charset.Charset;
-import java.io.UnsupportedEncodingException;
/**
* Add useful information about an <code>HttpServletRequest</code>.
@@ -37,7 +34,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class WebRequest extends HttpServletRequestWrapper
+public interface WebRequest extends HttpServletRequest
{
public enum Verb
@@ -47,172 +44,23 @@
}
/** . */
- public static final String APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE =
"application/x-www-form-urlencoded";
+ MediaType APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE =
MediaType.APPLICATION_X_WWW_FORM_URLENCODED;
/** . */
- public static final String MULTIPART_FORM_DATA_MEDIA_TYPE =
"multipart/form-data";
+ MediaType MULTIPART_FORM_DATA_MEDIA_TYPE = MediaType.MULTIPART_FORM_DATA_MEDIA_TYPE;
/** . */
- public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
+ Charset UTF_8_CHARSET = Charset.forName("UTF-8");
- /** . */
- private final ParameterMap queryParameterMap;
+ Verb getVerb();
- /** . */
- private final Body body;
+ ParameterMap getQueryParameterMap();
- /** . */
- private final Verb verb;
+ Body getBody();
- /** . */
- private final String mediaType;
+ MediaType getMediaType();
- public WebRequest(HttpServletRequest req) throws UnsupportedEncodingException,
IllegalRequestException
- {
- super(req);
+ String getWebRequestPath();
- //
- Verb verb;
- if ("GET".equals(req.getMethod()))
- {
- verb = Verb.GET;
- }
- else if ("POST".equals(req.getMethod()))
- {
- verb = Verb.POST;
- }
- else
- {
- throw new IllegalRequestException("HTTP Method " + req.getMethod() +
" not accepted");
- }
-
- // Compute the media type in the content type
- String mediaType = retrieveMediaType(req.getContentType());
-
- // Parse the query string to have the get parameters
- // The resulting map has its parameters decoded from the x-www-form-url encoding
- ParameterMap queryParameterMap;
- String queryString = req.getQueryString();
- if (queryString != null)
- {
- queryParameterMap =
QueryStringParser.getInstance().parseQueryString(queryString);
- }
- else
- {
- queryParameterMap = new ParameterMap();
- }
-
- // Only affect the charset encoding if the servlet container will decode the
request
- Body body = null;
- if (verb == Verb.POST)
- {
- if (APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE.equals(mediaType))
- {
- // Now we must ensure that we have either an equals or a trailing space after
the media-type
- String characterEncoding = req.getCharacterEncoding();
- if (characterEncoding == null)
- {
- // Set out charset for the request
- req.setCharacterEncoding(UTF_8_CHARSET.name());
- }
- else
- {
- Charset charset = Charset.forName(characterEncoding);
- if (!UTF_8_CHARSET.equals(charset))
- {
- throw new IllegalRequestException("Charset " +
characterEncoding + " not accepted, it should be UTF8");
- }
- }
-
- //
- ParameterMap bodyParameterMap = new ParameterMap();
- for (Map.Entry<String, String[]> entry : ((Map<String,
String[]>)req.getParameterMap()).entrySet())
- {
- // Get param name
- String paramName = entry.getKey();
-
- // Values that are aggregated from the query string and the body
- String[] paramValues = entry.getValue();
-
- // Values decoded from the query string
- String[] queryValues = queryParameterMap.get(paramName);
- if (queryValues != null)
- {
- int bodyValuesLength = paramValues.length - queryValues.length;
- if (bodyValuesLength > 0)
- {
- String[] bodyValues = new String[bodyValuesLength];
- System.arraycopy(paramValues, queryValues.length, bodyValues, 0,
bodyValuesLength);
- bodyParameterMap.put(paramName, bodyValues);
- }
- }
- else
- {
- bodyParameterMap.put(paramName, paramValues);
- }
- }
-
- //
- body = new Body.Form(req.getCharacterEncoding(), bodyParameterMap);
- }
- else
- {
- body = new Body.Raw(req.getCharacterEncoding(), req);
- }
- }
-
- //
- this.verb = verb;
- this.queryParameterMap = new ParameterMap(queryParameterMap);
- this.body = body;
- this.mediaType = mediaType;
- }
-
- public Verb getVerb()
- {
- return verb;
- }
-
- public Charset getCharset()
- {
- return UTF_8_CHARSET;
- }
-
- public ParameterMap getQueryParameterMap()
- {
- return queryParameterMap;
- }
-
- public Body getBody()
- {
- return body;
- }
-
- public String getMediaType()
- {
- return mediaType;
- }
-
- private String retrieveMediaType(String contentType)
- {
- String mediaType = contentType;
-
- //
- if (mediaType != null)
- {
- // Remove any parameters
- int index = mediaType.indexOf(';');
- if (index != -1)
- {
- mediaType = contentType.substring(0, index);
- }
-
- // Trim
- mediaType = mediaType.trim();
-
- // Media type matching is case insensitive, so we convert to lower case
- mediaType = mediaType.toLowerCase();
- }
- return mediaType;
- }
+ String getWebContextPath();
}
Modified: modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebResponse.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebResponse.java 2008-04-10
14:24:38 UTC (rev 10523)
+++ modules/web/trunk/web/src/main/java/org/jboss/portal/web/WebResponse.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -22,8 +22,12 @@
******************************************************************************/
package org.jboss.portal.web;
-import javax.servlet.http.HttpServletResponseWrapper;
+import org.jboss.portal.common.servlet.URLFormat;
+
import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+import java.io.Writer;
+import java.io.IOException;
/**
* todo
@@ -31,10 +35,36 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class WebResponse extends HttpServletResponseWrapper
+public interface WebResponse extends HttpServletResponse
{
- public WebResponse(HttpServletResponse resp)
- {
- super(resp);
- }
+
+ /**
+ * Renders an URL and returns the rendered string.
+ *
+ * The path argument is mandatory and must begin with '/' char. The parameters
argument is optional and the
+ * wantedURLFormat is also optional.
+ *
+ * @param path the path relative to the web context
+ * @param parameters the optional parameter map
+ * @param wantedURLFormat the url format needed
+ * @return the rendered URL
+ * @throws IllegalArgumentException if the path value is not correct
+ */
+ String renderURL(String path, Map<String, String[]> parameters, URLFormat
wantedURLFormat) throws IllegalArgumentException;
+
+ /**
+ * Renders an URL in the provided writer.
+ *
+ * The path argument is mandatory and must begin with '/' char. The parameters
argument is optional and the
+ * wantedURLFormat is also optional.
+ *
+ * @param writer the writer
+ * @param path the path relative to the web context
+ * @param parameters the optional parameter map
+ * @param wantedURLFormat the url format needed
+ * @throws IllegalArgumentException if the path value is not correct or the write is
null
+ * @throws IOException any IOException thrown by the writer
+ */
+ void renderURL(Writer writer, String path, Map<String, String[]> parameters,
URLFormat wantedURLFormat) throws IllegalArgumentException, IOException;
+
}
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointRequest.java
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointRequest.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointRequest.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.endpoint;
+
+import org.jboss.portal.web.impl.AbstractWebRequest;
+import org.jboss.portal.web.IllegalRequestException;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EndPointRequest extends AbstractWebRequest
+{
+
+ /** . */
+ private final String webRequestPath;
+
+ /** . */
+ private final String webContextPath;
+
+ public EndPointRequest(HttpServletRequest req, String webRequestPath, String
webContextPath)
+ throws UnsupportedEncodingException, IllegalRequestException
+ {
+ super(req);
+
+ //
+ this.webRequestPath = webRequestPath;
+ this.webContextPath = webContextPath;
+ }
+
+ public String getWebRequestPath()
+ {
+ return webRequestPath;
+ }
+
+ public String getWebContextPath()
+ {
+ return webContextPath;
+ }
+}
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointResponse.java
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointResponse.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointResponse.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.endpoint;
+
+import org.jboss.portal.web.impl.AbstractWebResponse;
+import org.jboss.portal.common.servlet.URLFormat;
+import org.jboss.portal.common.text.CharBuffer;
+import org.jboss.portal.common.text.FastURLEncoder;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+/**
+ * Todo: find a way to manage the different servlet that take care of
security/authenticated as today it is hardcoded.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class EndPointResponse extends AbstractWebResponse
+{
+
+ /** The fast url encoder. */
+ private static final FastURLEncoder urlEncoder = FastURLEncoder.getUTF8Instance();
+
+ /** . */
+ private final String requestRelativePrefix;
+
+ /** . */
+ private final String requestPrefix;
+
+ public EndPointResponse(HttpServletRequest req, HttpServletResponse resp)
+ {
+ super(resp);
+
+ //
+ StringBuffer requestRelativePrefix = new StringBuffer();
+
requestRelativePrefix.append(req.getScheme()).append("://").append(req.getServerName());
+ if (req.isSecure())
+ {
+ if (req.getServerPort() != 443)
+ {
+
requestRelativePrefix.append(":").append(Integer.toString(req.getServerPort()));
+ }
+ }
+ else if (req.getServerPort() != 80)
+ {
+
requestRelativePrefix.append(":").append(Integer.toString(req.getServerPort()));
+ }
+ requestRelativePrefix.append(req.getContextPath());
+
+ //
+ this.requestRelativePrefix = requestRelativePrefix.toString();
+ this.requestPrefix = req.getContextPath();
+ }
+
+ public String renderURL(String path, Map<String, String[]> parameters, URLFormat
wantedURLFormat) throws IllegalArgumentException
+ {
+ Buffer buffer = new Buffer(wantedURLFormat);
+
+ //
+ return buffer.toString(path, parameters);
+ }
+
+ public class Buffer extends CharBuffer
+ {
+
+ /** . */
+ private final URLFormat format;
+
+ /** . */
+ private final int prefixLength;
+
+ /** . */
+ private final String parameterSeparator;
+
+ public Buffer(URLFormat format)
+ {
+ if (!format.getRelative())
+ {
+ append(requestRelativePrefix);
+ }
+ else
+ {
+ append(requestPrefix);
+ }
+
+ // Append the servlet path
+ if (format.getSecure())
+ {
+ if (format.getAuthenticated())
+ {
+ append("/authsec");
+ }
+ else
+ {
+ append("/sec");
+ }
+ }
+ else
+ {
+ if (format.getAuthenticated())
+ {
+ append("/auth");
+ }
+ else
+ {
+ //
+ }
+ }
+
+ // Save the prefix length
+ this.prefixLength = length;
+ this.format = format;
+ this.parameterSeparator = format.getEscapeXML() ? "&" :
"&";
+ }
+
+ public String toString(String path, Map<String, String[]> parameters)
+ {
+ // Reset the prefix length
+ this.length = prefixLength;
+
+ // julien : check UTF-8 is ok and should not be dependant on the response
charset ????
+ // same for xml escape
+ append(path);
+
+ //
+ boolean first = true;
+ if (parameters != null)
+ {
+ for (Map.Entry parameter: parameters.entrySet())
+ {
+ String name = (String)parameter.getKey();
+ String[] values = (String[])parameter.getValue();
+ for (String value : values)
+ {
+ append(first ? "?" : parameterSeparator);
+ append(name, urlEncoder);
+ append('=');
+ append(value, urlEncoder);
+ first = false;
+ }
+ }
+ }
+
+ // Stringify
+ String s = asString();
+
+ // Let the servlet rewrite the URL if necessary
+ if (format.getServletEncoded())
+ {
+ s = encodeURL(s);
+ }
+
+ //
+ return s;
+ }
+ }
+}
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointServlet.java
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointServlet.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/endpoint/EndPointServlet.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,184 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.endpoint;
+
+import org.xml.sax.InputSource;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Element;
+import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.text.FastURLDecoder;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
+import org.apache.log4j.Logger;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import javax.servlet.ServletContext;
+import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathConstants;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * A web end point.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class EndPointServlet extends HttpServlet
+{
+
+ /** . */
+ private final static Logger log = Logger.getLogger(EndPointServlet.class);
+
+ /** . */
+ private FastURLDecoder decoder = FastURLDecoder.getUTF8Instance();
+
+ /** Describes a default servlet mapping. */
+ public static final int DEFAULT_SERVLET_MAPPING = 0;
+
+ /** Describes a root path mapping. */
+ public static final int ROOT_PATH_MAPPING = 1;
+
+ /** Describes a path mapping. */
+ public static final int PATH_MAPPING = 2;
+
+ /** . */
+ private Integer mappingStyle;
+
+ public void init() throws ServletException
+ {
+ String servletName = getServletConfig().getServletName();
+
+ //
+ ServletContext servletContext = getServletContext();
+
+ // XPath expression for selecting the url pattern for this servlet instance
+ String xpathExpression = "//servlet-mapping[servlet-name='" +
servletName + "']/url-pattern";
+ XPath xpath = XPathFactory.newInstance().newXPath();
+
+ //
+ log.debug("Going to look for the configuration of the end point servlet "
+ servletName);
+
+ // Obtain url pattern values in order to find out how this servlet instance is
mapped
+ InputStream in = servletContext.getResourceAsStream("/WEB-INF/web.xml");
+ try
+ {
+ NodeList nodes = (NodeList)xpath.evaluate(xpathExpression, new InputSource(in),
XPathConstants.NODESET);
+
+ //
+ for (int i = 0;i < nodes.getLength();i++)
+ {
+ Element urlPatternElt = (Element)nodes.item(i);
+
+ //
+ String urlPattern = XMLTools.asString(urlPatternElt, true);
+
+ //
+ log.debug("Found url pattern " + urlPattern + " for end point
servlet " + servletName);
+
+ //
+ if (mappingStyle != null)
+ {
+ throw new ServletException("The same end point servlet " +
servletName + " is mapped several times and this is not allowed");
+ }
+
+ //
+ if (urlPattern.equals("/"))
+ {
+ mappingStyle = DEFAULT_SERVLET_MAPPING;
+ }
+ else if (urlPattern.equals("/*"))
+ {
+ mappingStyle = ROOT_PATH_MAPPING;
+ }
+ else if (urlPattern.startsWith("/") &&
urlPattern.endsWith("/*"))
+ {
+ mappingStyle = PATH_MAPPING;
+ }
+ else
+ {
+ throw new ServletException("The end point servlet " +
servletName + " is mapped with a pattern value " + urlPattern);
+ }
+ }
+ }
+ catch (XPathExpressionException e)
+ {
+ throw new ServletException(e);
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ }
+
+ protected final void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ String requestURI = req.getRequestURI();
+ String servletPath = req.getServletPath();
+ String contextPath = req.getContextPath();
+
+ // Determine the request path
+ String webRequestPath = null;
+ String webContextPath = null;
+ switch (mappingStyle)
+ {
+ case DEFAULT_SERVLET_MAPPING:
+ webRequestPath = requestURI.substring(contextPath.length());
+ webContextPath = requestURI.substring(0, contextPath.length());
+ break;
+ case ROOT_PATH_MAPPING:
+ webRequestPath = requestURI.substring(contextPath.length());
+ webContextPath = requestURI.substring(0, contextPath.length());
+ break;
+ case PATH_MAPPING:
+ webRequestPath = requestURI.substring(contextPath.length() +
servletPath.length());
+ webContextPath = requestURI.substring(0, contextPath.length() +
servletPath.length());
+ break;
+ }
+
+ // Apply the url decoding
+ webRequestPath = decoder.encode(webRequestPath);
+ webContextPath = decoder.encode(webContextPath);
+
+ //
+ service(new EndPointRequest(req, webRequestPath, webContextPath), new
EndPointResponse(req, resp));
+ }
+
+ protected abstract void service(WebRequest req, WebResponse resp) throws
ServletException, IOException;
+
+ /**
+ * Returns the style of mapping of the endpoint.
+ *
+ * @return the mapping style
+ */
+ public Integer getMappingStyle()
+ {
+ return mappingStyle;
+ }
+}
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebRequest.java
===================================================================
--- modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebRequest.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebRequest.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,195 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl;
+
+import org.jboss.portal.common.http.QueryStringParser;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.net.media.ContentType;
+import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.common.net.media.Parameter;
+import org.jboss.portal.web.Body;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.portal.web.WebRequest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.util.Map;
+import java.nio.charset.Charset;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Add useful information about an <code>HttpServletRequest</code>.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractWebRequest extends HttpServletRequestWrapper implements
WebRequest
+{
+
+ /** . */
+ public static final MediaType APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE =
MediaType.APPLICATION_X_WWW_FORM_URLENCODED;
+
+ /** . */
+ public static final MediaType MULTIPART_FORM_DATA_MEDIA_TYPE =
MediaType.create("multipart/form-data");
+
+ /** . */
+ public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
+
+ /** . */
+ private final ParameterMap queryParameterMap;
+
+ /** . */
+ private final Body body;
+
+ /** . */
+ private final Verb verb;
+
+ /** . */
+ private final MediaType mediaType;
+
+ public AbstractWebRequest(HttpServletRequest req) throws UnsupportedEncodingException,
IllegalRequestException
+ {
+ super(req);
+
+ //
+ Verb verb;
+ if ("GET".equals(req.getMethod()))
+ {
+ verb = Verb.GET;
+ }
+ else if ("POST".equals(req.getMethod()))
+ {
+ verb = Verb.POST;
+ }
+ else
+ {
+ throw new IllegalRequestException("HTTP Method " + req.getMethod() +
" not accepted");
+ }
+
+ // Compute the media type in the content type
+ MediaType mediaType = null;
+ if (req.getContentType() != null)
+ {
+ ContentType contentType = ContentType.create(req.getContentType());
+ mediaType = contentType.getMediaType();
+ }
+
+ // Parse the query string to have the get parameters
+ // The resulting map has its parameters decoded from the x-www-form-url encoding
+ ParameterMap queryParameterMap;
+ String queryString = req.getQueryString();
+ if (queryString != null)
+ {
+ queryParameterMap =
QueryStringParser.getInstance().parseQueryString(queryString);
+ }
+ else
+ {
+ queryParameterMap = new ParameterMap();
+ }
+
+ // Only affect the charset encoding if the servlet container will decode the
request
+ Body body = null;
+ if (verb == Verb.POST)
+ {
+ if (APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE.equals(mediaType))
+ {
+ // Now we must ensure that we have either an equals or a trailing space after
the media-type
+ String characterEncoding = req.getCharacterEncoding();
+ if (characterEncoding == null)
+ {
+ // Set out charset for the request
+ req.setCharacterEncoding(UTF_8_CHARSET.name());
+ }
+ else
+ {
+ Charset charset = Charset.forName(characterEncoding);
+ if (!UTF_8_CHARSET.equals(charset))
+ {
+ throw new IllegalRequestException("Charset " +
characterEncoding + " not accepted, it should be UTF8");
+ }
+ }
+
+ //
+ ParameterMap bodyParameterMap = new ParameterMap();
+ for (Map.Entry<String, String[]> entry : ((Map<String,
String[]>)req.getParameterMap()).entrySet())
+ {
+ // Get param name
+ String paramName = entry.getKey();
+
+ // Values that are aggregated from the query string and the body
+ String[] paramValues = entry.getValue();
+
+ // Values decoded from the query string
+ String[] queryValues = queryParameterMap.get(paramName);
+ if (queryValues != null)
+ {
+ int bodyValuesLength = paramValues.length - queryValues.length;
+ if (bodyValuesLength > 0)
+ {
+ String[] bodyValues = new String[bodyValuesLength];
+ System.arraycopy(paramValues, queryValues.length, bodyValues, 0,
bodyValuesLength);
+ bodyParameterMap.put(paramName, bodyValues);
+ }
+ }
+ else
+ {
+ bodyParameterMap.put(paramName, paramValues);
+ }
+ }
+
+ //
+ body = new Body.Form(req.getCharacterEncoding(), bodyParameterMap);
+ }
+ else
+ {
+ body = new Body.Raw(req.getCharacterEncoding(), req);
+ }
+ }
+
+ //
+ this.verb = verb;
+ this.queryParameterMap = new ParameterMap(queryParameterMap);
+ this.body = body;
+ this.mediaType = mediaType;
+ }
+
+ public Verb getVerb()
+ {
+ return verb;
+ }
+
+ public ParameterMap getQueryParameterMap()
+ {
+ return queryParameterMap;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+
+ public MediaType getMediaType()
+ {
+ return mediaType;
+ }
+}
\ No newline at end of file
Added:
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebResponse.java
===================================================================
---
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebResponse.java
(rev 0)
+++
modules/web/trunk/web/src/main/java/org/jboss/portal/web/impl/AbstractWebResponse.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl;
+
+import org.jboss.portal.web.WebResponse;
+import org.jboss.portal.common.servlet.URLFormat;
+
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.Writer;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * todo
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractWebResponse extends HttpServletResponseWrapper implements
WebResponse
+{
+ public AbstractWebResponse(HttpServletResponse resp)
+ {
+ super(resp);
+ }
+
+ /**
+ * The implementation renders the URL by delegating to the {@link
AbstractWebResponse#renderURL(String, java.util.Map,
org.jboss.portal.common.servlet.URLFormat)}
+ * methods and then prints it in the specified writer. The method can be overriden in
order to provide a customized implementation.
+ */
+ public void renderURL(Writer writer, String path, Map<String, String[]>
parameters, URLFormat wantedURLFormat) throws IllegalArgumentException, IOException
+ {
+ if (writer == null)
+ {
+ throw new IllegalArgumentException("No null writer accepted");
+ }
+
+ //
+ String value = renderURL(path, parameters, wantedURLFormat);
+
+ //
+ writer.write(value);
+ }
+}
\ No newline at end of file
Modified: modules/web/trunk/web/src/test/build.xml
===================================================================
--- modules/web/trunk/web/src/test/build.xml 2008-04-10 14:24:38 UTC (rev 10523)
+++ modules/web/trunk/web/src/test/build.xml 2008-04-10 16:40:49 UTC (rev 10524)
@@ -8,16 +8,15 @@
<echo message="test classpath: ${test_classpath}"/>
<echo message="plugin classpath: ${plugin_classpath}"/>
+ <!-- -->
+ <delete dir="${test.temp.dir}"/>
<antcall target="package-tests"/>
-
+ <!-- -->
<antcall target="tests.local"/>
<antcall target="tests.call.single"/>
<antcall target="tests.call.all"/>
- <!--Cleanup-->
- <delete dir="${test.temp.dir}"/>
-
</target>
<target name="tests.call.all" unless="tests">
@@ -34,7 +33,7 @@
<antcall target="tests.jboss-4.2"/>
</target>
<target name="tests.tomcat">
- <antcall target="tests.tomcat-6"/>
+ <antcall target="tests.tomcat-6.0"/>
</target>
<target name="prepare_env">
@@ -157,13 +156,6 @@
</path>
<path id="mc.jboss_aop">
<pathelement path="${dependency.jboss-aop.jar}"/>
- <!--<pathelement
path="${dependency.jboss-aop-as4-deployer.jar}"/>-->
- <!--<pathelement
path="${dependency.jboss-aop-deployer-jdk50.jar}"/>-->
- <!--<pathelement
path="${dependency.jboss-aop-jdk50.jar}"/>-->
- <!--<pathelement
path="${dependency.jboss-aop-jdk50-client.jar}"/>-->
- <!--<pathelement
path="${dependency.jboss-standalone-aspect-library-jdk50.jar}"/>-->
- <!--<pathelement
path="${dependency.jrockit-pluggable-instrumentor.jar}"/>-->
- <!--<pathelement
path="${dependency.pluggable-instrumentor.jar}"/>-->
</path>
<path id="mc.jboss_microcontainer">
<pathelement path="${dependency.jboss-aop-mc-int.jar}"/>
@@ -205,33 +197,19 @@
<pathelement path="${dependency.log4j.jar}"/>
</path>
- <!-- **************************** -->
- <!-- Tomcat 6.0 container servlet -->
- <!-- **************************** -->
-
- <copy
todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path id="jboss-4.2">
<path refid="mc.portal-common"/>
- <path refid="mc.jboss-unit"/>
- <path refid="mc.jboss-remoting"/>
- <path refid="mc.log4j"/>
- <path refid="mc.concurrent"/>
+ <path refid="mc.portal-test-generic"/>
<path refid="mc.trove"/>
- <path refid="mc.xerces"/>
<path refid="mc.javassist"/>
<path refid="mc.jboss_common_core"/>
<path refid="mc.jboss_vfs"/>
<path refid="mc.jboss_xb"/>
<path refid="mc.jboss_aop"/>
<path refid="mc.jboss_microcontainer"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
+ </path>
- <!-- **************************** -->
- <!-- Tomcat 6.0 lifecyle listener -->
- <!-- **************************** -->
-
-
- <copy
todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib"
flatten="true">
+ <path id="tomcat-6.0">
<path refid="mc.portal-common"/>
<path refid="mc.jboss-unit"/>
<path refid="mc.jboss-remoting"/>
@@ -245,70 +223,11 @@
<path refid="mc.jboss_xb"/>
<path refid="mc.jboss_aop"/>
<path refid="mc.jboss_microcontainer"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
+ </path>
- <!-- ****************** -->
- <!-- Tomcat 6.0 generic -->
- <!-- ****************** -->
-
- <!-- -->
- <mkdir
dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
- <copy
todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="mc.portal-common"/>
- <path refid="mc.jboss-unit"/>
- <path refid="mc.jboss-remoting"/>
- <path refid="mc.log4j"/>
- <path refid="mc.concurrent"/>
- <path refid="mc.trove"/>
- <path refid="mc.xerces"/>
- <path refid="mc.javassist"/>
- <path refid="mc.jboss_common_core"/>
- <path refid="mc.jboss_vfs"/>
- <path refid="mc.jboss_xb"/>
- <path refid="mc.jboss_aop"/>
- <path refid="mc.jboss_microcontainer"/>
- </copy>
- <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
-
- <!-- *************************** -->
- <!-- JBoss 4.2 container servlet -->
- <!-- *************************** -->
-
- <!-- -->
- <copy
todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib"
flatten="true">
- <path refid="mc.portal-common"/>
- <path refid="mc.portal-test-generic"/>
- <path refid="mc.trove"/>
- <path refid="mc.javassist"/>
- <path refid="mc.jboss_common_core"/>
- <path refid="mc.jboss_vfs"/>
- <path refid="mc.jboss_xb"/>
- <path refid="mc.jboss_aop"/>
- <path refid="mc.jboss_microcontainer"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
-
- <!-- ***************** -->
- <!-- JBoss 4.2 generic -->
- <!-- ***************** -->
-
- <!-- -->
- <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib"
flatten="true">
- <path refid="mc.portal-common"/>
- <path refid="mc.portal-test-generic"/>
- <path refid="mc.trove"/>
- <path refid="mc.javassist"/>
- <path refid="mc.jboss_common_core"/>
- <path refid="mc.jboss_vfs"/>
- <path refid="mc.jboss_xb"/>
- <path refid="mc.jboss_aop"/>
- <path refid="mc.jboss_microcontainer"/>
- </copy>
- <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
-
<!-- SPI Test case-->
+ <mkdir dir="${test.temp.lib}"/>
<jar jarfile="${test.temp.lib}/portal-test-spi-lib.jar">
<fileset dir="${target}/test-classes/">
<include name="org/jboss/portal/test/web/spi/**"/>
@@ -319,6 +238,14 @@
<fileset dir="${target}/test-classes//portal-test-spi-jar"/>
</jar>
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 container servlet -->
+ <!-- **************************** -->
+
+ <copy
todir="${test.support}/tomcat-6.0-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-container-servlet"/>
<war
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war">
<fileset
dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
<lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
@@ -326,13 +253,33 @@
<jar
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
<fileset dir="${target}/test-classes/spi/app-war"/>
</jar>
+
+ <!-- **************************** -->
+ <!-- Tomcat 6.0 lifecyle listener -->
+ <!-- **************************** -->
+
+ <copy
todir="${test.support}/tomcat-6.0-lifecycle-listener/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-lifecycle-listener"/>
<war
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-server.war">
<fileset
dir="${test.support}/tomcat-6.0-lifecycle-listener/server-war"/>
<lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
</war>
- <jar
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-app.war">
+ <jar
jarfile="${test.temp.lib}/tomcat-6.0-lifecycle-listener/test-spi-app.war">
<fileset dir="${target}/test-classes/spi/app-war"/>
</jar>
+
+ <!-- ****************** -->
+ <!-- Tomcat 6.0 generic -->
+ <!-- ****************** -->
+
+ <!-- -->
+ <mkdir
dir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"/>
+ <copy
todir="${test.support}/tomcat-6.0-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/tomcat-6.0-generic"/>
<war
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war">
<fileset dir="${test.support}/tomcat-6.0-generic/server-war"/>
<lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
@@ -340,6 +287,16 @@
<jar
jarfile="${test.temp.lib}/tomcat-6.0-generic/test-spi-app.war">
<fileset dir="${target}/test-classes/spi/generic/app-war"/>
</jar>
+
+ <!-- *************************** -->
+ <!-- JBoss 4.2 container servlet -->
+ <!-- *************************** -->
+
+ <!-- -->
+ <copy
todir="${test.support}/jboss-4.2-container-servlet/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-container-servlet"/>
<war
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war">
<fileset
dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
<lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
@@ -347,6 +304,16 @@
<jar
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-app.war">
<fileset dir="${target}/test-classes/spi/app-war"/>
</jar>
+
+ <!-- ***************** -->
+ <!-- JBoss 4.2 generic -->
+ <!-- ***************** -->
+
+ <!-- -->
+ <copy todir="${test.support}/jboss-4.2-generic/server-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <mkdir dir="${test.temp.lib}/jboss-4.2-generic"/>
<war
jarfile="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war">
<fileset dir="${test.support}/jboss-4.2-generic/server-war"/>
<lib dir="${test.temp.lib}"
includes="portal-test-spi-lib.jar"/>
@@ -355,29 +322,78 @@
<fileset dir="${target}/test-classes/spi/generic/app-war"/>
</jar>
- <!--Request Test case-->
+ <!--endpoint test case-->
- <jar jarfile="${test.temp.lib}/portal-test-request-lib.jar">
+ <jar jarfile="${test.temp.lib}/portal-test-endpoint-lib.jar">
<fileset dir="${target}/test-classes/">
- <include name="org/jboss/portal/test/web/request/**"/>
+ <include name="org/jboss/portal/test/web/endpoint/**"/>
<include
name="org/jboss/portal/test/web/ServletTestCase.class"/>
<include
name="org/jboss/portal/test/web/TestServlet.class"/>
<include
name="org/jboss/portal/test/web/WebAppRegistry.class"/>
</fileset>
- <fileset dir="${target}/test-classes/portal-test-request-jar"/>
+ <fileset
dir="${target}/test-classes/portal-test-endpoint-jar"/>
</jar>
- <war
jarfile="${test.temp.lib}/tomcat-6.0-container-servlet/test-request-server.war">
- <fileset
dir="${test.support}/tomcat-6.0-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-request-lib.jar"/>
+ <!-- ********** -->
+ <!-- Tomcat 6.0 -->
+ <!-- ********** -->
+
+ <mkdir dir="${test.temp.lib}/tomcat-6.0"/>
+
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
</war>
- <war
jarfile="${test.temp.lib}/jboss-4.2-container-servlet/test-request-server.war">
- <fileset
dir="${test.support}/jboss-4.2-container-servlet/server-war"/>
- <lib dir="${test.temp.lib}"
includes="portal-test-request-lib.jar"/>
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/path-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
</war>
+ <copy
todir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="tomcat-6.0"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/tomcat-6.0/root-path-mapping.war">
+ <fileset
dir="${test.support}/tomcat-6.0-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+ <!-- ********* -->
+ <!-- JBoss 4.2 -->
+ <!-- ********* -->
+
+ <mkdir dir="${test.temp.lib}/jboss-4.2"/>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war
jarfile="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/default-servlet-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/path-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
+ <copy
todir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/lib"
flatten="true">
+ <path refid="jboss-4.2"/>
+ </copy>
+ <war jarfile="${test.temp.lib}/jboss-4.2/root-path-mapping.war">
+ <fileset
dir="${test.support}/jboss-4.2-endpoint/root-path-mapping-war"/>
+ <lib dir="${test.temp.lib}"
includes="portal-test-endpoint-lib.jar"/>
+ </war>
+
<!--Strip cargo manager war filename-->
<copy file="${dependency.cargo-manager.war}"
tofile="${test.temp.lib}/manager.war"/>
@@ -421,7 +437,7 @@
<configuration>
<property name="cargo.servlet.port" value="8080"/>
<property name="cargo.logging" value="high"/>
- <deployable type="war"
file="${test.spi.server.path}"/>
+ <deployable type="war" file="${cargo.war}"/>
</configuration>
</cargo>
</target>
@@ -438,108 +454,103 @@
</cargo>
</target>
- <target name="tests.jboss-4.2.container-servlet"
if="${test.jboss-4.2.home.variable-name}">
- <echo message="Starting JBoss 4.2 container-servlet tests with
${test.jboss-4.2.home}"/>
+ <target name="tests.jboss-4.2.execute"
unless="tests.jboss-4.2.execute.skip">
+ <echo message="Starting JBoss 4.2 ${test.jboss-4.2.name} with
${test.jboss-4.2.home} to execute ${test.id} tests"/>
<antcall target="cargo.jboss-4.2.start">
<param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path"
value="${test.archive.path}"/>
+ <param name="cargo.war" value="${test.war}"/>
</antcall>
<antcall target="tests.remote">
- <param name="test.server.name"
value="${test.jboss-4.2.name}"/>
- <param name="test.deploy.name"
value="jboss-4.2-container-servlet"/>
+ <param name="test.remote.server.name"
value="${test.jboss-4.2.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
</antcall>
<antcall target="cargo.jboss-4.2.stop">
</antcall>
</target>
- <target name="tests.jboss-4.2.generic"
if="${test.jboss-4.2.home.variable-name}">
- <echo message="Starting JBoss 4.2 generic tests with
${test.jboss-4.2.home}"/>
- <antcall target="cargo.jboss-4.2.start">
- <param name="cargo.wait" value="false"/>
- <param name="test.spi.server.path"
value="${test.archive.path}"/>
+ <target name="tests.jboss-4.2.spi">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-spi-container-servlet"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-4.2-container-servlet"/>
</antcall>
- <antcall target="tests.remote">
- <param name="test.server.name"
value="${test.jboss-4.2.name}"/>
- <param name="test.deploy.name"
value="jboss-4.2-generic"/>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="jboss-4.2-generic"/>
</antcall>
- <antcall target="cargo.jboss-4.2.stop">
- </antcall>
</target>
- <target name="tests.jboss-4.2">
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_0-spi-container-servlet"/>
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <target name="tests.jboss-4.2.endpoint">
+ <condition property="tests.jboss-4.2.execute.skip">
+ <not>
+ <available file="${test.jboss-4.2.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_1-spi-container-servlet"/>
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_1_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_2-spi-container-servlet"/>
- <param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
- <param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_2_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-spi-server.war"/>
+ <antcall target="tests.jboss-4.2.execute">
+ <param name="test.id"
value="${test.jboss-4.2.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/jboss-4.2/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
</antcall>
- <antcall target="tests.jboss-4.2.generic">
- <param name="test.id"
value="JBoss-4_2_0-spi-generic"/>
+ </target>
+
+ <target name="tests.jboss-4.2" if="biltobilto">
+
+ <!-- spi tests -->
+
+<!--
+ <antcall target="tests.jboss-4.2.spi">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
</antcall>
- <antcall target="tests.jboss-4.2.generic">
- <param name="test.id"
value="JBoss-4_2_1-spi-generic"/>
+ <antcall target="tests.jboss-4.2.spi">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_1_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
</antcall>
- <antcall target="tests.jboss-4.2.generic">
- <param name="test.id"
value="JBoss-4_2_2-spi-generic"/>
+ <antcall target="tests.jboss-4.2.spi">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_2_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-generic/test-spi-server.war"/>
</antcall>
+-->
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_0-request-container-servlet"/>
+ <!-- endpoint tests -->
+
+ <antcall target="tests.jboss-4.2.endpoint">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_0"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_0_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-request-server.war"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_1-request-container-servlet"/>
+ <antcall target="tests.jboss-4.2.endpoint">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_1"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_1_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_1_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-request-server.war"/>
</antcall>
- <antcall target="tests.jboss-4.2.container-servlet">
- <param name="test.id"
value="JBoss-4_2_2-request-container-servlet"/>
+ <antcall target="tests.jboss-4.2.endpoint">
<param name="test.jboss-4.2.name"
value="RemoteJBoss_4_2_2"/>
<param name="test.jboss-4.2.home"
value="${JBOSS_4_2_2_HOME}"/>
- <param name="test.jboss-4.2.home.variable-name"
value="JBOSS_4_2_2_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/jboss-4.2-container-servlet/test-request-server.war"/>
</antcall>
</target>
- <target name="cargo.tomcat-6.start" depends="cargo.setup">
+ <target name="cargo.tomcat-6.0.start"
depends="cargo.setup">
<cargo
containerId="tomcat5x"
- home="${test.tomcat-6.home}"
+ home="${test.tomcat-6.0.home}"
output="${cargo.log.dir}/cargo.${test.id}.server.log"
log="${cargo.log.dir}/cargo.${test.id}.start.log"
action="start"
@@ -564,15 +575,15 @@
<property name="cargo.logging" value="high"/>
<!--<property name="cargo.jvmargs" value="-Xdebug
-Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"/>-->
<deployable type="war"
file="${test.temp.lib}/manager.war"/>
- <deployable type="war"
file="${test.spi.server.path}"/>
+ <deployable type="war" file="${cargo.war}"/>
</configuration>
</cargo>
</target>
- <target name="cargo.tomcat-6.stop" depends="cargo.setup">
+ <target name="cargo.tomcat-6.0.stop" depends="cargo.setup">
<cargo
containerId="tomcat5x"
- home="${test.tomcat-6.home}"
+ home="${test.tomcat-6.0.home}"
log="${cargo.log.dir}/cargo.${test.id}.shutdown.log"
action="stop">
<configuration>
@@ -580,6 +591,7 @@
</cargo>
</target>
+<!--
<target name="tests.tomcat-6.container-servlet"
if="${test.tomcat-6.home.variable-name}">
<echo message="Starting Tomcat 6 container-servlet tests with
${test.tomcat-6.home}"/>
<antcall target="cargo.tomcat-6.start">
@@ -608,33 +620,81 @@
<antcall target="cargo.tomcat-6.stop">
</antcall>
</target>
+-->
- <target name="tests.tomcat-6">
- <antcall target="tests.tomcat-6.container-servlet">
- <param name="test.id"
value="Tomcat-6_0-spi-container-servlet"/>
- <param name="test.tomcat-6.name"
value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.home"
value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name"
value="TOMCAT_6_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
+ <target name="tests.tomcat-6.0.execute"
unless="tests.tomcat-6.0.execute.skip">
+ <echo message="Starting Tomcat 6.0 ${test.tomcat-6.0.name} with
${test.tomcat-6.0.home} to execute ${test.id} tests"/>
+ <antcall target="cargo.tomcat-6.0.start">
+ <param name="cargo.wait" value="false"/>
+ <param name="cargo.war" value="${test.war}"/>
</antcall>
- <antcall target="tests.tomcat-6.generic">
- <param name="test.id"
value="Tomcat-6_0-spi-generic"/>
- <param name="test.tomcat-6.name"
value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.home"
value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name"
value="TOMCAT_6_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
+ <antcall target="tests.remote">
+ <param name="test.remote.server.name"
value="${test.tomcat-6.0.name}"/>
+ <param name="test.remote.archive.path"
value="${test.archive.path}"/>
</antcall>
- <antcall target="tests.tomcat-6.container-servlet">
- <param name="test.id"
value="Tomcat-6_0-request-container-servlet"/>
- <param name="test.tomcat-6.name"
value="RemoteTomcat_6_0"/>
- <param name="test.tomcat-6.home"
value="${TOMCAT_6_0_HOME}"/>
- <param name="test.tomcat-6.home.variable-name"
value="TOMCAT_6_0_HOME"/>
- <param name="test.archive.path"
value="${test.temp.lib}/tomcat-6.0-container-servlet/test-request-server.war"/>
+ <antcall target="cargo.tomcat-6.0.stop">
</antcall>
</target>
+ <target name="tests.tomcat-6.0.spi">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-spi-container-servlet"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-container-servlet/test-spi-server.war"/>
+ <param name="test.archive.path"
value="tomcat-6.0-container-servlet"/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-spi-generic"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0-generic/test-spi-server.war"/>
+ <param name="test.archive.path"
value="tomcat-6.0-generic"/>
+ </antcall>
+ </target>
+ <target name="tests.tomcat-6.0.endpoint">
+ <condition property="tests.tomcat-6.0.execute.skip">
+ <not>
+ <available file="${test.tomcat-6.0.home}"
type="dir"/>
+ </not>
+ </condition>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-default-servlet-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/default-servlet-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ <antcall target="tests.tomcat-6.0.execute">
+ <param name="test.id"
value="${test.tomcat-6.0.name}-endpoint-root-path-mapping"/>
+ <param name="test.war"
value="${test.temp.lib}/tomcat-6.0/root-path-mapping.war"/>
+ <param name="test.archive.path" value=""/>
+ </antcall>
+ </target>
+ <target name="tests.tomcat-6.0">
+
+ <!-- spi tests -->
+
+ <antcall target="tests.tomcat-6.0.spi">
+ <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ <!-- endpoint tests -->
+
+ <antcall target="tests.tomcat-6.0.endpoint">
+ <param name="test.tomcat-6.0.name"
value="RemoteTomcat_6_0"/>
+ <param name="test.tomcat-6.0.home"
value="${TOMCAT_6_0_HOME}"/>
+ </antcall>
+
+ </target>
+
<target name="tests.local">
<taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
@@ -666,12 +726,11 @@
<taskdef name="jboss-unit"
classname="org.jboss.unit.tooling.ant.JBossUnitTask"
classpath="${plugin_classpath}"/>
-
<jboss-unit>
<tests config="${target}/test-classes/remote-jboss-unit.xml">
- <property name="archivePath"
value="${test.temp.lib}/${test.deploy.name}"/>
- <property name="serverName"
value="${test.server.name}"/>
+ <property name="archivePath"
value="${test.temp.lib}/${test.remote.archive.path}"/>
+ <property name="serverName"
value="${test.remote.server.name}"/>
</tests>
<reports>
Modified:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/ServletTestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/ServletTestCase.java 2008-04-10
14:24:38 UTC (rev 10523)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/ServletTestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -32,9 +32,9 @@
import org.jboss.unit.remote.ResponseContext;
import org.jboss.unit.remote.RequestContext;
import org.jboss.unit.remote.driver.RemoteTestDriver;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.Map;
@@ -114,11 +114,10 @@
this.responseContext = responseContext;
}
- public abstract DriverResponse service(TestServlet testServlet, HttpServletRequest
req, HttpServletResponse resp) throws ServletException, IOException;
+ public abstract DriverResponse service(TestServlet testServlet, WebRequest req,
WebResponse resp) throws ServletException, IOException;
public abstract DriverResponse invoke(TestServlet testServlet, DriverCommand
driverCommand);
-
public static String RANGE_0_255 = computeFrom0To255();
public static String RANGE_256_512 = computeFrom256To512();
Modified: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/TestServlet.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/TestServlet.java 2008-04-10
14:24:38 UTC (rev 10523)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/TestServlet.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -28,6 +28,9 @@
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.Failure;
import org.jboss.unit.info.TestInfo;
+import org.jboss.portal.web.endpoint.EndPointServlet;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -41,7 +44,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public final class TestServlet extends HttpServlet
+public final class TestServlet extends EndPointServlet
{
/** . */
@@ -52,6 +55,9 @@
public void init() throws ServletException
{
+ super.init();
+
+ //
testSuite =
(CompositeTestDriver)getServletContext().getAttribute("TestSuite");
// Init the test cases
@@ -61,7 +67,7 @@
}
}
- protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ protected void service(WebRequest req, WebResponse resp) throws ServletException,
IOException
{
DriverResponse response;
try
@@ -79,6 +85,9 @@
public void destroy()
{
testSuite = null;
+
+ //
+ super.destroy();
}
public TestInfo getInfo()
Copied: modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint (from rev
10502, modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/request)
Added:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/EndPointTestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/EndPointTestCase.java
(rev 0)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/EndPointTestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.web.endpoint;
+
+import org.jboss.portal.test.web.ServletTestCase;
+import org.jboss.portal.web.endpoint.EndPointServlet;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class EndPointTestCase extends ServletTestCase
+{
+
+ public String getURIPrefix(EndPointServlet endPointServlet)
+ {
+ switch (endPointServlet.getMappingStyle())
+ {
+ case EndPointServlet.DEFAULT_SERVLET_MAPPING:
+ return "/default-servlet-mapping/";
+ case EndPointServlet.ROOT_PATH_MAPPING:
+ return "/root-path-mapping/";
+ case EndPointServlet.PATH_MAPPING:
+ return "/path-mapping/foo";
+ default:
+ throw new AssertionError();
+ }
+ }
+
+}
Modified:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/GetTestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/request/GetTestCase.java 2008-04-04
12:10:09 UTC (rev 10502)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/GetTestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -20,16 +20,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.test.web.request;
+package org.jboss.portal.test.web.endpoint;
-import org.jboss.portal.test.web.ServletTestCase;
import org.jboss.portal.test.web.TestServlet;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.common.text.FastURLEncoder;
-import org.jboss.portal.common.http.HttpRequest;
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.IllegalRequestException;
-import org.jboss.portal.web.Body;
+import org.jboss.portal.web.WebResponse;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.response.EndTestResponse;
@@ -37,20 +35,16 @@
import static org.jboss.unit.api.Assert.*;
import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
import org.jboss.unit.Failure;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
-import java.nio.charset.Charset;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class GetTestCase extends ServletTestCase
+public class GetTestCase extends EndPointTestCase
{
/** . */
@@ -60,19 +54,16 @@
{
}
- public DriverResponse service(TestServlet testServlet, HttpServletRequest req,
HttpServletResponse resp) throws ServletException, IOException
+ public DriverResponse service(TestServlet testServlet, WebRequest req, WebResponse
resp) throws ServletException, IOException
{
- WebRequest webRequest = new WebRequest(req);
-
- //
if (getRequestCount() == 0)
{
- ParameterMap queryParameters =
assertNotNull(webRequest.getQueryParameterMap());
- assertNull(webRequest.getBody());
+ ParameterMap queryParameters = assertNotNull(req.getQueryParameterMap());
+ assertNull(req.getBody());
assertTrue(queryParameters.isEmpty());
//
- StringBuffer tmp = new StringBuffer("/test-request-server/");
+ StringBuffer tmp = new StringBuffer(getURIPrefix(testServlet));
tmp.append('?').append(encoder.encode("a")).append("=").append(encoder.encode("a_value"));
tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_1"));
tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_2"));
@@ -83,8 +74,8 @@
{
try
{
- ParameterMap queryParameters =
assertNotNull(webRequest.getQueryParameterMap());
- assertNull(webRequest.getBody());
+ ParameterMap queryParameters = assertNotNull(req.getQueryParameterMap());
+ assertNull(req.getBody());
assertEquals(3, queryParameters.size());
assertEquals(new String[]{"a_value"},
queryParameters.get("a"));
assertEquals(new String[]{"b_value_1","b_value_2"},
queryParameters.get("b"));
@@ -108,7 +99,7 @@
{
if (getRequestCount() == -1)
{
- return new InvokeGetResponse("/test-request-server/");
+ return new InvokeGetResponse(getURIPrefix(testServlet));
}
else
{
Modified:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostApplicationXWWWFormURLEncodedTestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/request/PostApplicationXWWWFormURLEncodedTestCase.java 2008-04-04
12:10:09 UTC (rev 10502)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostApplicationXWWWFormURLEncodedTestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -20,14 +20,14 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.test.web.request;
+package org.jboss.portal.test.web.endpoint;
-import org.jboss.portal.test.web.ServletTestCase;
import org.jboss.portal.test.web.TestServlet;
import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.Body;
+import org.jboss.portal.web.WebResponse;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.response.EndTestResponse;
@@ -39,8 +39,6 @@
import static org.jboss.unit.api.Assert.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
@@ -48,7 +46,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PostApplicationXWWWFormURLEncodedTestCase extends ServletTestCase
+public class PostApplicationXWWWFormURLEncodedTestCase extends EndPointTestCase
{
/** . */
@@ -58,36 +56,33 @@
{
}
- public DriverResponse service(TestServlet testServlet, HttpServletRequest req,
HttpServletResponse resp) throws ServletException, IOException
+ public DriverResponse service(TestServlet testServlet, WebRequest req, WebResponse
resp) throws ServletException, IOException
{
- WebRequest webRequest = new WebRequest(req);
-
- //
if (getRequestCount() == 0)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertTrue(queryParameters.isEmpty());
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertTrue(formParameters.isEmpty());
//
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/?a=a_value_query");
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet) +
"?a=a_value_query");
post.setBody(new HttpRequest.Form());
post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
return post;
}
else if (getRequestCount() == 1)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertEquals(1, queryParameters.size());
assertEquals(new String[]{"a_value_query"},
queryParameters.get("a"));
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertTrue(formParameters.isEmpty());
//
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/");
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet));
HttpRequest.Form requestForm = new HttpRequest.Form();
requestForm.addParameter("a", new
String[]{"a_value_body"});
post.setBody(requestForm);
@@ -96,15 +91,15 @@
}
else if (getRequestCount() == 2)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertTrue(queryParameters.isEmpty());
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertEquals(1, formParameters.size());
assertEquals(new String[]{"a_value_body"},
formParameters.get("a"));
//
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/?a=a_value_query");
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet) +
"?a=a_value_query");
post.setBody(new HttpRequest.Form());
HttpRequest.Form requestForm = new HttpRequest.Form();
requestForm.addParameter("a", new
String[]{"a_value_form"});
@@ -114,16 +109,16 @@
}
else if (getRequestCount() == 3)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertEquals(1, queryParameters.size());
assertEquals(new String[]{"a_value_query"},
queryParameters.get("a"));
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertEquals(1, formParameters.size());
assertEquals(new String[]{"a_value_form"},
formParameters.get("a"));
//
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/?a=" + encoder.encode(RANGE_0_255));
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet) +
"?a=" + encoder.encode(RANGE_0_255));
post.setBody(new HttpRequest.Form());
HttpRequest.Form requestForm = new HttpRequest.Form();
requestForm.addParameter("a", new String[]{RANGE_256_512});
@@ -133,16 +128,16 @@
}
else if (getRequestCount() == 4)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertEquals(1, queryParameters.size());
assertNull(compareString(RANGE_0_255, queryParameters.get("a")[0]));
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertEquals(1, formParameters.size());
assertNull(compareString(RANGE_256_512, formParameters.get("a")[0]));
//
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/?a=" + encoder.encode(RANGE_256_512));
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet) +
"?a=" + encoder.encode(RANGE_256_512));
post.setBody(new HttpRequest.Form());
HttpRequest.Form requestForm = new HttpRequest.Form();
requestForm.addParameter("a", new String[]{RANGE_0_255});
@@ -152,10 +147,10 @@
}
else if (getRequestCount() == 5)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
assertEquals(1, queryParameters.size());
assertNull(compareString(RANGE_256_512,
queryParameters.get("a")[0]));
- Body.Form form = Assert.assertInstanceOf(webRequest.getBody(),
Body.Form.class);
+ Body.Form form = Assert.assertInstanceOf(req.getBody(), Body.Form.class);
ParameterMap formParameters = form.getParameters();
assertEquals(1, formParameters.size());
assertNull(compareString(RANGE_0_255, formParameters.get("a")[0]));
@@ -173,7 +168,7 @@
{
if (getRequestCount() == -1)
{
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/");
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet));
post.setBody(new HttpRequest.Form());
post.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
return post;
@@ -183,5 +178,4 @@
return new FailureResponse(Failure.createAssertionFailure(""));
}
}
-
}
Modified:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostMultipartFormDataTestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/request/PostMultipartFormDataTestCase.java 2008-04-04
12:10:09 UTC (rev 10502)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/endpoint/PostMultipartFormDataTestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -20,15 +20,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.test.web.request;
+package org.jboss.portal.test.web.endpoint;
-import org.jboss.portal.test.web.ServletTestCase;
import org.jboss.portal.test.web.TestServlet;
import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.Body;
+import org.jboss.portal.web.WebResponse;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.response.EndTestResponse;
@@ -40,8 +40,6 @@
import static org.jboss.unit.api.Assert.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.InputStream;
@@ -51,7 +49,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PostMultipartFormDataTestCase extends ServletTestCase
+public class PostMultipartFormDataTestCase extends EndPointTestCase
{
/** . */
@@ -61,16 +59,13 @@
{
}
- public DriverResponse service(TestServlet testServlet, HttpServletRequest req,
HttpServletResponse resp) throws ServletException, IOException
+ public DriverResponse service(TestServlet testServlet, WebRequest req, WebResponse
resp) throws ServletException, IOException
{
- WebRequest webRequest = new WebRequest(req);
-
- //
if (getRequestCount() == 0)
{
- ParameterMap queryParameters =
Assert.assertNotNull(webRequest.getQueryParameterMap());
+ ParameterMap queryParameters =
Assert.assertNotNull(req.getQueryParameterMap());
Assert.assertTrue(queryParameters.isEmpty());
- Body.Raw raw = Assert.assertInstanceOf(webRequest.getBody(), Body.Raw.class);
+ Body.Raw raw = Assert.assertInstanceOf(req.getBody(), Body.Raw.class);
InputStream in = raw.getInputStream();
byte[] bytes = IOTools.getBytes(in);
assertTrue(Arrays.equals(new byte[]{0,1,1,2,3,5,8,13,21,34},bytes));
@@ -88,7 +83,7 @@
{
if (getRequestCount() == -1)
{
- InvokePostResponse post = new
InvokePostResponse("/test-request-server/");
+ InvokePostResponse post = new InvokePostResponse(getURIPrefix(testServlet));
HttpRequest.Raw raw = new HttpRequest.Raw();
post.setBody(raw);
raw.setBytes(new byte[]{0,1,1,2,3,5,8,13,21,34});
Modified:
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java
===================================================================
---
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java 2008-04-10
14:24:38 UTC (rev 10523)
+++
modules/web/trunk/web/src/test/java/org/jboss/portal/test/web/spi/SPITestCase.java 2008-04-10
16:40:49 UTC (rev 10524)
@@ -30,6 +30,8 @@
import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.WebApp;
import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
@@ -41,8 +43,6 @@
import org.jboss.unit.Failure;
import static org.jboss.unit.api.Assert.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
import java.io.IOException;
@@ -65,7 +65,7 @@
/** . */
private ServletContainer container;
- public DriverResponse service(TestServlet testServlet, HttpServletRequest req,
HttpServletResponse resp) throws ServletException, IOException
+ public DriverResponse service(TestServlet testServlet, WebRequest req, WebResponse
resp) throws ServletException, IOException
{
if (getRequestCount() == 1)
{
Copied: modules/web/trunk/web/src/test/resources/portal-test-endpoint-jar (from rev 10502,
modules/web/trunk/web/src/test/resources/portal-test-request-jar)
Modified:
modules/web/trunk/web/src/test/resources/portal-test-endpoint-jar/org/jboss/portal/test/web/server-beans.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/portal-test-request-jar/org/jboss/portal/test/web/server-beans.xml 2008-04-04
12:10:09 UTC (rev 10502)
+++
modules/web/trunk/web/src/test/resources/portal-test-endpoint-jar/org/jboss/portal/test/web/server-beans.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -57,7 +57,7 @@
<bean name="TestSuite"
class="org.jboss.unit.driver.impl.composite.CompositeTestDriver"/>
- <bean name="GetTestCase"
class="org.jboss.portal.test.web.request.GetTestCase">
+ <bean name="GetTestCase"
class="org.jboss.portal.test.web.endpoint.GetTestCase">
<install bean="TestSuite" method="mount">
<parameter><this/></parameter>
</install>
@@ -66,7 +66,7 @@
</uninstall>
</bean>
- <bean name="PostApplicationXWWWFormURLEncodedTestCase"
class="org.jboss.portal.test.web.request.PostApplicationXWWWFormURLEncodedTestCase">
+ <bean name="PostApplicationXWWWFormURLEncodedTestCase"
class="org.jboss.portal.test.web.endpoint.PostApplicationXWWWFormURLEncodedTestCase">
<install bean="TestSuite" method="mount">
<parameter><this/></parameter>
</install>
@@ -75,7 +75,7 @@
</uninstall>
</bean>
- <bean name="PostMultipartFormDataTestCase"
class="org.jboss.portal.test.web.request.PostMultipartFormDataTestCase">
+ <bean name="PostMultipartFormDataTestCase"
class="org.jboss.portal.test.web.endpoint.PostMultipartFormDataTestCase">
<install bean="TestSuite" method="mount">
<parameter><this/></parameter>
</install>
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/jboss-web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/default-servlet-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/jboss-web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/path-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/foo/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/jboss-web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Added:
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/jboss-4.2-endpoint/root-path-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/default-servlet-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/path-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/foo/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Added:
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/web.xml
===================================================================
---
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/web.xml
(rev 0)
+++
modules/web/trunk/web/src/test/resources/support/tomcat-6.0-endpoint/root-path-mapping-war/WEB-INF/web.xml 2008-04-10
16:40:49 UTC (rev 10524)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_location</param-name>
+ <param-value>org/jboss/portal/test/web/server-beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jboss.portal.mc.beans_resource_type</param-name>
+ <param-value>classloader</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>TestServlet</servlet-name>
+ <servlet-class>org.jboss.portal.test.web.TestServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>