com.mockrunner.base
Class BaseTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.mockrunner.base.BaseTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ConnectorTestCaseAdapter, EJBTestCaseAdapter, JDBCTestCaseAdapter, JMSTestCaseAdapter, WebTestCase

public abstract class BaseTestCase
extends junit.framework.TestCase

Base class for all standard adapters. Not used for basic adapters.


Constructor Summary
BaseTestCase()
           
BaseTestCase(java.lang.String arg0)
           
 
Method Summary
protected  ActionMockObjectFactory createActionMockObjectFactory()
          Creates a ActionMockObjectFactory.
protected  ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory)
          Same as createActionMockObjectFactory(otherFactory, true)
protected  ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory, boolean createNewSession)
          Creates a ActionMockObjectFactory based on another WebMockObjectFactory.
protected  ActionTestModule createActionTestModule()
          Creates an ActionTestModule based on the current WebMockObjectFactory.
protected  ActionTestModule createActionTestModule(ActionMockObjectFactory mockFactory)
          Creates an ActionTestModule with the specified WebMockObjectFactory.
protected  ConnectorMockObjectFactory createConnectorMockObjectFactory()
          Creates a ConnectorMockObjectFactory.
protected  ConnectorTestModule createConnectorTestModule()
          Creates an ConnectorTestModule based on the current ConnectorMockObjectFactory.
protected  ConnectorTestModule createConnectorTestModule(ConnectorMockObjectFactory mockFactory)
          Creates an ConnectorTestModule with the specified ConnectorMockObjectFactory.
protected  EJBMockObjectFactory createEJBMockObjectFactory()
          Creates a EJBMockObjectFactory.
protected  EJBTestModule createEJBTestModule()
          Creates an EJBTestModule based on the current EJBMockObjectFactory.
protected  EJBTestModule createEJBTestModule(EJBMockObjectFactory mockFactory)
          Creates an EJBTestModule with the specified EJBMockObjectFactory.
protected  JDBCMockObjectFactory createJDBCMockObjectFactory()
          Creates a JDBCMockObjectFactory.
protected  JDBCTestModule createJDBCTestModule()
          Creates a JDBCTestModule based on the current JDBCMockObjectFactory.
protected  JDBCTestModule createJDBCTestModule(JDBCMockObjectFactory mockFactory)
          Creates a JDBCTestModule with the specified JDBCMockObjectFactory.
protected  JMSMockObjectFactory createJMSMockObjectFactory()
          Creates a JMSMockObjectFactory.
protected  JMSTestModule createJMSTestModule()
          Creates a JMSTestModule based on the current JMSMockObjectFactory.
protected  JMSTestModule createJMSTestModule(JMSMockObjectFactory mockFactory)
          Creates a JMSTestModule with the specified JMSMockObjectFactory.
protected  ServletTestModule createServletTestModule()
          Creates a ServletTestModule based on the current WebMockObjectFactory.
protected  ServletTestModule createServletTestModule(WebMockObjectFactory mockFactory)
          Creates a ServletTestModule with the specified WebMockObjectFactory.
protected  TagTestModule createTagTestModule()
          Creates a TagTestModule based on the current WebMockObjectFactory.
protected  TagTestModule createTagTestModule(WebMockObjectFactory mockFactory)
          Creates a TagTestModule with the specified WebMockObjectFactory.
protected  WebMockObjectFactory createWebMockObjectFactory()
          Creates a WebMockObjectFactory.
protected  WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory)
          Same as createWebMockObjectFactory(otherFactory, true)
protected  WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory, boolean createNewSession)
          Creates a WebMockObjectFactory based on another one.
protected  ActionMockObjectFactory getActionMockObjectFactory()
          Gets the current ActionMockObjectFactory.
protected  ConnectorMockObjectFactory getConnectorMockObjectFactory()
          Gets the current ConnectorMockObjectFactory.
protected  EJBMockObjectFactory getEJBMockObjectFactory()
          Gets the current EJBMockObjectFactory.
protected  JDBCMockObjectFactory getJDBCMockObjectFactory()
          Gets the current JDBCMockObjectFactory.
protected  JMSMockObjectFactory getJMSMockObjectFactory()
          Gets the current JMSMockObjectFactory.
protected  WebMockObjectFactory getWebMockObjectFactory()
          Gets the current WebMockObjectFactory.
protected  void setActionMockObjectFactory(ActionMockObjectFactory mockFactory)
          Sets the current ActionMockObjectFactory.
protected  void setConnectorMockObjectFactory(ConnectorMockObjectFactory mockFactory)
          Sets the current ConnectorMockObjectFactory.
protected  void setEJBMockObjectFactory(EJBMockObjectFactory mockFactory)
          Sets the current EJBMockObjectFactory.
protected  void setJDBCMockObjectFactory(JDBCMockObjectFactory mockFactory)
          Sets the current JDBCMockObjectFactory.
protected  void setJMSMockObjectFactory(JMSMockObjectFactory mockFactory)
          Sets the current JMSMockObjectFactory.
protected  void setWebMockObjectFactory(WebMockObjectFactory mockFactory)
          Sets the current WebMockObjectFactory.
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseTestCase

public BaseTestCase()

BaseTestCase

public BaseTestCase(java.lang.String arg0)
Method Detail

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

createWebMockObjectFactory

protected WebMockObjectFactory createWebMockObjectFactory()
Creates a WebMockObjectFactory.

Returns:
the created WebMockObjectFactory

createWebMockObjectFactory

protected WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory)
Same as createWebMockObjectFactory(otherFactory, true)


createWebMockObjectFactory

protected WebMockObjectFactory createWebMockObjectFactory(WebMockObjectFactory otherFactory,
                                                          boolean createNewSession)
Creates a WebMockObjectFactory based on another one. The created WebMockObjectFactory will have its own request and response objects. If you set createNewSession to true it will also have its own session object. The two factories will share one ServletContext. Especially important for multithreading tests. If you set createNewSession to false, the two factories will share one session. This setting simulates multiple requests from the same client.

Parameters:
otherFactory - the other factory
createNewSession - create a new session for the new factory
Returns:
the created WebMockObjectFactory

getWebMockObjectFactory

protected WebMockObjectFactory getWebMockObjectFactory()
Gets the current WebMockObjectFactory.

Returns:
the WebMockObjectFactory

setWebMockObjectFactory

protected void setWebMockObjectFactory(WebMockObjectFactory mockFactory)
Sets the current WebMockObjectFactory.

Parameters:
mockFactory - the WebMockObjectFactory

createActionMockObjectFactory

protected ActionMockObjectFactory createActionMockObjectFactory()
Creates a ActionMockObjectFactory.

Returns:
the created ActionMockObjectFactory

createActionMockObjectFactory

protected ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory)
Same as createActionMockObjectFactory(otherFactory, true)


createActionMockObjectFactory

protected ActionMockObjectFactory createActionMockObjectFactory(WebMockObjectFactory otherFactory,
                                                                boolean createNewSession)
Creates a ActionMockObjectFactory based on another WebMockObjectFactory.

Parameters:
otherFactory - the other factory
createNewSession - create a new session for the new factory
Returns:
the created ActionMockObjectFactory
See Also:
createWebMockObjectFactory(WebMockObjectFactory, boolean)

getActionMockObjectFactory

protected ActionMockObjectFactory getActionMockObjectFactory()
Gets the current ActionMockObjectFactory.

Returns:
the ActionMockObjectFactory

setActionMockObjectFactory

protected void setActionMockObjectFactory(ActionMockObjectFactory mockFactory)
Sets the current ActionMockObjectFactory.

Parameters:
mockFactory - the ActionMockObjectFactory

createJDBCMockObjectFactory

protected JDBCMockObjectFactory createJDBCMockObjectFactory()
Creates a JDBCMockObjectFactory.

Returns:
the created JDBCMockObjectFactory

getJDBCMockObjectFactory

protected JDBCMockObjectFactory getJDBCMockObjectFactory()
Gets the current JDBCMockObjectFactory.

Returns:
the JDBCMockObjectFactory

setJDBCMockObjectFactory

protected void setJDBCMockObjectFactory(JDBCMockObjectFactory mockFactory)
Sets the current JDBCMockObjectFactory.

Parameters:
mockFactory - the JDBCMockObjectFactory

createEJBMockObjectFactory

protected EJBMockObjectFactory createEJBMockObjectFactory()
Creates a EJBMockObjectFactory.

Returns:
the created EJBMockObjectFactory

getEJBMockObjectFactory

protected EJBMockObjectFactory getEJBMockObjectFactory()
Gets the current EJBMockObjectFactory.

Returns:
the EJBMockObjectFactory

setEJBMockObjectFactory

protected void setEJBMockObjectFactory(EJBMockObjectFactory mockFactory)
Sets the current EJBMockObjectFactory.

Parameters:
mockFactory - the EJBMockObjectFactory

createConnectorMockObjectFactory

protected ConnectorMockObjectFactory createConnectorMockObjectFactory()
Creates a ConnectorMockObjectFactory.

Returns:
the created ConnectorMockObjectFactory

getConnectorMockObjectFactory

protected ConnectorMockObjectFactory getConnectorMockObjectFactory()
Gets the current ConnectorMockObjectFactory.

Returns:
the ConnectorMockObjectFactory

setConnectorMockObjectFactory

protected void setConnectorMockObjectFactory(ConnectorMockObjectFactory mockFactory)
Sets the current ConnectorMockObjectFactory.

Parameters:
mockFactory - the ConnectorMockObjectFactory

createJMSMockObjectFactory

protected JMSMockObjectFactory createJMSMockObjectFactory()
Creates a JMSMockObjectFactory.

Returns:
the created JMSMockObjectFactory

getJMSMockObjectFactory

protected JMSMockObjectFactory getJMSMockObjectFactory()
Gets the current JMSMockObjectFactory.

Returns:
the JMSMockObjectFactory

setJMSMockObjectFactory

protected void setJMSMockObjectFactory(JMSMockObjectFactory mockFactory)
Sets the current JMSMockObjectFactory.

Parameters:
mockFactory - the JMSMockObjectFactory

createActionTestModule

protected ActionTestModule createActionTestModule(ActionMockObjectFactory mockFactory)
Creates an ActionTestModule with the specified WebMockObjectFactory.

Parameters:
mockFactory - the ActionMockObjectFactory
Returns:
the created ActionTestModule

createActionTestModule

protected ActionTestModule createActionTestModule()
Creates an ActionTestModule based on the current WebMockObjectFactory. Same as createActionTestModule(getActionMockObjectFactory()).

Returns:
the created ActionTestModule

createTagTestModule

protected TagTestModule createTagTestModule(WebMockObjectFactory mockFactory)
Creates a TagTestModule with the specified WebMockObjectFactory.

Returns:
the created TagTestModule

createTagTestModule

protected TagTestModule createTagTestModule()
Creates a TagTestModule based on the current WebMockObjectFactory. Same as createTagTestModule(getWebMockObjectFactory()).

Returns:
the created TagTestModule

createServletTestModule

protected ServletTestModule createServletTestModule(WebMockObjectFactory mockFactory)
Creates a ServletTestModule with the specified WebMockObjectFactory.

Returns:
the created ServletTestModule

createServletTestModule

protected ServletTestModule createServletTestModule()
Creates a ServletTestModule based on the current WebMockObjectFactory. Same as createServletTestModule(getWebMockObjectFactory()).

Returns:
the created ServletTestModule

createJDBCTestModule

protected JDBCTestModule createJDBCTestModule(JDBCMockObjectFactory mockFactory)
Creates a JDBCTestModule with the specified JDBCMockObjectFactory.

Returns:
the created JDBCTestModule

createJDBCTestModule

protected JDBCTestModule createJDBCTestModule()
Creates a JDBCTestModule based on the current JDBCMockObjectFactory. Same as createJDBCTestModule(getJDBCMockObjectFactory()).

Returns:
the created JDBCTestModule

createEJBTestModule

protected EJBTestModule createEJBTestModule(EJBMockObjectFactory mockFactory)
Creates an EJBTestModule with the specified EJBMockObjectFactory.

Returns:
the created EJBTestModule

createEJBTestModule

protected EJBTestModule createEJBTestModule()
Creates an EJBTestModule based on the current EJBMockObjectFactory. Same as createEJBTestModule(getEJBMockObjectFactory()).

Returns:
the created EJBTestModule

createConnectorTestModule

protected ConnectorTestModule createConnectorTestModule(ConnectorMockObjectFactory mockFactory)
Creates an ConnectorTestModule with the specified ConnectorMockObjectFactory.

Returns:
the created ConnectorTestModule

createConnectorTestModule

protected ConnectorTestModule createConnectorTestModule()
Creates an ConnectorTestModule based on the current ConnectorMockObjectFactory. Same as createConnectorTestModule(getConnectorMockConnectionFactory()).

Returns:
the created ConnectorTestModule

createJMSTestModule

protected JMSTestModule createJMSTestModule(JMSMockObjectFactory mockFactory)
Creates a JMSTestModule with the specified JMSMockObjectFactory.

Returns:
the created JMSTestModule

createJMSTestModule

protected JMSTestModule createJMSTestModule()
Creates a JMSTestModule based on the current JMSMockObjectFactory. Same as createJMSTestModule(getJMSMockObjectFactory()).

Returns:
the created JMSTestModule