V3RenderStateTests - Fixed 2 of the test cases among 6 failing ones.
Listed all test cases in the csv file.
diff --git a/portlet-tck_3.0/V3RenderStateTests/src/main/docs/ModuleAssertions.csv b/portlet-tck_3.0/V3RenderStateTests/src/main/docs/ModuleAssertions.csv
index 9035196..69c9792 100644
--- a/portlet-tck_3.0/V3RenderStateTests/src/main/docs/ModuleAssertions.csv
+++ b/portlet-tck_3.0/V3RenderStateTests/src/main/docs/ModuleAssertions.csv
@@ -1,8 +1,25 @@
Class / Section;Keywords;Name;Testable;Description
RenderStateTests;;;;
+SPEC1_12;RenderState;general;TRUE;RenderState interface provides read-only access to the render state.
SPEC1_12;RenderState;getRenderParameters;TRUE;Returns an RenderParameters object representing the private and public render parameters.
SPEC1_12;RenderState;getRenderParameters2;TRUE;The RenderParameters object return by this method is immutable.
+SPEC1_12;RenderState;getRenderParameters3;TRUE;If no render parameters are available, the object will be empty.
SPEC1_12;RenderState;getPortletMode;TRUE;Returns the current portlet mode of the portlet.
SPEC1_12;RenderState;getPortletMode2;TRUE;If the portlet mode is not available, PortletMode.UNDEFINED is returned.
SPEC1_12;RenderState;getWindowState;TRUE;Returns the current window state of the portlet.
-SPEC1_12;RenderState;getWindowState2;TRUE;If the window state is not available, WindowState.UNDEFINED is returned.
+SPEC2_12;RenderState;getWindowState2;TRUE;If the window state is not available, WindowState.UNDEFINED is returned.
+SPEC2_12;MutableRenderState;getRenderParameters;TRUE;Returns an MutableRenderParameters object representing the private and public render parameters.
+SPEC2_12;MutableRenderState;getRenderParameters2;TRUE;The MutableRenderParameters object return by this method is mutable.
+SPEC2_12;MutableRenderState;getRenderParameters3;TRUE;If no render parameters are available, the object will be empty.
+SPEC2_12;MutableRenderState;getPortletMode;TRUE;Sets the portlet mode of a portlet to the given portlet mode.
+SPEC2_12;MutableRenderState;getPortletMode2;TRUE;A custom portlet mode declared in deployment descriptor could be set.
+SPEC2_12;MutableRenderState;getPortletMode3;TRUE;Not more than one portlet mode can be set. If more than one portlet mode is set, only the last one set is valid.
+SPEC2_12;MutableRenderState;getPortletMode4;TRUE;Throws PortletModeException if the portlet cannot switch to this mode.
+SPEC2_12;MutableRenderState;getPortletMode5;TRUE;Throws IllegalStateException if the method is invoked after sendRedirect has been called.
+SPEC2_12;MutableRenderState;getPortletMode6;TRUE;Throws IllegalArgumentException if the input parameter is null.
+SPEC2_12;MutableRenderState;getWindowState;TRUE;Sets the window state of a portlet to the given window state.
+SPEC2_12;MutableRenderState;getWindowState2;TRUE;A custom window state declared in deployment descriptor could be set.
+SPEC2_12;MutableRenderState;getWindowState3;TRUE;Not more than one window state can be set. If more than one window state is set, only the last one set is valid.
+SPEC2_12;MutableRenderState;getWindowState4;TRUE;Throws WindowStateException if the portlet cannot switch to this state.
+SPEC2_12;MutableRenderState;getWindowState5;TRUE;Throws IllegalStateException if the method is invoked after sendRedirect has been called.
+SPEC2_12;MutableRenderState;getWindowState6;TRUE;Throws IllegalArgumentException if the input parameter is null.
diff --git a/portlet-tck_3.0/V3RenderStateTests/src/main/java/javax/portlet/tck/portlets/RenderStateTests_SPEC2_12_MutableRenderState.java b/portlet-tck_3.0/V3RenderStateTests/src/main/java/javax/portlet/tck/portlets/RenderStateTests_SPEC2_12_MutableRenderState.java
index 415985c..6c77ebb 100644
--- a/portlet-tck_3.0/V3RenderStateTests/src/main/java/javax/portlet/tck/portlets/RenderStateTests_SPEC2_12_MutableRenderState.java
+++ b/portlet-tck_3.0/V3RenderStateTests/src/main/java/javax/portlet/tck/portlets/RenderStateTests_SPEC2_12_MutableRenderState.java
@@ -177,11 +177,11 @@
* Details:
* "Throws IllegalStateException if the method is invoked after sendRedirect has been called."
*/
- // TODO: Fix it.
TestResult result = tcd.getTestResultFailed(
V3RENDERSTATETESTS_SPEC2_12_MUTABLERENDERSTATE_SETPORTLETMODE5);
try {
- portletResp.sendRedirect("");
+ String referer = portletReq.getProperty("Referer");
+ portletResp.sendRedirect(referer);
portletResp.setPortletMode(PortletMode.UNDEFINED);
} catch (IllegalStateException e) {
result.setTcSuccess(true);
@@ -273,11 +273,11 @@
* Details:
* "Throws IllegalStateException if the method is invoked after sendRedirect has been called."
*/
- // TODO: Fix it.
TestResult result = tcd.getTestResultFailed(
V3RENDERSTATETESTS_SPEC2_12_MUTABLERENDERSTATE_SETWINDOWSTATE5);
try {
- portletResp.sendRedirect("");
+ String referer = portletReq.getProperty("Referer");
+ portletResp.sendRedirect(referer);
portletResp.setWindowState(WindowState.UNDEFINED);
} catch (IllegalStateException e) {
result.setTcSuccess(true);
@@ -514,15 +514,20 @@
* Details:
* "A custom window state declared in deployment descriptor could be set."
*/
- if (renderParams.getValue("tr_setWindow2") == null) {
+ // TODO: Fix test case
+ if (renderParams.getValue("tr_setWindow2") != null
+ && renderParams.getValue("tr_setWindow2").equals("true")
+ && portletReq.getWindowState().equals(new WindowState("custom1"))) {
+ TestResult result = tcd.getTestResultFailed(
+ V3RENDERSTATETESTS_SPEC2_12_MUTABLERENDERSTATE_SETWINDOWSTATE2);
+ result.setTcSuccess(true);
+ result.writeTo(writer);
+ } else {
ActionURL actionURL = portletResp.createActionURL();
TestButton tb = new TestButton(
V3RENDERSTATETESTS_SPEC2_12_MUTABLERENDERSTATE_SETWINDOWSTATE2,
actionURL);
tb.writeTo(writer);
- } else {
- //TODO: Implement test case
- //super.render(portletReq, portletResp);
}
/*