org.apache.commons.jelly.tags.junit
Class RunTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.junit.RunTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class RunTag
extends org.apache.commons.jelly.TagSupport

This tag will run the given Test which could be an individual TestCase or a TestSuite. The TestResult can be specified to capture the output, otherwise the results are output as XML so that they can be formatted in some custom manner.

Version:
$Revision: 155420 $
Author:
James Strachan

Field Summary
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
RunTag()
           
 
Method Summary
protected  junit.framework.TestResult createResult(org.apache.commons.jelly.XMLOutput output)
          Factory method to create a new TestResult to capture the output of the test cases
protected  junit.framework.TestListener createTestListener(org.apache.commons.jelly.XMLOutput output)
          Factory method to create a new TestListener to capture the output of the test cases
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
 junit.framework.TestListener getListener()
          Returns the listener.
 junit.framework.TestResult getResult()
          Returns the TestResult used to capture the output of the test.
 junit.framework.Test getTest()
          Returns the Test to be ran.
protected  void handleSAXException(org.xml.sax.SAXException e)
          Handles SAX Exceptions
 void setListener(junit.framework.TestListener listener)
          Sets the TestListener.to be used to format the output of running the unit test cases
 void setResult(junit.framework.TestResult result)
          Sets the JUnit TestResult used to capture the results of the tst
 void setTest(junit.framework.Test test)
          Sets the JUnit Test to run which could be an individual test or a TestSuite
protected  java.lang.String stackTraceToString(java.lang.Throwable t)
           
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunTag

public RunTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.MissingAttributeException,
                  org.apache.commons.jelly.JellyTagException
Throws:
org.apache.commons.jelly.MissingAttributeException
org.apache.commons.jelly.JellyTagException

getResult

public junit.framework.TestResult getResult()
Returns the TestResult used to capture the output of the test.

Returns:
TestResult

getTest

public junit.framework.Test getTest()
Returns the Test to be ran.

Returns:
Test

setResult

public void setResult(junit.framework.TestResult result)
Sets the JUnit TestResult used to capture the results of the tst

Parameters:
result - The TestResult to use

setTest

public void setTest(junit.framework.Test test)
Sets the JUnit Test to run which could be an individual test or a TestSuite

Parameters:
test - The test to run

getListener

public junit.framework.TestListener getListener()
Returns the listener.

Returns:
TestListener

setListener

public void setListener(junit.framework.TestListener listener)
Sets the TestListener.to be used to format the output of running the unit test cases

Parameters:
listener - The listener to set

createResult

protected junit.framework.TestResult createResult(org.apache.commons.jelly.XMLOutput output)
Factory method to create a new TestResult to capture the output of the test cases


createTestListener

protected junit.framework.TestListener createTestListener(org.apache.commons.jelly.XMLOutput output)
Factory method to create a new TestListener to capture the output of the test cases


stackTraceToString

protected java.lang.String stackTraceToString(java.lang.Throwable t)
Returns:
the stack trace as a String

handleSAXException

protected void handleSAXException(org.xml.sax.SAXException e)
Handles SAX Exceptions



Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.