KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > junit > AutoJspTestCallback


1 package com.inversoft.junit;
2
3
4 import javax.servlet.jsp.tagext.Tag JavaDoc;
5 import javax.servlet.jsp.JspException JavaDoc;
6
7
8 /**
9  * <p>
10  * This class is an automatic JspTestCallback implementation
11  * that takes a list of Tags and in order calls each one.
12  * </p>
13  *
14  * @author Brian Pontarelli
15  */

16 public class AutoJspTestCallback implements JspTestCallback {
17
18     private Tag JavaDoc[] tags = null;
19
20
21     /**
22      * Constructs a new <code>AutoJspTestCallback</code> that calls the given tags
23      * in order.
24      *
25      * @param tags The tags to call
26      */

27     public AutoJspTestCallback(Tag JavaDoc[] tags) {
28         this.tags = tags;
29     }
30
31
32     /**
33      * Calls all the tags in order.
34      */

35     public void callback() throws JspException JavaDoc {
36         if (tags == null) {
37             return;
38         }
39
40         for (int i = 0; i < tags.length; i++) {
41             if (tags[i] != null) {
42                 JspTestCase.runTag(tags[i]);
43             }
44         }
45     }
46 }
47
Popular Tags