KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > core > Bug979039CactusTest


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.core;
17
18 import javax.servlet.RequestDispatcher JavaDoc;
19
20 import org.apache.cactus.ServletTestCase;
21
22 import com.meterware.httpunit.WebForm;
23 import com.meterware.httpunit.WebResponse;
24
25 /**
26  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
27  * @version $Revision: 1.3 $ $Date: 2004/10/13 11:50:56 $
28  * $Log: Bug979039CactusTest.java,v $
29  * Revision 1.3 2004/10/13 11:50:56 matze
30  * renamed packages to org.apache
31  *
32  * Revision 1.2 2004/07/01 21:57:59 mwessendorf
33  * ASF switch
34  *
35  * Revision 1.1 2004/06/26 00:34:49 o_rossmueller
36  * fix #979039: default type = number for convertNumber
37  *
38  * Revision 1.1 2004/05/26 17:19:57 o_rossmueller
39  * test for bug 948626
40  *
41  * Revision 1.1 2004/05/04 06:36:20 manolito
42  * Bugfix #947302
43  *
44  */

45 public class Bug979039CactusTest
46         extends ServletTestCase
47 {
48     public Bug979039CactusTest(String JavaDoc name) {
49         super(name);
50     }
51
52     public void testBug() throws Exception JavaDoc
53     {
54         RequestDispatcher JavaDoc rd = config.getServletContext().getRequestDispatcher(
55                 "/Bug979039CactusTest.jsf");
56         // render the page for the first time
57
rd.forward(request, response);
58     }
59
60     public void endBug948626(WebResponse response)
61             throws Exception JavaDoc
62     {
63         assertEquals(-1, response.getText().indexOf("Cannot get NumberFormat, either type or pattern needed."));
64         WebForm form = response.getFormWithID("testForm");
65         assertEquals("0", form.getParameterValue("testForm:input"));
66     }
67 }
68
Popular Tags