Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cactus.server.runner
Class ServletTestRunner

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.apache.cactus.server.runner.ServletTestRunner

All Implemented Interfaces:
  java.io.Serializable, 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.

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

Constructor Summary
`ServletTestRunner()`

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, 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

### ServletTestRunner

    public ServletTestRunner()

Method Detail

### init

    public void init()
              throws javax.servlet.ServletException

  Called by the container when the servlet is initialized.

  Throws:
    `javax.servlet.ServletException` - If an initialization parameter contains an illegal value

### doGet

    public void doGet(javax.servlet.http.HttpServletRequest theRequest,
                      javax.servlet.http.HttpServletResponse theResponse)
               throws javax.servlet.ServletException,
                      java.io.IOException

  Starts the test suite passed as a HTTP parameter

  Parameters:
    `theRequest` - the incoming HTTP client request
    `theResponse` - the outgoing HTTP client request to send back.
  Throws:
    `javax.servlet.ServletException` - if an error occurs when servicing the request
    `java.io.IOException` - if an error occurs when servicing the request

### run

    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.

  Parameters:
    `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
  Returns:
    the result object
  Throws:
    `javax.servlet.ServletException` - if the suite failed to be loaded

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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