Class ServletTestRunner

  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.cactus.server.runner.ServletTestRunner
All Implemented Interfaces:, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletTestRunner
extends javax.servlet.http.HttpServlet

Helper servlet to start a JUnit Test Runner in a webapp.

This class currently does a couple of reflection tricks to avoid a direct dependancy on the TraX API (javax.xml.transform.*), encapsulated in the XMLTransformer class.

$Id: 239016 2004-06-27 15:23:30Z vmassol $
See Also:
Serialized Form

Constructor Summary
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest theRequest, javax.servlet.http.HttpServletResponse theResponse)
          Starts the test suite passed as a HTTP parameter.
 void init()
          Called by the container when the servlet is initialized.
protected  java.lang.String run(java.lang.String theSuiteClassName, java.lang.String theXslFileName, java.lang.String theEncoding)
          Run the suite tests and return the result.
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ServletTestRunner()
Method Detail


public void init()
          throws javax.servlet.ServletException
Called by the container when the servlet is initialized.

init in class javax.servlet.GenericServlet
javax.servlet.ServletException - If an initialization parameter contains an illegal value


public void doGet(javax.servlet.http.HttpServletRequest theRequest,
                  javax.servlet.http.HttpServletResponse theResponse)
           throws javax.servlet.ServletException,
Starts the test suite passed as a HTTP parameter.

doGet in class javax.servlet.http.HttpServlet
theRequest - the incoming HTTP client request
theResponse - the outgoing HTTP client request to send back.
javax.servlet.ServletException - if an error occurs when servicing the request - if an error occurs when servicing the request


protected java.lang.String run(java.lang.String theSuiteClassName,
                               java.lang.String theXslFileName,
                               java.lang.String theEncoding)
                        throws javax.servlet.ServletException
Run the suite tests and return the result.

theSuiteClassName - the suite containing the tests to run
theXslFileName - the name of the XSL stylesheet or null if we don't want to apply a stylesheet to the returned XML data
theEncoding - the encoding to use for the returned XML or null if default encoding is to be used
the result object
javax.servlet.ServletException - if the suite failed to be loaded

Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.