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 Details

    • STRING_WILDCARD

      public static final String STRING_WILDCARD
      Wildcard used for string comparisons
      See Also:
    • 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