KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > BeanTagTest


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp;
6
7 import javax.servlet.jsp.JspException JavaDoc;
8
9
10 /**
11  * DOCUMENT ME!
12  *
13  * @author $author$
14  * @version $Revision: 1.10 $
15  */

16 public class BeanTagTest extends AbstractUITagTest {
17     //~ Methods ////////////////////////////////////////////////////////////////
18

19     public void testSimple() {
20         BeanTag tag = new BeanTag();
21         tag.setPageContext(pageContext);
22         tag.setName("com.opensymphony.webwork.TestAction");
23
24         try {
25             tag.doStartTag();
26             tag.addParameter("result", "success");
27
28             assertEquals("success", stack.findValue("result"));
29             // TestAction from bean tag, Action from execution and DefaultTextProvider
30
assertEquals(3, stack.size());
31             tag.doEndTag();
32             assertEquals(2, stack.size());
33         } catch (JspException JavaDoc ex) {
34             ex.printStackTrace();
35             fail();
36         }
37
38         request.verify();
39         pageContext.verify();
40     }
41 }
42
Popular Tags