org.japano.pagenode
Class Test

java.lang.Object
  extended by org.japano.PageNode
      extended by org.japano.pagenode.Test

public class Test
extends PageNode

This tag is used to unit test jsp pages. The following source would test whether the output of the enclosed jpn:foo tag matches the regular expression "[0-9]+".

<jpn:test match="[0-9]+">
  <jpn:foo/>
</jpn:test>
The ant task TestJSP supports automatic testing of JSP pages including this tag.

Version:
$Id: Test.java,v 1.8 2005/09/27 21:30:51 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )
See Also:
TestJSP

Nested Class Summary
static class Test.Match
          Defines the regular expression to match against.
 
Nested classes/interfaces inherited from class org.japano.PageNode
PageNode.Output
 
Field Summary
 
Fields inherited from class org.japano.PageNode
children, context, EMPTY, nodeId, parent
 
Constructor Summary
Test()
          Creates a new instance of Test
 
Method Summary
 void generate(Buffer out)
          Generates this node The base implementation just calls PageNode.generateChildren(Buffer)
 void init()
          Initializes the node.
 void setMatch(java.lang.String value)
          The regular expression to match against.
 void setName(java.lang.String name)
          The name of this test.
 void setPass(boolean pass)
          Normally the test is passed when the test body output matches the expected value and the body evalutation does not result in an exception.
 
Methods inherited from class org.japano.PageNode
findChildren, findParent, findRootNode, generateChildren, getChildren, getContext, getNodeId, getParent, recInit, release, setChildren, setContext, setNodeId, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Test

public Test()
Creates a new instance of Test

Method Detail

setName

public void setName(java.lang.String name)
The name of this test.


setMatch

public void setMatch(java.lang.String value)
The regular expression to match against. Can also be set by an enclosed jpn:test-match tag.


setPass

public void setPass(boolean pass)
Normally the test is passed when the test body output matches the expected value and the body evalutation does not result in an exception. If this is attribute to false, the test only passes if the body throws an exception.


generate

public void generate(Buffer out)
Description copied from class: PageNode
Generates this node The base implementation just calls PageNode.generateChildren(Buffer)

Overrides:
generate in class PageNode

init

public void init()
Description copied from class: PageNode
Initializes the node. The init method is called after all nodes of the page are constructed, linked and configured.

Overrides:
init in class PageNode