org.tuckey.web.filters.urlrewrite.test
Class TestRunObj

java.lang.Object
  extended by org.tuckey.web.filters.urlrewrite.test.TestRunObj

public class TestRunObj
extends java.lang.Object

RunObject that can be used for testing. Included here and not in test folder as it needs to be deployed with the main library.

Version:
$Revision: 33 $ $Date: 2006-09-12 16:41:56 +1200 (Tue, 12 Sep 2006) $
Author:
Paul Tuckey

Constructor Summary
TestRunObj()
           
 
Method Summary
 void destroy()
           
static int getCreatedCount()
           
static java.lang.String getParamStr()
           
static long getRunWithChainParamAfterDoFilter()
           
static javax.servlet.ServletConfig getTestServletConfig()
           
 void init(javax.servlet.ServletConfig config)
           
static boolean isDestroyCalled()
           
static boolean isInitCalled()
           
static boolean isNonDefaultRunCalled()
           
static boolean isRunCalled()
           
 void nonDefaultRun(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
static void resetTestFlags()
           
 void run(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 void runCustomException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 void runIOException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 void runNullPointerException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 void runRuntiumeException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 void runServletException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 java.lang.String runThatReturns(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 java.lang.String runWithChainParam(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, javax.servlet.FilterChain c)
           
 java.lang.String runWithNoParams()
           
 java.lang.String runWithObjParam(java.lang.Integer i, java.lang.Character c, java.lang.Double d, java.lang.Float f, java.lang.Short s, java.lang.Byte b, java.lang.Boolean b2, java.lang.String s2)
           
 java.lang.String runWithParam(int i)
           
 java.lang.String runWithPrimitiveParam(int i, char c, double d, float f, short s, byte b, boolean b2, java.lang.String s2)
           
 MockRewriteMatch runWithReturnedObj(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 RewriteMatch trialException(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, java.lang.ClassNotFoundException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRunObj

public TestRunObj()
Method Detail

run

public void run(javax.servlet.http.HttpServletRequest httpServletRequest,
                javax.servlet.http.HttpServletResponse httpServletResponse)
         throws javax.servlet.ServletException,
                java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runWithReturnedObj

public MockRewriteMatch runWithReturnedObj(javax.servlet.http.HttpServletRequest httpServletRequest,
                                           javax.servlet.http.HttpServletResponse httpServletResponse)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

nonDefaultRun

public void nonDefaultRun(javax.servlet.http.HttpServletRequest httpServletRequest,
                          javax.servlet.http.HttpServletResponse httpServletResponse)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runThatReturns

public java.lang.String runThatReturns(javax.servlet.http.HttpServletRequest httpServletRequest,
                                       javax.servlet.http.HttpServletResponse httpServletResponse)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runWithParam

public java.lang.String runWithParam(int i)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runWithNoParams

public java.lang.String runWithNoParams()
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runWithChainParam

public java.lang.String runWithChainParam(javax.servlet.http.HttpServletRequest httpServletRequest,
                                          javax.servlet.http.HttpServletResponse httpServletResponse,
                                          javax.servlet.FilterChain c)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getRunWithChainParamAfterDoFilter

public static long getRunWithChainParamAfterDoFilter()

runWithPrimitiveParam

public java.lang.String runWithPrimitiveParam(int i,
                                              char c,
                                              double d,
                                              float f,
                                              short s,
                                              byte b,
                                              boolean b2,
                                              java.lang.String s2)
                                       throws javax.servlet.ServletException,
                                              java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runWithObjParam

public java.lang.String runWithObjParam(java.lang.Integer i,
                                        java.lang.Character c,
                                        java.lang.Double d,
                                        java.lang.Float f,
                                        java.lang.Short s,
                                        java.lang.Byte b,
                                        java.lang.Boolean b2,
                                        java.lang.String s2)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getParamStr

public static java.lang.String getParamStr()

runNullPointerException

public void runNullPointerException(javax.servlet.http.HttpServletRequest httpServletRequest,
                                    javax.servlet.http.HttpServletResponse httpServletResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runRuntiumeException

public void runRuntiumeException(javax.servlet.http.HttpServletRequest httpServletRequest,
                                 javax.servlet.http.HttpServletResponse httpServletResponse)
                          throws javax.servlet.ServletException,
                                 java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runServletException

public void runServletException(javax.servlet.http.HttpServletRequest httpServletRequest,
                                javax.servlet.http.HttpServletResponse httpServletResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runIOException

public void runIOException(javax.servlet.http.HttpServletRequest httpServletRequest,
                           javax.servlet.http.HttpServletResponse httpServletResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

runCustomException

public void runCustomException(javax.servlet.http.HttpServletRequest httpServletRequest,
                               javax.servlet.http.HttpServletResponse httpServletResponse)
                        throws org.tuckey.web.filters.urlrewrite.test.TestRunObj.TestExceptionGenerator.CustomException
Throws:
org.tuckey.web.filters.urlrewrite.test.TestRunObj.TestExceptionGenerator.CustomException

trialException

public RewriteMatch trialException(javax.servlet.http.HttpServletRequest httpServletRequest,
                                   javax.servlet.http.HttpServletResponse httpServletResponse,
                                   java.lang.ClassNotFoundException e)

destroy

public void destroy()

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

isRunCalled

public static boolean isRunCalled()

getCreatedCount

public static int getCreatedCount()

resetTestFlags

public static void resetTestFlags()

getTestServletConfig

public static javax.servlet.ServletConfig getTestServletConfig()

isDestroyCalled

public static boolean isDestroyCalled()

isInitCalled

public static boolean isInitCalled()

isNonDefaultRunCalled

public static boolean isNonDefaultRunCalled()