org.apache.wink.test.mock
Class SpringMockServletInvocationTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.wink.test.mock.SpringAwareTestCase
              extended by org.apache.wink.test.mock.SpringMockServletInvocationTest
All Implemented Interfaces:
junit.framework.Test

public abstract class SpringMockServletInvocationTest
extends SpringAwareTestCase

Base class for tests using mock servlet invocation (= invoking directly servlet's method with Spring mock request/response).


Field Summary
 
Fields inherited from class org.apache.wink.test.mock.SpringAwareTestCase
applicationContext, servletContext
 
Constructor Summary
SpringMockServletInvocationTest()
           
 
Method Summary
 org.springframework.mock.web.MockHttpServletResponse invoke(org.springframework.mock.web.MockHttpServletRequest request)
          Passes the test to the servlet instance simulating AS behaviour.
protected  void setUp()
           
 
Methods inherited from class org.apache.wink.test.mock.SpringAwareTestCase
getAdditionalContextNames, getPackagePath
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpringMockServletInvocationTest

public SpringMockServletInvocationTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class SpringAwareTestCase
Throws:
java.lang.Exception

invoke

public org.springframework.mock.web.MockHttpServletResponse invoke(org.springframework.mock.web.MockHttpServletRequest request)
                                                            throws javax.servlet.ServletException,
                                                                   java.io.IOException
Passes the test to the servlet instance simulating AS behaviour.

Parameters:
request - the filled request
Returns:
a new response as filled by the servlet
Throws:
java.io.IOException - io error
javax.servlet.ServletException


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