KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.apache.myfaces.cactus.JspBasedTestCase;
19
20 import com.meterware.httpunit.WebResponse;
21 import com.meterware.httpunit.WebConversation;
22 import com.meterware.httpunit.WebForm;
23 import com.meterware.httpunit.SubmitButton;
24
25
26 /**
27  * @author <a HREF="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
28  */

29 public class Bug1050122CactusTest
30     extends JspBasedTestCase
31 {
32
33     public Bug1050122CactusTest(String JavaDoc string)
34     {
35         super(string);
36     }
37
38
39     public void endBug(WebResponse response)
40         throws Exception JavaDoc
41     {
42         WebConversation conversation = new WebConversation();
43         response = conversation.getResponse(response.getURL().toExternalForm());
44         WebForm form = response.getFormWithID("testForm");
45         form.setParameter("testForm:size", "12");
46         SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");
47         response = form.submit(submitButton);
48
49         // is it a Long?
50
assertTrue(response.getText().indexOf("12class java.lang.Long") != -1);
51     }
52 }
53
Popular Tags