org.apache.cactus
Class WebTestResult

java.lang.Object
  extended byorg.apache.cactus.WebTestResult
All Implemented Interfaces:
java.io.Serializable

public class WebTestResult
extends java.lang.Object
implements java.io.Serializable

Represent the result of the execution of the Test class by the server redirector.If any exception was raised during the test, it is saved by this class.

Version:
$Id: WebTestResult.java,v 1.7 2003/05/26 11:45:23 cmlenz Exp $
Author:
Vincent Massol
See Also:
Serialized Form

Field Summary
static java.lang.String XML_EXCEPTION_CLASSNAME_ATTRIBUTE
          Name of Exception XML attribute that contains the exception classname (see toXml()).
static java.lang.String XML_EXCEPTION_ELEMENT
          Name of Exception XML tag (see toXml()).
static java.lang.String XML_EXCEPTION_MESSAGE_ELEMENT
          Name of Exception Message XML tag (see toXml()).
static java.lang.String XML_EXCEPTION_STACKTRACE_ELEMENT
          Name of Exception Stacktrace XML tag (see toXml()).
static java.lang.String XML_ROOT_ELEMENT
          Name of Root XML tag (see toXml()).
 
Constructor Summary
WebTestResult()
          Constructor to call when the test was ok and no error was raised.
WebTestResult(java.lang.String theClassName, java.lang.String theMessage, java.lang.String theStackTrace)
          Constructor used to reconstruct a WebTestResult object from its String representation.
WebTestResult(java.lang.Throwable theException)
          Constructor to call when an exception was raised during the test.
 
Method Summary
 java.lang.String getExceptionClassName()
           
 java.lang.String getExceptionMessage()
           
 java.lang.String getExceptionStackTrace()
           
 boolean hasException()
           
 java.lang.String toString()
           
 java.lang.String toXml()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_ROOT_ELEMENT

public static final java.lang.String XML_ROOT_ELEMENT
Name of Root XML tag (see toXml()).

See Also:
Constant Field Values

XML_EXCEPTION_ELEMENT

public static final java.lang.String XML_EXCEPTION_ELEMENT
Name of Exception XML tag (see toXml()).

See Also:
Constant Field Values

XML_EXCEPTION_CLASSNAME_ATTRIBUTE

public static final java.lang.String XML_EXCEPTION_CLASSNAME_ATTRIBUTE
Name of Exception XML attribute that contains the exception classname (see toXml()).

See Also:
Constant Field Values

XML_EXCEPTION_MESSAGE_ELEMENT

public static final java.lang.String XML_EXCEPTION_MESSAGE_ELEMENT
Name of Exception Message XML tag (see toXml()).

See Also:
Constant Field Values

XML_EXCEPTION_STACKTRACE_ELEMENT

public static final java.lang.String XML_EXCEPTION_STACKTRACE_ELEMENT
Name of Exception Stacktrace XML tag (see toXml()).

See Also:
Constant Field Values
Constructor Detail

WebTestResult

public WebTestResult()
Constructor to call when the test was ok and no error was raised.


WebTestResult

public WebTestResult(java.lang.Throwable theException)
Constructor to call when an exception was raised during the test.

Parameters:
theException - the raised exception.

WebTestResult

public WebTestResult(java.lang.String theClassName,
                     java.lang.String theMessage,
                     java.lang.String theStackTrace)
Constructor used to reconstruct a WebTestResult object from its String representation.

Parameters:
theClassName - the class name of the exception thrown on the server side
theMessage - the message of the exception thrown on the server side
theStackTrace - the stack trace of the exception thrown on the server side
Method Detail

getExceptionClassName

public java.lang.String getExceptionClassName()
Returns:
the exception class name if an exception was raised or null otherwise.

getExceptionMessage

public java.lang.String getExceptionMessage()
Returns:
the exception message if an exception was raised or null otherwise.

hasException

public boolean hasException()
Returns:
true if an exception was raised during the test, false otherwise.

getExceptionStackTrace

public java.lang.String getExceptionStackTrace()
Returns:
the stack trace as a string

toString

public java.lang.String toString()
See Also:
Object.toString()

toXml

public java.lang.String toXml()
Returns:
an XML representation of the test result to be sent in the HTTP response to the Cactus client.


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.