Author: julien(a)jboss.com
Date: 2008-01-30 21:17:41 -0500 (Wed, 30 Jan 2008)
New Revision: 9660
Removed:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedForwardContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedIncludeContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestForwardContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestIncludeContainerAttributesTestCase.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/DispatchingFilter.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/DispatchedContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRIContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRIContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRIContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRFContainerAttributesTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRIContainerAttributesTestCase.java
Log:
- test double dispatch properly
- correct implementation of container attributes for double dispatching (it was a long
way)
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,9 +44,11 @@
import java.util.Locale;
import java.util.Map;
import java.util.HashMap;
-import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.io.BufferedReader;
@@ -92,6 +94,15 @@
"javax.servlet.forward.context_path"
};
+ /** . */
+ private static final Set<String> ALL_CONTAINER_ATTRIBUTES = new
HashSet<String>();
+
+ static
+ {
+ ALL_CONTAINER_ATTRIBUTES.addAll(Tools.toSet(INCLUDE_KEYS));
+ ALL_CONTAINER_ATTRIBUTES.addAll(Tools.toSet(FORWARD_KEYS));
+ }
+
/** The initial dispatch. */
final DispatchType dispatchType;
@@ -105,16 +116,13 @@
private final Map<String, String[]> parameters;
/** . */
- private final String[] containerKeys;
-
- /** . */
private final int sessionScope = PortletSession.APPLICATION_SCOPE;
/** . */
- private final LinkedList<Map<String, String>> containerAttributeStack;
+ private final LinkedList<Map<String, String>> containerAttributesStack;
/** . */
- private final LinkedList<Dispatch> dispatchStack;
+ private final String[] infos;
public DispatchedHttpServletRequest(
Dispatch dispatch,
@@ -127,15 +135,14 @@
this.dispatchType = dispatch.getType();
this.preq = preq;
this.dreq = dreq;
- this.containerKeys = dispatchType == DispatchType.INCLUDE ? INCLUDE_KEYS :
FORWARD_KEYS;
- this.containerAttributeStack = new LinkedList<Map<String, String>>();
- this.dispatchStack = new LinkedList<Dispatch>();
+ this.containerAttributesStack = new LinkedList<Map<String, String>>();
// Push dispatch
- pushDispatch(dispatch);
+ this.infos = pushDispatch(dispatch);
//
- String queryString =
containerAttributeStack.getLast().get(containerKeys[QUERY_STRING]);
+ String[] containerKeys = dispatchType == DispatchType.INCLUDE ? INCLUDE_KEYS :
FORWARD_KEYS;
+ String queryString =
containerAttributesStack.getLast().get(containerKeys[QUERY_STRING]);
Map<String, String[]> parameters;
if (queryString != null && queryString.length() > 0)
{
@@ -201,7 +208,7 @@
public final String getPathInfo()
{
- return (String)getAttribute(containerKeys[PATH_INFO]);
+ return infos[PATH_INFO];
}
public final String getPathTranslated()
@@ -211,17 +218,17 @@
public final String getQueryString()
{
- return (String)getAttribute(containerKeys[QUERY_STRING]);
+ return infos[QUERY_STRING];
}
public final String getRequestURI()
{
- return (String)getAttribute(containerKeys[REQUEST_URI]);
+ return infos[REQUEST_URI];
}
public final String getServletPath()
{
- return (String)getAttribute(containerKeys[SERVLET_PATH]);
+ return infos[SERVLET_PATH];
}
// Must be equivalent to the method of the PortletRequest
@@ -243,21 +250,25 @@
public final Object getAttribute(String s)
{
- Map<String, String> containerAttributes = getCurrentContainerAttributes();
-
- //
+ Map<String, String> containerAttributes =
containerAttributesStack.getLast();
if (containerAttributes.containsKey(s))
{
return containerAttributes.get(s);
}
//
+ if (ALL_CONTAINER_ATTRIBUTES.contains(s))
+ {
+ return null;
+ }
+
+ //
return preq.getAttributes().getAttribute(s, (HttpServletRequest)getRequest());
}
public final Enumeration getAttributeNames()
{
- final Map<String, String> containerAttributes =
getCurrentContainerAttributes();
+ final Map<String, String> containerAttributes =
containerAttributesStack.getLast();
final Iterator<String> i =
preq.getAttributes().getAttributeNames((HttpServletRequest)getRequest());
//
@@ -307,24 +318,18 @@
public final void setAttribute(String s, Object o)
{
- Map<String, String> containerAttributes = getCurrentContainerAttributes();
+ if (s != null && ALL_CONTAINER_ATTRIBUTES.contains(s))
+ {
+ return;
+ }
//
- if (s != null && !containerAttributes.containsKey(s))
- {
- preq.getAttributes().setAttribute(s, o);
- }
+ preq.getAttributes().setAttribute(s, o);
}
public final void removeAttribute(String s)
{
- Map<String, String> containerAttributes = getCurrentContainerAttributes();
-
- //
- if (s != null && !containerAttributes.containsKey(s))
- {
- preq.getAttributes().removeAttribute(s);
- }
+ setAttribute(s, null);
}
public final Locale getLocale()
@@ -512,88 +517,144 @@
return "HTTP/1.1";
}
- void pushDispatch(Dispatch dispatch)
+ String[] pushDispatch(Dispatch dispatch)
{
String path = dispatch.getPath();
- Map<String, String> attrs;
+
+ //
+ String[] infos;
if (path != null)
{
- String servletPath;
- String pathInfo;
- String queryString;
- int endOfServletPath = path.indexOf('/', 1);
- if (endOfServletPath == -1)
+ infos = build(path);
+
+ //
+ if (dispatch.getType() == DispatchType.INCLUDE)
{
- endOfServletPath = path.indexOf('?', 1);
- if (endOfServletPath == -1)
+ Map<String, String> containerAttributes = new HashMap<String,
String>();
+ for (int i = 0;i < infos.length;i++)
{
- servletPath = path;
- pathInfo = "";
- queryString = "";
+ String value = infos[i];
+ if (value != null)
+ {
+ containerAttributes.put(INCLUDE_KEYS[i], value);
+ }
}
- else
- {
- servletPath = path.substring(0, endOfServletPath);
- pathInfo = null;
- queryString = path.substring(endOfServletPath + 1);
- }
+ containerAttributesStack.addLast(containerAttributes);
}
else
{
- servletPath = path.substring(0, endOfServletPath);
- int endOfPathInfo = path.indexOf('?', endOfServletPath + 1);
- if (endOfPathInfo == -1)
+ if (containerAttributesStack.size() == 0)
{
- pathInfo = path.substring(endOfServletPath);
- queryString = "";
+ Map<String, String> containerAttributes = new HashMap<String,
String>();
+ for (int i = 0;i < infos.length;i++)
+ {
+ String value = infos[i];
+ if (value != null)
+ {
+ containerAttributes.put(FORWARD_KEYS[i], value);
+ }
+ }
+ containerAttributesStack.addLast(containerAttributes);
}
else
{
- pathInfo = path.substring(endOfServletPath, endOfPathInfo);
- queryString = path.substring(endOfPathInfo + 1);
+ Map<String, String> containerAttributes = new HashMap<String,
String>();
+ for (int i = 0;i < this.infos.length;i++)
+ {
+ String value = this.infos[i];
+ if (value != null)
+ {
+ containerAttributes.put(FORWARD_KEYS[i], value);
+ }
+ }
+ containerAttributesStack.addLast(containerAttributes);
}
}
- String requestURI = preq.getContextPath() + servletPath + (pathInfo != null ?
pathInfo : "");
-
- //
- attrs = new HashMap<String, String>();
- attrs.put(containerKeys[SERVLET_PATH], servletPath);
- attrs.put(containerKeys[PATH_INFO], pathInfo);
- attrs.put(containerKeys[QUERY_STRING], queryString);
- attrs.put(containerKeys[REQUEST_URI], requestURI);
- attrs.put(containerKeys[CONTEXT_PATH], preq.getContextPath());
}
else
{
- attrs = Collections.emptyMap();
+ infos = new String[5];
+
+ //
+ Map<String, String> containerAttributes = Collections.emptyMap();
+ containerAttributesStack.addLast(containerAttributes);
}
//
- containerAttributeStack.addLast(attrs);
- dispatchStack.addLast(dispatch);
+ return infos;
}
- void popDispatch()
+ private String[] build(String path)
{
- containerAttributeStack.removeLast();
- dispatchStack.removeLast();
- }
+ if (path == null)
+ {
+ throw new IllegalArgumentException();
+ }
- private Map<String, String> getCurrentContainerAttributes()
- {
- Dispatch dispatch = dispatchStack.getLast();
-
//
- if (dispatch.getType() == DispatchType.INCLUDE)
+ String servletPath;
+ String pathInfo;
+ String queryString;
+ int endOfServletPath = path.indexOf('/', 1);
+ if (endOfServletPath == -1)
{
- return containerAttributeStack.getLast();
+ endOfServletPath = path.indexOf('?', 1);
+ if (endOfServletPath == -1)
+ {
+ servletPath = path;
+ pathInfo = "";
+ queryString = "";
+ }
+ else
+ {
+ servletPath = path.substring(0, endOfServletPath);
+ pathInfo = null;
+ queryString = path.substring(endOfServletPath + 1);
+ }
}
else
{
- return containerAttributeStack.getFirst();
+ servletPath = path.substring(0, endOfServletPath);
+ int endOfPathInfo = path.indexOf('?', endOfServletPath + 1);
+ if (endOfPathInfo == -1)
+ {
+ pathInfo = path.substring(endOfServletPath);
+ queryString = "";
+ }
+ else
+ {
+ pathInfo = path.substring(endOfServletPath, endOfPathInfo);
+ queryString = path.substring(endOfPathInfo + 1);
+ }
}
+
+ //
+ String[] infos = new String[5];
+
+ //
+ StringBuffer requestURI = new StringBuffer(preq.getContextPath());
+ requestURI.append(servletPath);
+ if (pathInfo != null)
+ {
+ requestURI.append(pathInfo);
+ infos[PATH_INFO] = pathInfo;
+ }
+
+ //
+ infos[SERVLET_PATH] = servletPath;
+ infos[QUERY_STRING] = queryString;
+ infos[REQUEST_URI] = requestURI.toString();
+ infos[CONTEXT_PATH] = preq.getContextPath();
+
+ //
+ return infos;
}
+ void popDispatch()
+ {
+ containerAttributesStack.removeLast();
+ }
+
// Subclasses
public static abstract class ClientData extends DispatchedHttpServletRequest
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/DispatchingFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/DispatchingFilter.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/DispatchingFilter.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -55,7 +55,7 @@
System.out.println("In the CHAIN " + cfg.getFilterName());
System.out.println("In the CHAIN " + cfg.getFilterName());
- RequestDispatcher rd =
cfg.getServletContext().getRequestDispatcher("/dispatchedFromFilter.jsp");
+ RequestDispatcher rd =
req.getRequestDispatcher("/dispatchedFromFilter.jsp");
rd.include(req, resp);
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/DispatchedContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/DispatchedContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/DispatchedContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -70,12 +70,30 @@
private final Map<String, String> expectedAttributes;
/** . */
+ private final Map<String, String> expectedInfos;
+
+ /** . */
private final Map<String, Object> collectedAttributes;
- public DispatchedContainerAttributesTestCase(PortletTestCase seq, Map<String,
String> expectedAttributes)
+ /** . */
+ private final Map<String, Object> collectedInfos;
+
+ public DispatchedContainerAttributesTestCase(
+ PortletTestCase seq,
+ Map<String, String> expectedAttributes)
{
+ this(seq, expectedAttributes, new HashMap<String, String>());
+ }
+
+ public DispatchedContainerAttributesTestCase(
+ PortletTestCase seq,
+ Map<String, String> expectedAttributes,
+ Map<String, String> expectedInfos)
+ {
this.expectedAttributes = expectedAttributes;
+ this.expectedInfos = expectedInfos;
this.collectedAttributes = new HashMap<String, Object>();
+ this.collectedInfos = new HashMap<String, Object>();
seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
@@ -149,26 +167,21 @@
PortletRequest request,
PortletResponse response) throws PortletException, IOException
{
- //assert that servlet HAS access to specific request attributes
- try
- {
- PortletContext portletContext =
((AbstractUniversalTestPortlet)portlet).getPortletContext();
+ PortletContext portletContext =
((AbstractUniversalTestPortlet)portlet).getPortletContext();
+ dispatch(request, response, portletContext);
+ assertMap(expectedAttributes, collectedAttributes);
+ assertMap(expectedInfos, collectedInfos);
+ }
- dispatch(request, response, portletContext);
-
- //
- assertEquals(expectedAttributes.keySet(), collectedAttributes.keySet());
- for (Map.Entry<String, String> entry : expectedAttributes.entrySet())
- {
- String key = entry.getKey();
- String expectedValue = entry.getValue();
- Object collectedValue = collectedAttributes.get(key);
- assertEquals("Was expecting a value " + expectedValue + " for
key " + key + " but had instead " + collectedValue, expectedValue,
collectedValue);
- }
- }
- finally
+ private void assertMap(Map<String, String> expectedMap, Map<String,
Object> actualMap)
+ {
+ assertEquals(expectedMap.keySet(), actualMap.keySet());
+ for (Map.Entry<String, String> entry : expectedMap.entrySet())
{
- collectedAttributes.clear();
+ String key = entry.getKey();
+ String expectedValue = entry.getValue();
+ Object collectedValue = actualMap.get(key);
+ assertEquals("Was expecting a value " + expectedValue + " for key
" + key + " but had instead " + collectedValue, expectedValue,
collectedValue);
}
}
@@ -176,6 +189,7 @@
{
protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
{
+ collectedAttributes.clear();
for (String key : expectedAttributes.keySet())
{
Object value = request.getAttribute(key);
@@ -183,6 +197,14 @@
}
//
+ collectedInfos.clear();
+ collectedInfos.put("path_info", request.getPathInfo());
+ collectedInfos.put("context_path", request.getContextPath());
+ collectedInfos.put("query_string", request.getQueryString());
+ collectedInfos.put("servlet_path", request.getServletPath());
+ collectedInfos.put("request_uri", request.getRequestURI());
+
+ //
return null;
}
};
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -43,10 +43,7 @@
public class NFContainerAttributesTestCase extends DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildForwardNotSetMap();
-
- private static Map<String, String> buildForwardNotSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.forward.request_uri", null);
@@ -54,12 +51,28 @@
map.put("javax.servlet.forward.servlet_path", null);
map.put("javax.servlet.forward.path_info", null);
map.put("javax.servlet.forward.query_string", null);
+ map.put("javax.servlet.include.request_uri", null);
+ map.put("javax.servlet.include.context_path", null);
+ map.put("javax.servlet.include.servlet_path", null);
+ map.put("javax.servlet.include.path_info", null);
+ map.put("javax.servlet.include.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,10 +44,7 @@
public class NFRFContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri", null);
@@ -56,16 +53,27 @@
map.put("javax.servlet.include.path_info", null);
map.put("javax.servlet.include.query_string", null);
map.put("javax.servlet.forward.request_uri", null);
- map.put("javax.servlet.forward.context_path",
"/test-jsr286-tck-dispatcher");
+ map.put("javax.servlet.forward.context_path", null);
map.put("javax.servlet.forward.servlet_path", null);
map.put("javax.servlet.forward.path_info", null);
map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NFRFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NFRIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,10 +44,7 @@
public class NFRIContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo2");
@@ -55,17 +52,28 @@
map.put("javax.servlet.include.servlet_path",
"/universalServletA");
map.put("javax.servlet.include.path_info", "/pathinfo2");
map.put("javax.servlet.include.query_string", "foo2=bar2");
-// map.put("javax.servlet.forward.request_uri", null);
-// map.put("javax.servlet.forward.context_path", null);
-// map.put("javax.servlet.forward.servlet_path", null);
-// map.put("javax.servlet.forward.path_info", null);
-// map.put("javax.servlet.forward.query_string", null);
+ map.put("javax.servlet.forward.request_uri", null);
+ map.put("javax.servlet.forward.context_path", null);
+ map.put("javax.servlet.forward.servlet_path", null);
+ map.put("javax.servlet.forward.path_info", null);
+ map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NFRIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,10 +44,7 @@
public class NIContainerAttributesTestCase extends DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedNotSetMap();
-
- private static Map<String, String> buildIncludedNotSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri", null);
@@ -55,12 +52,28 @@
map.put("javax.servlet.include.servlet_path", null);
map.put("javax.servlet.include.path_info", null);
map.put("javax.servlet.include.query_string", null);
+ map.put("javax.servlet.forward.request_uri", null);
+ map.put("javax.servlet.forward.context_path", null);
+ map.put("javax.servlet.forward.servlet_path", null);
+ map.put("javax.servlet.forward.path_info", null);
+ map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,10 +44,7 @@
public class NIRFContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri", null);
@@ -56,16 +53,27 @@
map.put("javax.servlet.include.path_info", null);
map.put("javax.servlet.include.query_string", null);
map.put("javax.servlet.forward.request_uri", null);
- map.put("javax.servlet.forward.context_path",
"/test-jsr286-tck-dispatcher");
+ map.put("javax.servlet.forward.context_path", null);
map.put("javax.servlet.forward.servlet_path", null);
map.put("javax.servlet.forward.path_info", null);
map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NIRFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NIRIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -43,10 +43,7 @@
public class NIRIContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo2");
@@ -62,9 +59,20 @@
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri", null);
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", null);
+ map.put("path_info", null);
+ map.put("query_string", null);
+ return Collections.unmodifiableMap(map);
+ }
+
public NIRIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedForwardContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedForwardContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedForwardContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -1,70 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr286.tck.dispatcher;
-
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.annotations.TestCase;
-
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletContext;
-import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-@TestCase
-public class NamedForwardContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
-{
-
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildForwardNotSetMap();
-
- private static Map<String, String> buildForwardNotSetMap()
- {
- Map<String, String> map = new HashMap<String, String>();
- map.put("javax.servlet.forward.request_uri", null);
- map.put("javax.servlet.forward.context_path", null);
- map.put("javax.servlet.forward.servlet_path", null);
- map.put("javax.servlet.forward.path_info", null);
- map.put("javax.servlet.forward.query_string", null);
- return Collections.unmodifiableMap(map);
- }
-
- public NamedForwardContainerAttributesTestCase(PortletTestCase seq)
- {
- super(seq, EXPECTED_ATTRIBUTES_SET);
- }
-
- protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
portletContext.getNamedDispatcher("UniversalServletA");
- dispatcher.forward(request, response);
- }
-}
\ No newline at end of file
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedIncludeContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedIncludeContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/NamedIncludeContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -1,71 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr286.tck.dispatcher;
-
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.annotations.TestCase;
-
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletContext;
-import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-(a)TestCase({Assertion.JSR168_127})
-public class NamedIncludeContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
-{
-
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedNotSetMap();
-
- private static Map<String, String> buildIncludedNotSetMap()
- {
- Map<String, String> map = new HashMap<String, String>();
- map.put("javax.servlet.include.request_uri", null);
- map.put("javax.servlet.include.context_path", null);
- map.put("javax.servlet.include.servlet_path", null);
- map.put("javax.servlet.include.path_info", null);
- map.put("javax.servlet.include.query_string", null);
- return Collections.unmodifiableMap(map);
- }
-
- public NamedIncludeContainerAttributesTestCase(PortletTestCase seq)
- {
- super(seq, EXPECTED_ATTRIBUTES_SET);
- }
-
- protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
portletContext.getNamedDispatcher("UniversalServletA");
- dispatcher.include(request, response);
- }
-}
\ No newline at end of file
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -43,10 +43,7 @@
public class RFContainerAttributesTestCase extends DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildForwardSetMap();
-
- private static Map<String, String> buildForwardSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.forward.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
@@ -54,12 +51,28 @@
map.put("javax.servlet.forward.servlet_path",
"/universalServletA");
map.put("javax.servlet.forward.path_info", "/pathinfo");
map.put("javax.servlet.forward.query_string", "foo=bar");
+ map.put("javax.servlet.include.request_uri", null);
+ map.put("javax.servlet.include.context_path", null);
+ map.put("javax.servlet.include.servlet_path", null);
+ map.put("javax.servlet.include.path_info", null);
+ map.put("javax.servlet.include.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/universalServletA");
+ map.put("path_info", "/pathinfo");
+ map.put("query_string", "foo=bar");
+ return Collections.unmodifiableMap(map);
+ }
+
public RFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -45,9 +45,9 @@
{
/** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
+ public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildAttributes();
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri", null);
@@ -63,9 +63,20 @@
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfos()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/requestForwardHopServlet/pathinfo1");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/requestForwardHopServlet");
+ map.put("path_info", "/pathinfo1");
+ map.put("query_string", "foo1=bar1");
+ return Collections.unmodifiableMap(map);
+ }
+
public RFRFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfos());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RFRIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -45,9 +45,9 @@
{
/** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
+ public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildAttributes();
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo2");
@@ -55,17 +55,28 @@
map.put("javax.servlet.include.servlet_path",
"/universalServletA");
map.put("javax.servlet.include.path_info", "/pathinfo2");
map.put("javax.servlet.include.query_string", "foo2=bar2");
-// map.put("javax.servlet.forward.request_uri", null);
-// map.put("javax.servlet.forward.context_path", null);
-// map.put("javax.servlet.forward.servlet_path", null);
-// map.put("javax.servlet.forward.path_info", null);
-// map.put("javax.servlet.forward.query_string", null);
+ map.put("javax.servlet.forward.request_uri", null);
+ map.put("javax.servlet.forward.context_path", null);
+ map.put("javax.servlet.forward.servlet_path", null);
+ map.put("javax.servlet.forward.path_info", null);
+ map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfos()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/requestIncludeHopServlet/pathinfo1");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/requestIncludeHopServlet");
+ map.put("path_info", "/pathinfo1");
+ map.put("query_string", "foo1=bar1");
+ return Collections.unmodifiableMap(map);
+ }
+
public RFRIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfos());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,10 +44,7 @@
public class RIContainerAttributesTestCase extends DispatchedContainerAttributesTestCase
{
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
@@ -55,12 +52,28 @@
map.put("javax.servlet.include.servlet_path",
"/universalServletA");
map.put("javax.servlet.include.path_info", "/pathinfo");
map.put("javax.servlet.include.query_string", "foo=bar");
+ map.put("javax.servlet.forward.request_uri", null);
+ map.put("javax.servlet.forward.context_path", null);
+ map.put("javax.servlet.forward.servlet_path", null);
+ map.put("javax.servlet.forward.path_info", null);
+ map.put("javax.servlet.forward.query_string", null);
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/universalServletA");
+ map.put("path_info", "/pathinfo");
+ map.put("query_string", "foo=bar");
+ return Collections.unmodifiableMap(map);
+ }
+
public RIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRFContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRFContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRFContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -45,16 +45,16 @@
{
/** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
+ public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildAttributes();
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
-// map.put("javax.servlet.include.request_uri", null);
-// map.put("javax.servlet.include.context_path", null);
-// map.put("javax.servlet.include.servlet_path", null);
-// map.put("javax.servlet.include.path_info", null);
-// map.put("javax.servlet.include.query_string", null);
+ map.put("javax.servlet.include.request_uri", null);
+ map.put("javax.servlet.include.context_path", null);
+ map.put("javax.servlet.include.servlet_path", null);
+ map.put("javax.servlet.include.path_info", null);
+ map.put("javax.servlet.include.query_string", null);
map.put("javax.servlet.forward.request_uri",
"/test-jsr286-tck-dispatcher/requestForwardHopServlet/pathinfo1");
map.put("javax.servlet.forward.context_path",
"/test-jsr286-tck-dispatcher");
map.put("javax.servlet.forward.servlet_path",
"/requestForwardHopServlet");
@@ -63,9 +63,20 @@
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/requestForwardHopServlet/pathinfo1");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/requestForwardHopServlet");
+ map.put("path_info", "/pathinfo1");
+ map.put("query_string", "foo1=bar1");
+ return Collections.unmodifiableMap(map);
+ }
+
public RIRFContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected boolean performTest(LifeCyclePhase phase)
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRIContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRIContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RIRIContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -44,9 +44,9 @@
{
/** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
+ public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildAttributes();
- private static Map<String, String> buildIncludedSetMap()
+ private static Map<String, String> buildAttributes()
{
Map<String, String> map = new HashMap<String, String>();
map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo2");
@@ -62,9 +62,20 @@
return Collections.unmodifiableMap(map);
}
+ private static Map<String, String> buildInfo()
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("request_uri",
"/test-jsr286-tck-dispatcher/requestIncludeHopServlet/pathinfo1");
+ map.put("context_path", "/test-jsr286-tck-dispatcher");
+ map.put("servlet_path", "/requestIncludeHopServlet");
+ map.put("path_info", "/pathinfo1");
+ map.put("query_string", "foo1=bar1");
+ return Collections.unmodifiableMap(map);
+ }
+
public RIRIContainerAttributesTestCase(PortletTestCase seq)
{
- super(seq, EXPECTED_ATTRIBUTES_SET);
+ super(seq, buildAttributes(), buildInfo());
}
protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestForwardContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestForwardContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestForwardContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -1,70 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr286.tck.dispatcher;
-
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.annotations.TestCase;
-
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletContext;
-import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-@TestCase
-public class RequestForwardContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
-{
-
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildForwardSetMap();
-
- private static Map<String, String> buildForwardSetMap()
- {
- Map<String, String> map = new HashMap<String, String>();
- map.put("javax.servlet.forward.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
- map.put("javax.servlet.forward.context_path",
"/test-jsr286-tck-dispatcher");
- map.put("javax.servlet.forward.servlet_path",
"/universalServletA");
- map.put("javax.servlet.forward.path_info", "/pathinfo");
- map.put("javax.servlet.forward.query_string", "foo=bar");
- return Collections.unmodifiableMap(map);
- }
-
- public RequestForwardContainerAttributesTestCase(PortletTestCase seq)
- {
- super(seq, EXPECTED_ATTRIBUTES_SET);
- }
-
- protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
portletContext.getRequestDispatcher("/universalServletA/pathinfo?foo=bar");
- dispatcher.forward(request, response);
- }
-}
\ No newline at end of file
Deleted:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestIncludeContainerAttributesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestIncludeContainerAttributesTestCase.java 2008-01-30
22:35:00 UTC (rev 9659)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/dispatcher/RequestIncludeContainerAttributesTestCase.java 2008-01-31
02:17:41 UTC (rev 9660)
@@ -1,71 +0,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. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr286.tck.dispatcher;
-
-import org.jboss.portal.unit.PortletTestCase;
-import org.jboss.portal.unit.Assertion;
-import org.jboss.portal.unit.annotations.TestCase;
-
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletContext;
-import java.io.IOException;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-(a)TestCase({Assertion.JSR168_127})
-public class RequestIncludeContainerAttributesTestCase extends
DispatchedContainerAttributesTestCase
-{
-
- /** . */
- public static final Map<String, String> EXPECTED_ATTRIBUTES_SET =
buildIncludedSetMap();
-
- private static Map<String, String> buildIncludedSetMap()
- {
- Map<String, String> map = new HashMap<String, String>();
- map.put("javax.servlet.include.request_uri",
"/test-jsr286-tck-dispatcher/universalServletA/pathinfo");
- map.put("javax.servlet.include.context_path",
"/test-jsr286-tck-dispatcher");
- map.put("javax.servlet.include.servlet_path",
"/universalServletA");
- map.put("javax.servlet.include.path_info", "/pathinfo");
- map.put("javax.servlet.include.query_string", "foo=bar");
- return Collections.unmodifiableMap(map);
- }
-
- public RequestIncludeContainerAttributesTestCase(PortletTestCase seq)
- {
- super(seq, EXPECTED_ATTRIBUTES_SET);
- }
-
- protected void dispatch(PortletRequest request, PortletResponse response,
PortletContext portletContext) throws IOException, PortletException
- {
- PortletRequestDispatcher dispatcher =
portletContext.getRequestDispatcher("/universalServletA/pathinfo?foo=bar");
- dispatcher.include(request, response);
- }
-}