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
The
ClientSoapStub
provides the common functionality for
all mock SOAP stubs.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Date
Wildcard used for Date comparisonsstatic final com.vasoftware.sf.server.types.GuidKey
Wildcard used for Guid key comparisonsstatic final Integer
Wildcard used for integer comparisonsstatic final Long
Wildcard used for long comparisonsstatic final String
Wildcard used for string comparisonsFields inherited from class com.collabnet.ce.soap60.webservices.ClientSoapStub
DEFAULT_CLIENT_TIME_OUT
-
Constructor Summary
ConstructorsConstructorDescriptionClientSoapMockStub
(String soapServerUrl) Constructor for the mock stub class. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addSimulatedResult
(String methodName, Object[] parameters, boolean result) Add an expected boolean result for a methodprotected void
addSimulatedResult
(String methodName, Object[] parameters, long result) Add an expected long result for a methodprotected void
addSimulatedResult
(String methodName, Object[] parameters, Object result) Add an expected object result for a methodprotected 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 numberGet 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
-
Field Details
-
STRING_WILDCARD
Wildcard used for string comparisons- See Also:
-
INTEGER_WILDCARD
Wildcard used for integer comparisons -
LONG_WILDCARD
Wildcard used for long comparisons -
DATE_WILDCARD
Wildcard used for Date comparisons -
GUIDKEY_WILDCARD
public static final com.vasoftware.sf.server.types.GuidKey GUIDKEY_WILDCARDWildcard used for Guid key comparisons
-
-
Constructor Details
-
ClientSoapMockStub
Constructor for the mock stub class.- Parameters:
soapServerUrl
- SOAP server URL.
-
-
Method Details
-
getCallCount
How many calls were made to a given method?- Parameters:
methodName
- the name of the method- Returns:
- the number of calls
-
getCallParameters
Return the parameters that the given method was called with on the given call number- Parameters:
methodName
- the method namecallNumber
- 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 nameparameters
- 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
Add an expected boolean result for a method- Parameters:
methodName
- the method nameparameters
- the call parametersresult
- a boolean value
-
addSimulatedResult
Add an expected long result for a method- Parameters:
methodName
- the method nameparameters
- the call parametersresult
- a long value
-
addSimulatedResult
Add an expected object result for a method- Parameters:
methodName
- the method nameparameters
- the call parametersresult
- 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
-