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
Class ServletTestCase

    java.lang.Object
      junit.framework.Assert
          junit.framework.TestCase
              org.apache.cactus.internal.AbstractCactusTestCase
                  org.apache.cactus.ServletTestCase

All Implemented Interfaces:
  CactusTestCase, junit.framework.Test

Direct Known Subclasses:
  JspTestCase

public class ServletTestCase
extends AbstractCactusTestCase
implements CactusTestCase

Cactus test case to unit test Servlets. Test classes that need access to valid Servlet implicit objects (such as the HTTP request, the HTTP response, the servlet config, ...) must subclass this class.

Version:
  $Id: ServletTestCase.java 238991 2004-05-22 11:34:50Z vmassol $

Field Summary
`ServletConfigWrapper` | `config` Valid `ServletConfig` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods.
`HttpServletRequestWrapper` | `request` Valid `HttpServletRequest` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods.
`javax.servlet.http.HttpServletResponse` | `response` Valid `HttpServletResponse` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods.
`javax.servlet.http.HttpSession` | `session` Valid `HttpSession` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods.

Constructor Summary
`ServletTestCase()`
`ServletTestCase(java.lang.String theName)`
`ServletTestCase(java.lang.String theName, junit.framework.Test theTest)`

Method Summary
`protected ProtocolHandler` | `createProtocolHandler()` Create a protocol handler instance that will be used to connect to the server side.

Methods inherited from class org.apache.cactus.internal.AbstractCactusTestCase
`runBare, runBareServer`

Methods inherited from class junit.framework.TestCase
`countTestCases, createResult, getName, run, run, runTest, setName, setUp, tearDown, toString`

Methods inherited from class junit.framework.Assert
`assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.cactus.internal.CactusTestCase
`runBareServer`

Field Detail

### request

    public HttpServletRequestWrapper request

  Valid `HttpServletRequest` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods. If you try to access it from either the `beginXXX()` or `endXXX()` methods it will have the `null` value.

### response

    public javax.servlet.http.HttpServletResponse response

  Valid `HttpServletResponse` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods. If you try to access it from either the `beginXXX()` or `endXXX()` methods it will have the `null` value.

### session

    public javax.servlet.http.HttpSession session

  Valid `HttpSession` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods. If you try to access it from either the `beginXXX()` or `endXXX()` methods it will have the `null` value.

### config

    public ServletConfigWrapper config

  Valid `ServletConfig` object that you can access from the `testXXX()`, `setUp` and `tearDown()` methods. If you try to access it from either the `beginXXX()` or `endXXX()` methods it will have the `null` value.

Constructor Detail

### ServletTestCase

    public ServletTestCase()

See Also:
  `AbstractCactusTestCase.AbstractCactusTestCase()`

### ServletTestCase

    public ServletTestCase(java.lang.String theName)

See Also:
  `AbstractCactusTestCase.AbstractCactusTestCase(String)`

### ServletTestCase

    public ServletTestCase(java.lang.String theName,
                           junit.framework.Test theTest)

See Also:
  `AbstractCactusTestCase.AbstractCactusTestCase(String, Test)`

Method Detail

### createProtocolHandler

    protected ProtocolHandler createProtocolHandler()

  Description copied from class: `AbstractCactusTestCase`
  Create a protocol handler instance that will be used to connect to the server side.

  Specified by:
    `createProtocolHandler` in class `AbstractCactusTestCase`
  Returns:
    the protocol handler instance
  See Also:
    `AbstractCactusTestCase.createProtocolHandler()`

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.