You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2014/08/20 08:42:52 UTC
[39/50] [abbrv] Completed dispatcher request / response tests that
could be generated from the test case assertions file.
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6e60b5f0/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse.jsp
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse.jsp b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse.jsp
index c1b661b..0dbe759 100644
--- a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse.jsp
+++ b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse.jsp
@@ -57,8 +57,12 @@
/* method HttpServletResponse.encodeURL must provide the same */
/* functionality as EventResponse.encodeURL" */
TestResult tr3 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPEVENTRESPONSE_ENCODEURL1);
- /* TODO: implement test */
- tr3.appendTcDetail("Not implemented.");
+ try {
+ String turl = "http://www.apache.org/";
+ String hval = (String)response.encodeURL(turl);
+ String pval = (String)portletResp.encodeURL(turl);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "EventResponse", pval, tr3);
+ } catch(Exception e) {tr3.appendTcDetail(e.toString());}
tr3.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse_encodeUrl */
@@ -66,8 +70,12 @@
/* method HttpServletResponse.encodeUrl must provide the same */
/* functionality as EventResponse.encodeURL" */
TestResult tr4 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPEVENTRESPONSE_ENCODEURL);
- /* TODO: implement test */
- tr4.appendTcDetail("Not implemented.");
+ try {
+ String turl = "http://www.apache.org/";
+ String hval = (String)response.encodeUrl(turl);
+ String pval = (String)portletResp.encodeURL(turl);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "EventResponse", pval, tr4);
+ } catch(Exception e) {tr4.appendTcDetail(e.toString());}
tr4.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse_getBufferSize */
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6e60b5f0/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest.jsp
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest.jsp b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest.jsp
index 88cc576..e7cc34b 100644
--- a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest.jsp
+++ b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest.jsp
@@ -121,8 +121,16 @@
/* corresponding to that returned by RenderRequest.getProperty for */
/* the corresponding header name" */
TestResult tr8 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETDATEHEADER);
- /* TODO: implement test */
- tr8.appendTcDetail("Not implemented.");
+ try {
+ long hval = request.getDateHeader(MOD_HEADER);
+ long pval = Long.parseLong(portletReq.getProperty(MOD_HEADER));
+ boolean ok = (hval == pval);
+ if (!ok) {
+ String str = MOD_HEADER + " from HttpServletRequest: " + hval + ", did not equal " + pval + " from RenderRequest";
+ tr8.appendTcDetail(str);
+ }
+ tr8.setTcSuccess(ok);
+ } catch(Exception e) {tr8.appendTcDetail(e.toString());}
tr8.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getHeader */
@@ -131,8 +139,11 @@
/* corresponding to that returned by RenderRequest.getProperty for */
/* the corresponding header name" */
TestResult tr9 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETHEADER);
- /* TODO: implement test */
- tr9.appendTcDetail("Not implemented.");
+ try {
+ String hval = request.getHeader(ACCEPT_HEADER);
+ String pval = portletReq.getProperty(ACCEPT_HEADER);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "RenderRequest", pval, tr9);
+ } catch(Exception e) {tr9.appendTcDetail(e.toString());}
tr9.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getHeaderNames */
@@ -141,18 +152,42 @@
/* contained in the Enumeration returned by */
/* RenderRequest.getPropertyNames" */
TestResult tr10 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETHEADERNAMES);
- /* TODO: implement test */
- tr10.appendTcDetail("Not implemented.");
+ try {
+ // he must be contained in pe
+ Enumeration<String> he = request.getHeaderNames();
+ Enumeration<String> pe = portletReq.getPropertyNames();
+ HashSet<String> hs = new HashSet<String>();
+ while (he.hasMoreElements()) {
+ hs.add(he.nextElement());
+ }
+ HashSet<String> ps = new HashSet<String>();
+ while (pe.hasMoreElements()) {
+ ps.add(pe.nextElement());
+ }
+ boolean ok = ps.containsAll(hs);
+ if (!ok) {
+ hs.removeAll(ps);
+ String str = "The following headers from HttpServletRequest are not contained in RenderRequest: ";
+ for (String h : hs) {;
+ str += "\"" + h + "\", ";
+ };
+ tr10.appendTcDetail(str);
+ }
+ tr10.setTcSuccess(ok);
+ } catch(Exception e) {tr10.appendTcDetail(e.toString());}
tr10.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getHeaders */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletRequest.getHeaders must return a value */
- /* corresponding to that returned by RenderRequest.getProperty for */
+ /* corresponding to that returned by RenderRequest.getProperties for */
/* the corresponding header name" */
TestResult tr11 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETHEADERS);
- /* TODO: implement test */
- tr11.appendTcDetail("Not implemented.");
+ try {
+ Enumeration<String> he = request.getHeaders(ACCEPT_LANG_HEADER);
+ Enumeration<String> pe = portletReq.getProperties(ACCEPT_LANG_HEADER);
+ CompareUtils.enumsEqual("HttpServletRequest parameter names", he, "RenderRequest parameter names", pe,tr11);
+ } catch(Exception e) {tr11.appendTcDetail(e.toString());}
tr11.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getInputStream */
@@ -171,8 +206,16 @@
/* corresponding to that returned by RenderRequest.getProperty for */
/* the corresponding header name" */
TestResult tr13 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETINTHEADER);
- /* TODO: implement test */
- tr13.appendTcDetail("Not implemented.");
+ try {
+ int hval = request.getIntHeader(CONTENT_LENGTH_HEADER);
+ int pval = Integer.parseInt(portletReq.getProperty(CONTENT_LENGTH_HEADER));
+ boolean ok = (hval == pval);
+ if (!ok) {
+ String str = CONTENT_LENGTH_HEADER + " from HttpServletRequest: " + hval + ", did not equal " + pval + " from RenderRequest";
+ tr13.appendTcDetail(str);
+ }
+ tr13.setTcSuccess(ok);
+ } catch(Exception e) {tr13.appendTcDetail(e.toString());}
tr13.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getLocalAddr */
@@ -427,8 +470,14 @@
/* method HttpServletRequest.getRequestDispatcher must provide */
/* functionality as defined in the servlet specification" */
TestResult tr34 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETREQUESTDISPATCHER);
- /* TODO: implement test */
- tr34.appendTcDetail("Not implemented.");
+ try {
+ String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest" + JSP_SUFFIX;
+ RequestDispatcher hval = request.getRequestDispatcher(sname);
+ if (hval == null) {
+ tr34.appendTcDetail("Could not obtain request dispatcher for " + sname);
+ }
+ tr34.setTcSuccess(hval != null);
+ } catch(Exception e) {tr34.appendTcDetail(e.toString());}
tr34.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getRequestURI */
@@ -530,8 +579,13 @@
/* functionality as */
/* RenderRequest.getPortletSession(APPLICATION_SCOPE)" */
TestResult tr42 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_GETSESSION);
- /* TODO: implement test */
- tr42.appendTcDetail("Not implemented.");
+ try {
+ HttpSession hval = request.getSession();
+ if (hval == null) {
+ tr42.appendTcDetail("Could not get session from HttpServletRequest");
+ }
+ tr42.setTcSuccess(hval != null);
+ } catch(Exception e) {tr42.appendTcDetail(e.toString());}
tr42.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_getUserPrincipal */
@@ -603,8 +657,24 @@
/* method HttpServletRequest.removeAttribute must provide the same */
/* functionality as RenderRequest.removeAttribute" */
TestResult tr47 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_REMOVEATTRIBUTE);
- /* TODO: implement test */
- tr47.appendTcDetail("Not implemented.");
+ try {
+ String hname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_removeAttribute1";
+ String pname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_removeAttribute2";
+ request.setAttribute(hname, "Value");
+ portletReq.setAttribute(pname, "Value");
+ request.removeAttribute(hname);
+ portletReq.removeAttribute(pname);
+ String hval = (String)request.getAttribute(hname);
+ String pval = (String)portletReq.getAttribute(pname);
+ boolean ok = (hval == null) && (pval == null);
+ String str = "";
+ if (!ok) {;
+ if (hval != null) str += "Attribute could not be removed through HttpServletRequest." ;
+ if (pval != null) str += "Attribute could not be removed through RenderRequest." ;
+ tr47.appendTcDetail(str);
+ };
+ tr47.setTcSuccess(ok);
+ } catch(Exception e) {tr47.appendTcDetail(e.toString());}
tr47.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_setAttribute */
@@ -612,19 +682,26 @@
/* method HttpServletRequest.setAttribute must provide the same */
/* functionality as RenderRequest.setAttribute" */
TestResult tr48 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_SETATTRIBUTE);
- /* TODO: implement test */
- tr48.appendTcDetail("Not implemented.");
+ try {
+ String hname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_setAttribute1";
+ String pname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_setAttribute2";
+ request.setAttribute(hname, "Value");
+ portletReq.setAttribute(pname, "Value");
+ String hval = (String)request.getAttribute(hname);
+ String pval = (String)portletReq.getAttribute(pname);
+ request.removeAttribute(hname);
+ portletReq.removeAttribute(pname);
+ boolean ok = (hval.equals("Value") && pval.equals("Value")) ;
+ String str = "";
+ if (!ok) {;
+ if (!hval.equals("Value")) str += "Attribute could not be set/read through HttpServletRequest." ;
+ if (!pval.equals("Value")) str += "Attribute could not be set/read through RenderRequest." ;
+ tr48.appendTcDetail(str);
+ };
+ tr48.setTcSuccess(ok);
+ } catch(Exception e) {tr48.appendTcDetail(e.toString());}
tr48.writeTo(writer);
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest_setCharacterEncoding */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletRequest.setCharacterEncoding does not perform */
- /* any operation" */
- TestResult tr49 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERREQUEST_SETCHARACTERENCODING);
- /* TODO: implement test */
- tr49.appendTcDetail("Not implemented.");
- tr49.writeTo(writer);
-
// TestSetupLink for: DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderRequest
{
String val = portletReq.getParameter(PARM_NAME);
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6e60b5f0/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse.jsp
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse.jsp b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse.jsp
index a074f55..ad95ed2 100644
--- a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse.jsp
+++ b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse.jsp
@@ -22,293 +22,130 @@
// Create result objects for the tests
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_addCookie */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.addCookie does not perform any */
- /* operation" */
- TestResult tr0 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ADDCOOKIE);
- /* TODO: implement test */
- tr0.appendTcDetail("Not implemented.");
- tr0.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_addDateHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.addDateHeader does not perform any */
- /* operation" */
- TestResult tr1 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ADDDATEHEADER);
- /* TODO: implement test */
- tr1.appendTcDetail("Not implemented.");
- tr1.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_addHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.addHeader does not perform any */
- /* operation" */
- TestResult tr2 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ADDHEADER);
- /* TODO: implement test */
- tr2.appendTcDetail("Not implemented.");
- tr2.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_addIntHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.addIntHeader does not perform any */
- /* operation" */
- TestResult tr3 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ADDINTHEADER);
- /* TODO: implement test */
- tr3.appendTcDetail("Not implemented.");
- tr3.writeTo(writer);
-
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_containsHeader */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.containsHeader must return false" */
- TestResult tr4 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_CONTAINSHEADER);
+ TestResult tr0 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_CONTAINSHEADER);
try {
boolean ok = response.containsHeader("Accept");
- tr4.setTcSuccess(ok == false);
- } catch(Exception e) {tr4.appendTcDetail(e.toString());}
- tr4.writeTo(writer);
+ tr0.setTcSuccess(ok == false);
+ } catch(Exception e) {tr0.appendTcDetail(e.toString());}
+ tr0.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_encodeRedirectURL1 */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.encodeRedirectURL must return null" */
- TestResult tr5 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEREDIRECTURL1);
+ TestResult tr1 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEREDIRECTURL1);
try {
String isval = response.encodeRedirectURL("http://www.cnn.com/");
- CompareUtils.stringsEqual(isval, null, tr5);
- } catch(Exception e) {tr5.appendTcDetail(e.toString());}
- tr5.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr1);
+ } catch(Exception e) {tr1.appendTcDetail(e.toString());}
+ tr1.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_encodeRedirectUrl */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.encodeRedirectUrl must return null" */
- TestResult tr6 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEREDIRECTURL);
+ TestResult tr2 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEREDIRECTURL);
try {
String isval = response.encodeRedirectUrl("http://www.cnn.com/");
- CompareUtils.stringsEqual(isval, null, tr6);
- } catch(Exception e) {tr6.appendTcDetail(e.toString());}
- tr6.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr2);
+ } catch(Exception e) {tr2.appendTcDetail(e.toString());}
+ tr2.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_encodeURL1 */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.encodeURL must provide the same */
/* functionality as RenderResponse.encodeURL" */
- TestResult tr7 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEURL1);
- /* TODO: implement test */
- tr7.appendTcDetail("Not implemented.");
- tr7.writeTo(writer);
+ TestResult tr3 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEURL1);
+ try {
+ String turl = "http://www.apache.org/";
+ String hval = (String)response.encodeURL(turl);
+ String pval = (String)portletResp.encodeURL(turl);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr3);
+ } catch(Exception e) {tr3.appendTcDetail(e.toString());}
+ tr3.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_encodeUrl */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.encodeUrl must provide the same */
/* functionality as RenderResponse.encodeURL" */
- TestResult tr8 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEURL);
- /* TODO: implement test */
- tr8.appendTcDetail("Not implemented.");
- tr8.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_flushBuffer */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.flushBuffer must provide the same */
- /* functionality as RenderResponse.flushBuffer" */
- TestResult tr9 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_FLUSHBUFFER);
- /* TODO: implement test */
- tr9.appendTcDetail("Not implemented.");
- tr9.writeTo(writer);
+ TestResult tr4 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ENCODEURL);
+ try {
+ String turl = "http://www.apache.org/";
+ String hval = (String)response.encodeUrl(turl);
+ String pval = (String)portletResp.encodeURL(turl);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr4);
+ } catch(Exception e) {tr4.appendTcDetail(e.toString());}
+ tr4.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_getBufferSize */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.getBufferSize must provide the same */
/* functionality as RenderResponse.getBufferSize" */
- TestResult tr10 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETBUFFERSIZE);
+ TestResult tr5 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETBUFFERSIZE);
try {
int hval = response.getBufferSize();
int pval = ((MimeResponse)portletResp).getBufferSize();
String str = "Value " + hval + " from " + "HttpServletResponse" + " does not equal value " + pval + " + RenderResponse";
if (hval != pval) {
- tr10.appendTcDetail(str);
+ tr5.appendTcDetail(str);
}
- tr10.setTcSuccess(hval == pval);
- } catch(Exception e) {tr10.appendTcDetail(e.toString());}
- tr10.writeTo(writer);
+ tr5.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr5.appendTcDetail(e.toString());}
+ tr5.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_getCharacterEncoding */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.getCharacterEncoding must provide the */
/* same functionality as RenderResponse.getCharacterEncoding" */
- TestResult tr11 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETCHARACTERENCODING);
+ TestResult tr6 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETCHARACTERENCODING);
try {
String hval = response.getCharacterEncoding();
String pval = ((MimeResponse)portletResp).getCharacterEncoding();
- CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr11);
- } catch(Exception e) {tr11.appendTcDetail(e.toString());}
- tr11.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr6);
+ } catch(Exception e) {tr6.appendTcDetail(e.toString());}
+ tr6.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_getContentType */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.getContentType must provide the same */
/* functionality as RenderResponse.getContentType" */
- TestResult tr12 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETCONTENTTYPE);
+ TestResult tr7 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETCONTENTTYPE);
try {
String hval = response.getContentType();
String pval = ((MimeResponse)portletResp).getContentType();
- CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr12);
- } catch(Exception e) {tr12.appendTcDetail(e.toString());}
- tr12.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr7);
+ } catch(Exception e) {tr7.appendTcDetail(e.toString());}
+ tr7.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_getLocale */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.getLocale must provide the same */
/* functionality as RenderResponse.getLocale" */
- TestResult tr13 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETLOCALE);
+ TestResult tr8 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETLOCALE);
try {
Locale hl = response.getLocale();
Locale pl = ((MimeResponse)portletResp).getLocale();
String hval = hl.getDisplayName();
String pval = pl.getDisplayName();
- CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr13);
- } catch(Exception e) {tr13.appendTcDetail(e.toString());}
- tr13.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_getOutputStream */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.getOutputStream must provide the same */
- /* functionality as RenderResponse.getPortletOutputStream" */
- TestResult tr14 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_GETOUTPUTSTREAM);
- /* TODO: implement test */
- tr14.appendTcDetail("Not implemented.");
- tr14.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletResponse", hval, "RenderResponse", pval, tr8);
+ } catch(Exception e) {tr8.appendTcDetail(e.toString());}
+ tr8.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_isCommitted */
/* Details: "In a target jsp of a include in the Render phase, the */
/* method HttpServletResponse.isCommitted must provide the same */
/* functionality as RenderResponse.isCommitted" */
- TestResult tr15 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ISCOMMITTED);
+ TestResult tr9 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_ISCOMMITTED);
try {
boolean hval = response.isCommitted();
boolean pval = ((MimeResponse)portletResp).isCommitted();
String str = "Value " + hval + " from " + "HttpServletResponse" + " does not equal value " + pval + " + RenderResponse";
if (hval != pval) {
- tr15.appendTcDetail(str);
+ tr9.appendTcDetail(str);
}
- tr15.setTcSuccess(hval == pval);
- } catch(Exception e) {tr15.appendTcDetail(e.toString());}
- tr15.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_reset */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.reset must provide the same */
- /* functionality as RenderResponse.reset" */
- TestResult tr16 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_RESET);
- /* TODO: implement test */
- tr16.appendTcDetail("Not implemented.");
- tr16.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_resetBuffer */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.resetBuffer must provide the same */
- /* functionality as RenderResponse.resetBuffer" */
- TestResult tr17 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_RESETBUFFER);
- /* TODO: implement test */
- tr17.appendTcDetail("Not implemented.");
- tr17.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_sendError */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.sendError does not perform any */
- /* operation" */
- TestResult tr18 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SENDERROR);
- /* TODO: implement test */
- tr18.appendTcDetail("Not implemented.");
- tr18.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_sendRedirect */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.sendRedirect does not perform any */
- /* operation" */
- TestResult tr19 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SENDREDIRECT);
- /* TODO: implement test */
- tr19.appendTcDetail("Not implemented.");
- tr19.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setBufferSize */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setBufferSize must provide the same */
- /* functionality as RenderResponse.setBufferSize" */
- TestResult tr20 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETBUFFERSIZE);
- /* TODO: implement test */
- tr20.appendTcDetail("Not implemented.");
- tr20.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setCharacterEncoding */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setCharacterEncoding does not perform */
- /* any operation" */
- TestResult tr21 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETCHARACTERENCODING);
- /* TODO: implement test */
- tr21.appendTcDetail("Not implemented.");
- tr21.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setContentLength */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setContentLength does not perform any */
- /* operation" */
- TestResult tr22 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETCONTENTLENGTH);
- /* TODO: implement test */
- tr22.appendTcDetail("Not implemented.");
- tr22.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setContentType */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setContentType does not perform any */
- /* operation" */
- TestResult tr23 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETCONTENTTYPE);
- /* TODO: implement test */
- tr23.appendTcDetail("Not implemented.");
- tr23.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setDateHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setDateHeader does not perform any */
- /* operation" */
- TestResult tr24 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETDATEHEADER);
- /* TODO: implement test */
- tr24.appendTcDetail("Not implemented.");
- tr24.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setHeader does not perform any */
- /* operation" */
- TestResult tr25 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETHEADER);
- /* TODO: implement test */
- tr25.appendTcDetail("Not implemented.");
- tr25.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setIntHeader */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setIntHeader does not perform any */
- /* operation" */
- TestResult tr26 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETINTHEADER);
- /* TODO: implement test */
- tr26.appendTcDetail("Not implemented.");
- tr26.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setLocale */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setLocale does not perform any */
- /* operation" */
- TestResult tr27 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETLOCALE);
- /* TODO: implement test */
- tr27.appendTcDetail("Not implemented.");
- tr27.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPRenderResponse_setStatus */
- /* Details: "In a target jsp of a include in the Render phase, the */
- /* method HttpServletResponse.setStatus does not perform any */
- /* operation" */
- TestResult tr28 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRENDERRESPONSE_SETSTATUS);
- /* TODO: implement test */
- tr28.appendTcDetail("Not implemented.");
- tr28.writeTo(writer);
+ tr9.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr9.appendTcDetail(e.toString());}
+ tr9.writeTo(writer);
%>
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6e60b5f0/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest.jsp
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest.jsp b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest.jsp
index 526eba3..bad06ae 100644
--- a/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest.jsp
+++ b/portlet-tck_3.0/V2DispatcherReqRespTests3/src/main/webapp/WEB-INF/jsp/DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest.jsp
@@ -130,8 +130,16 @@
/* corresponding to that returned by ResourceRequest.getProperty for */
/* the corresponding header name" */
TestResult tr8 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETDATEHEADER);
- /* TODO: implement test */
- tr8.appendTcDetail("Not implemented.");
+ try {
+ long hval = request.getDateHeader(MOD_HEADER);
+ long pval = Long.parseLong(portletReq.getProperty(MOD_HEADER));
+ boolean ok = (hval == pval);
+ if (!ok) {
+ String str = MOD_HEADER + " from HttpServletRequest: " + hval + ", did not equal " + pval + " from ResourceRequest";
+ tr8.appendTcDetail(str);
+ }
+ tr8.setTcSuccess(ok);
+ } catch(Exception e) {tr8.appendTcDetail(e.toString());}
tr8.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getHeader */
@@ -140,8 +148,11 @@
/* corresponding to that returned by ResourceRequest.getProperty for */
/* the corresponding header name" */
TestResult tr9 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETHEADER);
- /* TODO: implement test */
- tr9.appendTcDetail("Not implemented.");
+ try {
+ String hval = request.getHeader(ACCEPT_HEADER);
+ String pval = portletReq.getProperty(ACCEPT_HEADER);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr9);
+ } catch(Exception e) {tr9.appendTcDetail(e.toString());}
tr9.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getHeaderNames */
@@ -150,161 +161,184 @@
/* contained in the Enumeration returned by */
/* ResourceRequest.getPropertyNames" */
TestResult tr10 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETHEADERNAMES);
- /* TODO: implement test */
- tr10.appendTcDetail("Not implemented.");
+ try {
+ // he must be contained in pe
+ Enumeration<String> he = request.getHeaderNames();
+ Enumeration<String> pe = portletReq.getPropertyNames();
+ HashSet<String> hs = new HashSet<String>();
+ while (he.hasMoreElements()) {
+ hs.add(he.nextElement());
+ }
+ HashSet<String> ps = new HashSet<String>();
+ while (pe.hasMoreElements()) {
+ ps.add(pe.nextElement());
+ }
+ boolean ok = ps.containsAll(hs);
+ if (!ok) {
+ hs.removeAll(ps);
+ String str = "The following headers from HttpServletRequest are not contained in ResourceRequest: ";
+ for (String h : hs) {;
+ str += "\"" + h + "\", ";
+ };
+ tr10.appendTcDetail(str);
+ }
+ tr10.setTcSuccess(ok);
+ } catch(Exception e) {tr10.appendTcDetail(e.toString());}
tr10.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getHeaders */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getHeaders must return a value */
- /* corresponding to that returned by ResourceRequest.getProperty for */
- /* the corresponding header name" */
+ /* corresponding to that returned by ResourceRequest.getProperties */
+ /* for the corresponding header name" */
TestResult tr11 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETHEADERS);
- /* TODO: implement test */
- tr11.appendTcDetail("Not implemented.");
+ try {
+ Enumeration<String> he = request.getHeaders(ACCEPT_LANG_HEADER);
+ Enumeration<String> pe = portletReq.getProperties(ACCEPT_LANG_HEADER);
+ CompareUtils.enumsEqual("HttpServletRequest parameter names", he, "ResourceRequest parameter names", pe,tr11);
+ } catch(Exception e) {tr11.appendTcDetail(e.toString());}
tr11.writeTo(writer);
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getInputStream */
- /* Details: "In a target jsp of a include in the Resource phase, the */
- /* method HttpServletRequest.getInputStream must provide the same */
- /* functionality as ResourceRequest.getPortletInputStream" */
- TestResult tr12 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETINPUTSTREAM);
- /* TODO: implement test */
- tr12.appendTcDetail("Not implemented.");
- tr12.writeTo(writer);
-
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getIntHeader */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getIntHeader must return a value */
/* corresponding to that returned by ResourceRequest.getProperty for */
/* the corresponding header name" */
- TestResult tr13 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETINTHEADER);
- /* TODO: implement test */
- tr13.appendTcDetail("Not implemented.");
- tr13.writeTo(writer);
+ TestResult tr12 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETINTHEADER);
+ try {
+ int hval = request.getIntHeader(CONTENT_LENGTH_HEADER);
+ int pval = Integer.parseInt(portletReq.getProperty(CONTENT_LENGTH_HEADER));
+ boolean ok = (hval == pval);
+ if (!ok) {
+ String str = CONTENT_LENGTH_HEADER + " from HttpServletRequest: " + hval + ", did not equal " + pval + " from ResourceRequest";
+ tr12.appendTcDetail(str);
+ }
+ tr12.setTcSuccess(ok);
+ } catch(Exception e) {tr12.appendTcDetail(e.toString());}
+ tr12.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getLocalAddr */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getLocalAddr must return null" */
- TestResult tr14 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALADDR);
+ TestResult tr13 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALADDR);
try {
String isval = request.getLocalAddr();
- CompareUtils.stringsEqual(isval, null, tr14);
- } catch(Exception e) {tr14.appendTcDetail(e.toString());}
- tr14.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr13);
+ } catch(Exception e) {tr13.appendTcDetail(e.toString());}
+ tr13.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getLocalName */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getLocalName must return null" */
- TestResult tr15 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALNAME);
+ TestResult tr14 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALNAME);
try {
String isval = request.getLocalName();
- CompareUtils.stringsEqual(isval, null, tr15);
- } catch(Exception e) {tr15.appendTcDetail(e.toString());}
- tr15.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr14);
+ } catch(Exception e) {tr14.appendTcDetail(e.toString());}
+ tr14.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getLocalPort */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getLocalPort must return 0" */
- TestResult tr16 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALPORT);
+ TestResult tr15 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALPORT);
try {
int isval = request.getLocalPort();
- if (isval != 0) tr16.appendTcDetail("Returned value was: " + isval);
- tr16.setTcSuccess(isval == 0);
- } catch(Exception e) {tr16.appendTcDetail(e.toString());}
- tr16.writeTo(writer);
+ if (isval != 0) tr15.appendTcDetail("Returned value was: " + isval);
+ tr15.setTcSuccess(isval == 0);
+ } catch(Exception e) {tr15.appendTcDetail(e.toString());}
+ tr15.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getLocale */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getLocale must provide the same */
/* functionality as ResourceRequest.getLocale" */
- TestResult tr17 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALE);
+ TestResult tr16 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALE);
try {
Locale hl = request.getLocale();
Locale pl = portletReq.getLocale();
String hval = hl.getDisplayName();
String pval = pl.getDisplayName();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr17);
- } catch(Exception e) {tr17.appendTcDetail(e.toString());}
- tr17.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr16);
+ } catch(Exception e) {tr16.appendTcDetail(e.toString());}
+ tr16.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getLocales */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getLocales must provide the same */
/* functionality as ResourceRequest.getLocales" */
- TestResult tr18 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALES);
+ TestResult tr17 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETLOCALES);
try {
Enumeration<Locale> he = request.getLocales();
Enumeration<Locale> pe = portletReq.getLocales();
- CompareUtils.enumsEqual("HttpServletRequest locales", he, "ResourceRequest locales", pe,tr18);
- } catch(Exception e) {tr18.appendTcDetail(e.toString());}
- tr18.writeTo(writer);
+ CompareUtils.enumsEqual("HttpServletRequest locales", he, "ResourceRequest locales", pe,tr17);
+ } catch(Exception e) {tr17.appendTcDetail(e.toString());}
+ tr17.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getMethod */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getMethod must provide the same */
/* functionality as ResourceRequest.getMethod" */
- TestResult tr19 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETMETHOD);
+ TestResult tr18 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETMETHOD);
try {
String hval = request.getMethod();
String pval = ((ClientDataRequest)portletReq).getMethod();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr19);
- } catch(Exception e) {tr19.appendTcDetail(e.toString());}
- tr19.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr18);
+ } catch(Exception e) {tr18.appendTcDetail(e.toString());}
+ tr18.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getParameter */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getParameter must provide the same */
/* functionality as ResourceRequest.getParameter" */
- TestResult tr20 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETER);
+ TestResult tr19 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETER);
try {
// TestSetupLink
String val = portletReq.getParameter(PARM_NAME);
if (val != null) {
String hval = request.getParameter(PARM_NAME);
String pval = portletReq.getParameter(PARM_NAME);
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr20);
- tr20.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr19);
+ tr19.writeTo(writer);
}
- } catch(Exception e) {tr20.appendTcDetail(e.toString());}
+ } catch(Exception e) {tr19.appendTcDetail(e.toString());}
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getParameterMap */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getParameterMap must provide the same */
/* functionality as ResourceRequest.getParameterMap" */
- TestResult tr21 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERMAP);
+ TestResult tr20 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERMAP);
try {
// TestSetupLink
String val = portletReq.getParameter(PARM_NAME);
if (val != null) {
Map<String, String[]> hmap = request.getParameterMap();
Map<String, String[]> pmap = portletReq.getParameterMap();
- CompareUtils.mapsEqual("map from HttpServletRequest", hmap, "map from ResourceRequest", pmap, tr21);
- tr21.writeTo(writer);
+ CompareUtils.mapsEqual("map from HttpServletRequest", hmap, "map from ResourceRequest", pmap, tr20);
+ tr20.writeTo(writer);
}
- } catch(Exception e) {tr21.appendTcDetail(e.toString());}
+ } catch(Exception e) {tr20.appendTcDetail(e.toString());}
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getParameterNames */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getParameterNames must provide the same */
/* functionality as ResourceRequest.getParameterNames" */
- TestResult tr22 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERNAMES);
+ TestResult tr21 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERNAMES);
try {
// TestSetupLink
String val = portletReq.getParameter(PARM_NAME);
if (val != null) {
Enumeration<String> he = request.getParameterNames();
Enumeration<String> pe = portletReq.getParameterNames();
- CompareUtils.enumsEqual("HttpServletRequest parameter names", he, "ResourceRequest parameter names", pe,tr22);
- tr22.writeTo(writer);
+ CompareUtils.enumsEqual("HttpServletRequest parameter names", he, "ResourceRequest parameter names", pe,tr21);
+ tr21.writeTo(writer);
}
- } catch(Exception e) {tr22.appendTcDetail(e.toString());}
+ } catch(Exception e) {tr21.appendTcDetail(e.toString());}
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getParameterValues */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getParameterValues must provide the same */
/* functionality as ResourceRequest.getParameterValues" */
- TestResult tr23 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERVALUES);
+ TestResult tr22 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPARAMETERVALUES);
try {
// TestSetupLink
String val = portletReq.getParameter(PARM_NAME);
@@ -313,317 +347,351 @@
String[] pvals = portletReq.getParameterValues(PARM_NAME);
String hval = ((hvals==null) ? "null" : hvals[0]);
String pval = ((pvals==null) ? "null" : pvals[0]);
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr23);
- tr23.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr22);
+ tr22.writeTo(writer);
}
- } catch(Exception e) {tr23.appendTcDetail(e.toString());}
+ } catch(Exception e) {tr22.appendTcDetail(e.toString());}
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getPathInfo */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getPathInfo must a value corresponding */
/* to the path used to obtain the PortletRequestDispatcher" */
- TestResult tr24 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPATHINFO);
+ TestResult tr23 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPATHINFO);
try {
String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
String hval = request.getPathInfo();
String pval = null;
- CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr24);
- } catch(Exception e) {tr24.appendTcDetail(e.toString());}
- tr24.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr23);
+ } catch(Exception e) {tr23.appendTcDetail(e.toString());}
+ tr23.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getPathTranslated */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getPathTranslated must a value */
/* corresponding to the path used to obtain the */
/* PortletRequestDispatcher" */
- TestResult tr25 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPATHTRANSLATED);
+ TestResult tr24 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPATHTRANSLATED);
try {
String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
String hval = request.getPathTranslated();
String pval = null;
- CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr25);
- } catch(Exception e) {tr25.appendTcDetail(e.toString());}
- tr25.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr24);
+ } catch(Exception e) {tr24.appendTcDetail(e.toString());}
+ tr24.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getProtocol */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getProtocol must return \"HTTP/1.1\"" */
- TestResult tr26 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPROTOCOL);
+ TestResult tr25 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETPROTOCOL);
try {
String isval = request.getProtocol();
- CompareUtils.stringsEqual(isval, "HTTP/1.1", tr26);
- } catch(Exception e) {tr26.appendTcDetail(e.toString());}
- tr26.writeTo(writer);
+ CompareUtils.stringsEqual(isval, "HTTP/1.1", tr25);
+ } catch(Exception e) {tr25.appendTcDetail(e.toString());}
+ tr25.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getQueryString */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getQueryString must a value */
/* corresponding to the query string information used to obtain the */
/* PortletRequestDispatcher" */
- TestResult tr27 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETQUERYSTRING);
+ TestResult tr26 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETQUERYSTRING);
try {
String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
String hval = request.getQueryString();
String pval = QUERY_STRING;
- CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr27);
- } catch(Exception e) {tr27.appendTcDetail(e.toString());}
- tr27.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr26);
+ } catch(Exception e) {tr26.appendTcDetail(e.toString());}
+ tr26.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRealPath */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRealPath must return null" */
- TestResult tr28 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREALPATH);
+ TestResult tr27 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREALPATH);
try {
String isval = request.getRealPath("/WEB-INF/portlet.xml");
- CompareUtils.stringsEqual(isval, null, tr28);
- } catch(Exception e) {tr28.appendTcDetail(e.toString());}
- tr28.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr27);
+ } catch(Exception e) {tr27.appendTcDetail(e.toString());}
+ tr27.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRemoteAddr */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRemoteAddr must return null" */
- TestResult tr29 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEADDR);
+ TestResult tr28 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEADDR);
try {
String isval = request.getRemoteAddr();
- CompareUtils.stringsEqual(isval, null, tr29);
- } catch(Exception e) {tr29.appendTcDetail(e.toString());}
- tr29.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr28);
+ } catch(Exception e) {tr28.appendTcDetail(e.toString());}
+ tr28.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRemoteHost */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRemoteHost must return null" */
- TestResult tr30 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEHOST);
+ TestResult tr29 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEHOST);
try {
String isval = request.getRemoteHost();
- CompareUtils.stringsEqual(isval, null, tr30);
- } catch(Exception e) {tr30.appendTcDetail(e.toString());}
- tr30.writeTo(writer);
+ CompareUtils.stringsEqual(isval, null, tr29);
+ } catch(Exception e) {tr29.appendTcDetail(e.toString());}
+ tr29.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRemotePort */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRemotePort must return 0" */
- TestResult tr31 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEPORT);
+ TestResult tr30 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEPORT);
try {
int isval = request.getRemotePort();
- if (isval != 0) tr31.appendTcDetail("Returned value was: " + isval);
- tr31.setTcSuccess(isval == 0);
- } catch(Exception e) {tr31.appendTcDetail(e.toString());}
- tr31.writeTo(writer);
+ if (isval != 0) tr30.appendTcDetail("Returned value was: " + isval);
+ tr30.setTcSuccess(isval == 0);
+ } catch(Exception e) {tr30.appendTcDetail(e.toString());}
+ tr30.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRemoteUser */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRemoteUser must provide the same */
/* functionality as ResourceRequest.getRemoteUser" */
- TestResult tr32 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEUSER);
+ TestResult tr31 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREMOTEUSER);
try {
String hval = request.getRemoteUser();
String pval = ((ClientDataRequest)portletReq).getRemoteUser();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr32);
- } catch(Exception e) {tr32.appendTcDetail(e.toString());}
- tr32.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr31);
+ } catch(Exception e) {tr31.appendTcDetail(e.toString());}
+ tr31.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRequestDispatcher */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRequestDispatcher must provide */
/* functionality as defined in the servlet specification" */
- TestResult tr33 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTDISPATCHER);
- /* TODO: implement test */
- tr33.appendTcDetail("Not implemented.");
- tr33.writeTo(writer);
+ TestResult tr32 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTDISPATCHER);
+ try {
+ String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
+ RequestDispatcher hval = request.getRequestDispatcher(sname);
+ if (hval == null) {
+ tr32.appendTcDetail("Could not obtain request dispatcher for " + sname);
+ }
+ tr32.setTcSuccess(hval != null);
+ } catch(Exception e) {tr32.appendTcDetail(e.toString());}
+ tr32.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRequestURI */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRequestURI must a value corresponding */
/* to the path and query string information used to obtain the */
/* PortletRequestDispatcher" */
- TestResult tr34 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTURI);
+ TestResult tr33 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTURI);
try {
String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
String hval = request.getRequestURI();
if (!hval.contains(sname)) {
- tr34.appendTcDetail("Request URI " + hval + " does not contain " + sname);
+ tr33.appendTcDetail("Request URI " + hval + " does not contain " + sname);
}
- tr34.setTcSuccess(hval.contains(sname));
- } catch(Exception e) {tr34.appendTcDetail(e.toString());}
- tr34.writeTo(writer);
+ tr33.setTcSuccess(hval.contains(sname));
+ } catch(Exception e) {tr33.appendTcDetail(e.toString());}
+ tr33.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRequestURL */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRequestURL must return null" */
- TestResult tr35 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTURL);
+ TestResult tr34 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTURL);
try {
StringBuffer isval = request.getRequestURL();
- if (isval != null) tr35.appendTcDetail("Request URL is " + isval.toString());
- tr35.setTcSuccess(isval == null);
- } catch(Exception e) {tr35.appendTcDetail(e.toString());}
- tr35.writeTo(writer);
+ if (isval != null) tr34.appendTcDetail("Request URL is " + isval.toString());
+ tr34.setTcSuccess(isval == null);
+ } catch(Exception e) {tr34.appendTcDetail(e.toString());}
+ tr34.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getRequestedSessionId */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getRequestedSessionId must provide the */
/* same functionality as ResourceRequest.getRequestedSessionId" */
- TestResult tr36 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTEDSESSIONID);
+ TestResult tr35 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETREQUESTEDSESSIONID);
try {
String hval = request.getRequestedSessionId();
String pval = ((ClientDataRequest)portletReq).getRequestedSessionId();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr36);
- } catch(Exception e) {tr36.appendTcDetail(e.toString());}
- tr36.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr35);
+ } catch(Exception e) {tr35.appendTcDetail(e.toString());}
+ tr35.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getScheme */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getScheme must provide the same */
/* functionality as ResourceRequest.getScheme" */
- TestResult tr37 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSCHEME);
+ TestResult tr36 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSCHEME);
try {
String hval = request.getScheme();
String pval = ((ClientDataRequest)portletReq).getScheme();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr37);
- } catch(Exception e) {tr37.appendTcDetail(e.toString());}
- tr37.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr36);
+ } catch(Exception e) {tr36.appendTcDetail(e.toString());}
+ tr36.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getServerName */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getServerName must provide the same */
/* functionality as ResourceRequest.getServerName" */
- TestResult tr38 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVERNAME);
+ TestResult tr37 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVERNAME);
try {
String hval = request.getServerName();
String pval = ((ClientDataRequest)portletReq).getServerName();
- CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr38);
- } catch(Exception e) {tr38.appendTcDetail(e.toString());}
- tr38.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, "ResourceRequest", pval, tr37);
+ } catch(Exception e) {tr37.appendTcDetail(e.toString());}
+ tr37.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getServerPort */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getServerPort must provide the same */
/* functionality as ResourceRequest.getServerPort" */
- TestResult tr39 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVERPORT);
+ TestResult tr38 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVERPORT);
try {
int hval = request.getServerPort();
int pval = ((ClientDataRequest)portletReq).getServerPort();
String str = "Value " + hval + " from " + "HttpServletRequest" + " does not equal value " + pval + " + ResourceRequest";
if (hval != pval) {
- tr39.appendTcDetail(str);
+ tr38.appendTcDetail(str);
}
- tr39.setTcSuccess(hval == pval);
- } catch(Exception e) {tr39.appendTcDetail(e.toString());}
- tr39.writeTo(writer);
+ tr38.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr38.appendTcDetail(e.toString());}
+ tr38.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getServletPath */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getServletPath must a value */
/* corresponding to the path used to obtain the */
/* PortletRequestDispatcher" */
- TestResult tr40 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVLETPATH);
+ TestResult tr39 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSERVLETPATH);
try {
String sname = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest" + JSP_SUFFIX;
String hval = request.getServletPath();
String pval = sname;
- CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr40);
- } catch(Exception e) {tr40.appendTcDetail(e.toString());}
- tr40.writeTo(writer);
+ CompareUtils.stringsEqual("HttpServletRequest", hval, " defined: ", pval, tr39);
+ } catch(Exception e) {tr39.appendTcDetail(e.toString());}
+ tr39.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getSession */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getSession must provide the same */
/* functionality as */
/* ResourceRequest.getPortletSession(APPLICATION_SCOPE)" */
- TestResult tr41 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSESSION);
- /* TODO: implement test */
- tr41.appendTcDetail("Not implemented.");
- tr41.writeTo(writer);
+ TestResult tr40 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETSESSION);
+ try {
+ HttpSession hval = request.getSession();
+ if (hval == null) {
+ tr40.appendTcDetail("Could not get session from HttpServletRequest");
+ }
+ tr40.setTcSuccess(hval != null);
+ } catch(Exception e) {tr40.appendTcDetail(e.toString());}
+ tr40.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_getUserPrincipal */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.getUserPrincipal must provide the same */
/* functionality as ResourceRequest.getUserPrincipal" */
- TestResult tr42 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETUSERPRINCIPAL);
+ TestResult tr41 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_GETUSERPRINCIPAL);
try {
java.security.Principal hpal = request.getUserPrincipal();
java.security.Principal ppal = ((ClientDataRequest)portletReq).getUserPrincipal();
String str = "Value " + hpal.toString() + " from " + "HttpServletRequest" + " does not equal value " + ppal.toString() + " + ResourceRequest";
if (!hpal.equals(ppal)) {
- tr42.appendTcDetail(str);
+ tr41.appendTcDetail(str);
}
- tr42.setTcSuccess(hpal.equals(ppal));
- } catch(Exception e) {tr42.appendTcDetail(e.toString());}
- tr42.writeTo(writer);
+ tr41.setTcSuccess(hpal.equals(ppal));
+ } catch(Exception e) {tr41.appendTcDetail(e.toString());}
+ tr41.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_isRequestedSessionIdValid */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.isRequestedSessionIdValid must provide */
/* the same functionality as */
/* ResourceRequest.isRequestedSessionIdValid" */
- TestResult tr43 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISREQUESTEDSESSIONIDVALID);
+ TestResult tr42 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISREQUESTEDSESSIONIDVALID);
try {
boolean hval = request.isRequestedSessionIdValid();
boolean pval = ((ClientDataRequest)portletReq).isRequestedSessionIdValid();
String str = "Value " + hval + " from " + "HttpServletRequest" + " does not equal value " + pval + " + ResourceRequest";
if (hval != pval) {
- tr43.appendTcDetail(str);
+ tr42.appendTcDetail(str);
}
- tr43.setTcSuccess(hval == pval);
- } catch(Exception e) {tr43.appendTcDetail(e.toString());}
- tr43.writeTo(writer);
+ tr42.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr42.appendTcDetail(e.toString());}
+ tr42.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_isSecure */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.isSecure must provide the same */
/* functionality as ResourceRequest.isSecure" */
- TestResult tr44 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISSECURE);
+ TestResult tr43 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISSECURE);
try {
boolean hval = request.isSecure();
boolean pval = ((ClientDataRequest)portletReq).isSecure();
String str = "Value " + hval + " from " + "HttpServletRequest" + " does not equal value " + pval + " + ResourceRequest";
if (hval != pval) {
- tr44.appendTcDetail(str);
+ tr43.appendTcDetail(str);
}
- tr44.setTcSuccess(hval == pval);
- } catch(Exception e) {tr44.appendTcDetail(e.toString());}
- tr44.writeTo(writer);
+ tr43.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr43.appendTcDetail(e.toString());}
+ tr43.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_isUserInRole */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.isUserInRole must provide the same */
/* functionality as ResourceRequest.isUserInRole" */
- TestResult tr45 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISUSERINROLE);
+ TestResult tr44 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_ISUSERINROLE);
try {
boolean hval = request.isUserInRole(ROLE_NAME);
boolean pval = ((ClientDataRequest)portletReq).isUserInRole(ROLE_NAME);
String str = "Value " + hval + " from " + "HttpServletRequest" + " does not equal value " + pval + " + ResourceRequest";
if (hval != pval) {
- tr45.appendTcDetail(str);
+ tr44.appendTcDetail(str);
}
- tr45.setTcSuccess(hval == pval);
- } catch(Exception e) {tr45.appendTcDetail(e.toString());}
- tr45.writeTo(writer);
+ tr44.setTcSuccess(hval == pval);
+ } catch(Exception e) {tr44.appendTcDetail(e.toString());}
+ tr44.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_removeAttribute */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.removeAttribute must provide the same */
/* functionality as ResourceRequest.removeAttribute" */
- TestResult tr46 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_REMOVEATTRIBUTE);
- /* TODO: implement test */
- tr46.appendTcDetail("Not implemented.");
- tr46.writeTo(writer);
+ TestResult tr45 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_REMOVEATTRIBUTE);
+ try {
+ String hname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_removeAttribute1";
+ String pname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_removeAttribute2";
+ request.setAttribute(hname, "Value");
+ portletReq.setAttribute(pname, "Value");
+ request.removeAttribute(hname);
+ portletReq.removeAttribute(pname);
+ String hval = (String)request.getAttribute(hname);
+ String pval = (String)portletReq.getAttribute(pname);
+ boolean ok = (hval == null) && (pval == null);
+ String str = "";
+ if (!ok) {;
+ if (hval != null) str += "Attribute could not be removed through HttpServletRequest." ;
+ if (pval != null) str += "Attribute could not be removed through ResourceRequest." ;
+ tr45.appendTcDetail(str);
+ };
+ tr45.setTcSuccess(ok);
+ } catch(Exception e) {tr45.appendTcDetail(e.toString());}
+ tr45.writeTo(writer);
/* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_setAttribute */
/* Details: "In a target jsp of a include in the Resource phase, the */
/* method HttpServletRequest.setAttribute must provide the same */
/* functionality as ResourceRequest.setAttribute" */
- TestResult tr47 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_SETATTRIBUTE);
- /* TODO: implement test */
- tr47.appendTcDetail("Not implemented.");
- tr47.writeTo(writer);
-
- /* TestCase: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_setCharacterEncoding */
- /* Details: "In a target jsp of a include in the Resource phase, the */
- /* method HttpServletRequest.setCharacterEncoding must provide the */
- /* same functionality as ResourceRequest.setCharacterEncoding" */
- TestResult tr48 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_SETCHARACTERENCODING);
- /* TODO: implement test */
- tr48.appendTcDetail("Not implemented.");
- tr48.writeTo(writer);
+ TestResult tr46 = tcd.getTestResultFailed(V2DISPATCHERREQRESPTESTS3_SPEC2_19_INCLUDEJSPRESOURCEREQUEST_SETATTRIBUTE);
+ try {
+ String hname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_setAttribute1";
+ String pname = ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPResourceRequest_setAttribute2";
+ request.setAttribute(hname, "Value");
+ portletReq.setAttribute(pname, "Value");
+ String hval = (String)request.getAttribute(hname);
+ String pval = (String)portletReq.getAttribute(pname);
+ request.removeAttribute(hname);
+ portletReq.removeAttribute(pname);
+ boolean ok = (hval.equals("Value") && pval.equals("Value")) ;
+ String str = "";
+ if (!ok) {;
+ if (!hval.equals("Value")) str += "Attribute could not be set/read through HttpServletRequest." ;
+ if (!pval.equals("Value")) str += "Attribute could not be set/read through ResourceRequest." ;
+ tr46.appendTcDetail(str);
+ };
+ tr46.setTcSuccess(ok);
+ } catch(Exception e) {tr46.appendTcDetail(e.toString());}
+ tr46.writeTo(writer);
%>