KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > renderkit > html > Bug978654CactusTest


1 /*
2  * Copyright 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.renderkit.html;
17
18 import javax.servlet.RequestDispatcher JavaDoc;
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
28 /**
29  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
30  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:56 $
31  * $Log: Bug978654CactusTest.java,v $
32  * Revision 1.3 2004/10/13 11:50:56 matze
33  * renamed packages to org.apache
34  *
35  * Revision 1.2 2004/07/01 21:57:56 mwessendorf
36  * ASF switch
37  *
38  * Revision 1.1 2004/06/28 22:12:11 o_rossmueller
39  * fix #978654: do not coerce null
40  *
41  * Revision 1.1 2004/05/26 17:19:57 o_rossmueller
42  * test for bug 948626
43  *
44  * Revision 1.1 2004/05/04 06:36:20 manolito
45  * Bugfix #947302
46  *
47  */

48 public class Bug978654CactusTest
49         extends ServletTestCase
50 {
51     public Bug978654CactusTest(String JavaDoc name) {
52         super(name);
53     }
54
55     public void testBug() throws Exception JavaDoc
56     {
57         RequestDispatcher JavaDoc rd = config.getServletContext().getRequestDispatcher(
58                 "/Bug978654CactusTest.jsf");
59         // render the page for the first time
60
rd.forward(request, response);
61     }
62
63     public void endBug948626(WebResponse response)
64             throws Exception JavaDoc
65     {
66         WebConversation conversation = new WebConversation();
67         response = conversation.getResponse(response.getURL().toExternalForm());
68         WebForm form = response.getFormWithID("testForm");
69         SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");
70         assertEquals("", form.getParameterValue("testForm:hidden"));
71         response = form.submit(submitButton);
72         form = response.getFormWithID("testForm");
73         assertEquals("", form.getParameterValue("testForm:hidden"));
74     }
75 }
76
Popular Tags