1 16 package org.apache.myfaces.renderkit.html; 17 18 import javax.servlet.RequestDispatcher ; 19 20 import org.apache.cactus.ServletTestCase; 21 import com.meterware.httpunit.WebResponse; 22 import com.meterware.httpunit.WebConversation; 23 import com.meterware.httpunit.WebForm; 24 import com.meterware.httpunit.SubmitButton; 25 26 27 30 public class Bug972165CactusTest extends ServletTestCase 31 { 32 33 public Bug972165CactusTest(String string) 34 { 35 super(string); 36 } 37 38 39 public void testBug972165() throws Exception 40 { 41 RequestDispatcher rd = config.getServletContext().getRequestDispatcher("/Bug972165CactusTest.jsf"); 42 rd.forward(request, response); 44 } 45 46 47 public void endBug972165(WebResponse response) 48 throws Exception 49 { 50 WebConversation conversation = new WebConversation(); 51 response = conversation.getResponse(response.getURL().toExternalForm()); 52 WebForm form = response.getFormWithID("testForm"); 53 SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit"); 54 55 assertTrue(response.getText().indexOf("CheckDisabled:true") != -1); 56 assertEquals("true", form.getParameterValue("testForm:checkDisabled")); 57 response = form.submit(submitButton); 58 assertTrue(response.getText().indexOf("CheckDisabled:true") != -1); 59 assertEquals("true", form.getParameterValue("testForm:checkDisabled")); 60 } 61 } 62 | Popular Tags |