KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > HtmlInputHiddenTagCactusTest


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.taglib.html;
17
18 import com.meterware.httpunit.WebForm;
19 import com.meterware.httpunit.WebResponse;
20 import org.w3c.dom.Node JavaDoc;
21 import org.w3c.dom.NodeList JavaDoc;
22
23 import org.apache.cactus.ServletTestCase;
24
25 import javax.servlet.RequestDispatcher JavaDoc;
26
27 /**
28  * @author Manfred Geiler (latest modification by $Author: matze $)
29  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:56 $
30  * $Log: HtmlInputHiddenTagCactusTest.java,v $
31  * Revision 1.3 2004/10/13 11:50:56 matze
32  * renamed packages to org.apache
33  *
34  * Revision 1.2 2004/07/01 21:57:58 mwessendorf
35  * ASF switch
36  *
37  * Revision 1.1 2004/04/23 15:12:14 manolito
38  * inputHidden bug reported by Travis
39  *
40  */

41 public class HtmlInputHiddenTagCactusTest
42         extends ServletTestCase
43 {
44     //private static final Log log = LogFactory.getLog(HtmlInputHiddenTagCactusTest.class);
45

46     public HtmlInputHiddenTagCactusTest(String JavaDoc name) {
47         super(name);
48     }
49
50     public void testSimpleRender() throws Exception JavaDoc {
51         RequestDispatcher JavaDoc rd = config.getServletContext().getRequestDispatcher(
52                 "/HtmlInputHiddenTagCactusTest.jsf");
53         // render the page for the first time
54
rd.forward(request, response);
55     }
56
57     public void endSimpleRender(WebResponse response)
58             throws Exception JavaDoc
59     {
60         WebForm form = response.getFormWithID("testForm");
61         Node JavaDoc node = form.getDOMSubtree();
62         NodeList JavaDoc lst = node.getChildNodes();
63         for (int i = 0, len = lst.getLength(); i < len; i++)
64         {
65             Node JavaDoc child = lst.item(i);
66             System.out.println(child.getNodeName());
67         }
68     }
69 }
70
Popular Tags