org.apache.sling.junit.impl.servlet
Class JUnitServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.sling.junit.impl.servlet.JUnitServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
SlingJUnitServlet

public class JUnitServlet
extends javax.servlet.http.HttpServlet

Simple test runner servlet

See Also:
Serialized Form

Field Summary
static java.lang.String CSS
           
 
Constructor Summary
JUnitServlet()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext ctx)
           
protected  void deactivate(org.osgi.service.component.ComponentContext ctx)
           
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          GET request lists available tests
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          POST request executes tests
protected  java.lang.String getServletPath(org.osgi.service.component.ComponentContext ctx)
          Return the path at which to mount this servlet, or null if it must not be mounted.
protected  java.lang.String getTestExecutionPath(javax.servlet.http.HttpServletRequest request, TestSelector selector, java.lang.String extension)
          Return path to which to POST to execute specified test
protected  java.lang.String getTestSelectionPath(javax.servlet.http.HttpServletRequest request)
          Return subpath to use for selecting tests
protected  TestSelector getTestSelector(javax.servlet.http.HttpServletRequest request)
          Return a TestSelector for supplied request
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSS

public static final java.lang.String CSS
See Also:
Constant Field Values
Constructor Detail

JUnitServlet

public JUnitServlet()
Method Detail

activate

protected void activate(org.osgi.service.component.ComponentContext ctx)
                 throws javax.servlet.ServletException,
                        org.osgi.service.http.NamespaceException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException

getServletPath

protected java.lang.String getServletPath(org.osgi.service.component.ComponentContext ctx)
Return the path at which to mount this servlet, or null if it must not be mounted.


deactivate

protected void deactivate(org.osgi.service.component.ComponentContext ctx)
                   throws javax.servlet.ServletException,
                          org.osgi.service.http.NamespaceException
Throws:
javax.servlet.ServletException
org.osgi.service.http.NamespaceException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
GET request lists available tests

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
POST request executes tests

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

getTestSelector

protected TestSelector getTestSelector(javax.servlet.http.HttpServletRequest request)
Return a TestSelector for supplied request


getTestSelectionPath

protected java.lang.String getTestSelectionPath(javax.servlet.http.HttpServletRequest request)
Return subpath to use for selecting tests


getTestExecutionPath

protected java.lang.String getTestExecutionPath(javax.servlet.http.HttpServletRequest request,
                                                TestSelector selector,
                                                java.lang.String extension)
Return path to which to POST to execute specified test



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.