POSTed parameter test now works
authormaxcooper <maxcooper>
Mon, 7 Jul 2003 04:18:49 +0000 (04:18 +0000)
committermaxcooper <maxcooper>
Mon, 7 Jul 2003 04:18:49 +0000 (04:18 +0000)
src/test/org/securityfilter/test/http/form/PostMethodTest.java
web/share/securePage.jsp

index 52ef000..df7b994 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Header: /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form/PostMethodTest.java,v 1.1 2003/06/14 14:12:32 maxcooper Exp $
- * $Revision: 1.1 $
- * $Date: 2003/06/14 14:12:32 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form/PostMethodTest.java,v 1.2 2003/07/07 04:18:49 maxcooper Exp $
+ * $Revision: 1.2 $
+ * $Date: 2003/07/07 04:18:49 $
  *
  * ====================================================================
  * The SecurityFilter Software License, Version 1.1
 
 package org.securityfilter.test.http.form;
 
-import org.securityfilter.test.http.TestBase;
-import org.securityfilter.example.Constants;
 import com.meterware.httpunit.*;
+import org.securityfilter.example.Constants;
+import org.securityfilter.test.http.TestBase;
 
 /**
  * LogoutTest - tests the logout functionality.
  *
  * @author Max Cooper (max@maxcooper.com)
- * @version $Revision: 1.1 $ $Date: 2003/06/14 14:12:32 $
+ * @version $Revision: 1.2 $ $Date: 2003/07/07 04:18:49 $
  */
 public class PostMethodTest extends TestBase {
    private static final String POST_VALUE = "it works!";
@@ -104,12 +104,9 @@ public class PostMethodTest extends TestBase {
       assertPageTitle(response, Constants.SECURE_TITLE);
 
       // make sure the item we submitted is present
-      HTMLElement postedValue = response.getElementWithID(Constants.SECURE_POSTED_VALUE_ID);
+      TableCell postedValue = (TableCell) response.getElementWithID(Constants.SECURE_POSTED_VALUE_ID);
       assertNotNull("POSTed parameter not found in reponse", postedValue);
-      System.out.println("postedValue.toString() = " + postedValue.toString());
-      System.out.println("postedValue.getID() = " + postedValue.getID());
-      System.out.println("postedValue.getName() = " + postedValue.getName());
-      System.out.println("postedValue.getTitle() = " + postedValue.getTitle());
-      System.out.println("postedValue.getClass().getName() = " + postedValue.getClass().getName());
+      System.out.println("postedValue.asText() = \"" + postedValue.asText() + "\"");
+      assertEquals("POSTed parameter did not have the right value", postedValue.asText(), POST_VALUE);
    }
 }
index 159ca40..6fcc792 100644 (file)
@@ -18,7 +18,12 @@ Welcome <i><%=request.getRemoteUser()%></i>, you are viewing a secure page.
    if (postedValue != null) {
 %>
 <h2>You POSTed a value from the Home Page!</h2>
-The value you posted was &quot;<span id="<%=Constants.SECURE_POSTED_VALUE_ID%>"><%=postedValue%></span>&quot;.
+The value you posted was:
+<table>
+   <tr>
+      <td id="<%=Constants.SECURE_POSTED_VALUE_ID%>"><%=postedValue%></td>
+   </tr>
+</table>
 <%
    }
 %>