1 16 package org.apache.myfaces.renderkit.html; 17 18 import javax.servlet.RequestDispatcher ; 19 20 import org.apache.cactus.ServletTestCase; 21 22 import com.meterware.httpunit.SubmitButton; 23 import com.meterware.httpunit.WebConversation; 24 import com.meterware.httpunit.WebForm; 25 import com.meterware.httpunit.WebResponse; 26 27 44 public class HtmlInputHiddenCactusTest 45 extends ServletTestCase 46 { 47 49 public HtmlInputHiddenCactusTest(String name) { 50 super(name); 51 } 52 53 public void testBug948626() throws Exception 54 { 55 RequestDispatcher rd = config.getServletContext().getRequestDispatcher( 56 "/HtmlInputHiddenTagCactusTest.jsf"); 57 rd.forward(request, response); 59 } 60 61 public void endBug948626(WebResponse response) 62 throws Exception 63 { 64 WebConversation conversation = new WebConversation(); 65 response = conversation.getResponse(response.getURL().toExternalForm()); 66 WebForm form = response.getFormWithID("testForm"); 67 SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit"); 68 assertEquals("0", form.getParameterValue("testForm:hidden")); 69 assertTrue(response.getText().indexOf("false") != -1); 70 assertTrue(response.getText().indexOf("true") == -1); 71 response = form.submit(submitButton); 72 assertTrue(response.getText().indexOf("false") == -1); 73 assertTrue(response.getText().indexOf("true") != -1); 74 } 75 } 76 | Popular Tags |