Package com.collabnet.ce.soap60.webservices

# Class ClientSoapMockStub

java.lang.Object
com.collabnet.ce.soap60.webservices.ClientSoapStub
com.collabnet.ce.soap60.webservices.ClientSoapMockStub

Direct Known Subclasses:
  `CategorizationAppSoapMockStub`, `CollabNetSoapMockStub`, `DiscussionAppSoapMockStub`, `DocumentAppSoapMockStub`, `FileStorageAppSoapMockStub`, `FrsAppSoapMockStub`, `IntegrationDataAppSoapMockStub`, `MonitoringAppSoapMockStub`, `NewsAppSoapMockStub`, `PageAppSoapMockStub`, `PlanningAppSoapMockStub`, `PluggableAppSoapMockStub`, `RbacAppSoapMockStub`, `ScmAppSoapMockStub`, `SimpleFileStorageAppSoapMockStub`, `TagAppSoapMockStub`, `TeamAppSoapMockStub`, `TrackerAppSoapMockStub`, `WikiAppSoapMockStub`

public abstract class ClientSoapMockStub extends ClientSoapStub
The `ClientSoapStub` provides the common functionality for all mock SOAP stubs.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Date`
  `DATE_WILDCARD`
  Wildcard used for Date comparisons
  `static final com.vasoftware.sf.server.types.GuidKey`
  `GUIDKEY_WILDCARD`
  Wildcard used for Guid key comparisons
  `static final Integer`
  `INTEGER_WILDCARD`
  Wildcard used for integer comparisons
  `static final Long`
  `LONG_WILDCARD`
  Wildcard used for long comparisons
  `static final String`
  `STRING_WILDCARD`
  Wildcard used for string comparisons

  ### Fields inherited from class com.collabnet.ce.soap60.webservices.ClientSoapStub

  `DEFAULT_CLIENT_TIME_OUT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClientSoapMockStub(String soapServerUrl)`
  Constructor for the mock stub class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `addSimulatedResult(String methodName, Object[] parameters, boolean result)`
  Add an expected boolean result for a method
  `protected void`
  `addSimulatedResult(String methodName, Object[] parameters, long result)`
  Add an expected long result for a method
  `protected void`
  `addSimulatedResult(String methodName, Object[] parameters, Object result)`
  Add an expected object result for a method
  `protected int`
  `getCallCount(String methodName)`
  How many calls were made to a given method?
  `protected Object[]`
  `getCallParameters(String methodName, int callNumber)`
  Return the parameters that the given method was called with on the given call number
  `Map<String,List<com.collabnet.ce.soap60.webservices.ClientSoapMockStub.SimulatedResults>>`
  `getUnusedCalls()`
  Get a mapping of method names to the unused calls that were prepared for that method.
  `protected Object`
  `simulateCall(String methodName, Object[] parameters)`
  Simulate a call to the server and return the expected result.

  ### Methods inherited from class com.collabnet.ce.soap60.webservices.ClientSoapStub

  `getServiceCall, getSoapServer, getTimeout, setTimeout, soapParam`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### STRING_WILDCARD

    public static final String STRING_WILDCARD
    Wildcard used for string comparisons
    See Also:
      - Constant Field Values

  - ### INTEGER_WILDCARD

    public static final Integer INTEGER_WILDCARD
    Wildcard used for integer comparisons

  - ### LONG_WILDCARD

    public static final Long LONG_WILDCARD
    Wildcard used for long comparisons

  - ### DATE_WILDCARD

    public static final Date DATE_WILDCARD
    Wildcard used for Date comparisons

  - ### GUIDKEY_WILDCARD

    public static final com.vasoftware.sf.server.types.GuidKey GUIDKEY_WILDCARD
    Wildcard used for Guid key comparisons

- ## Constructor Details

  - ### ClientSoapMockStub

    public ClientSoapMockStub(String soapServerUrl)
    Constructor for the mock stub class.
    Parameters:
      `soapServerUrl` - SOAP server URL.

- ## Method Details

  - ### getCallCount

    protected int getCallCount(String methodName)
    How many calls were made to a given method?
    Parameters:
      `methodName` - the name of the method
    Returns:
      the number of calls

  - ### getCallParameters

    protected Object[] getCallParameters(String methodName, int callNumber)
    Return the parameters that the given method was called with on the given call number
    Parameters:
      `methodName` - the method name
      `callNumber` - which time the method was called (1-based)
    Returns:
      the array of call parameters

  - ### simulateCall

    protected Object simulateCall(String methodName, Object[] parameters) throws RemoteException, StubNotFoundException
    Simulate a call to the server and return the expected result.
    Parameters:
      `methodName` - the method name
      `parameters` - the parameters received by this call
    Returns:
      the simulated return value
    Throws:
      `StubNotFoundException` - when the mock stub is not found for the method.
      `RemoteException`

  - ### addSimulatedResult

    protected void addSimulatedResult(String methodName, Object[] parameters, boolean result)
    Add an expected boolean result for a method
    Parameters:
      `methodName` - the method name
      `parameters` - the call parameters
      `result` - a boolean value

  - ### addSimulatedResult

    protected void addSimulatedResult(String methodName, Object[] parameters, long result)
    Add an expected long result for a method
    Parameters:
      `methodName` - the method name
      `parameters` - the call parameters
      `result` - a long value

  - ### addSimulatedResult

    protected void addSimulatedResult(String methodName, Object[] parameters, Object result)
    Add an expected object result for a method
    Parameters:
      `methodName` - the method name
      `parameters` - the call parameters
      `result` - an object value

  - ### getUnusedCalls

    public Map<String,List<com.collabnet.ce.soap60.webservices.ClientSoapMockStub.SimulatedResults>> getUnusedCalls()
    Get a mapping of method names to the unused calls that were prepared for that method.
    Returns:
      a map of method names to unused calls