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
TheClientSoapStubprovides the common functionality for all mock SOAP stubs.
-
-
Field Summary
Fields Modifier and Type Field Description static DateDATE_WILDCARDWildcard used for Date comparisonsstatic com.vasoftware.sf.server.types.GuidKeyGUIDKEY_WILDCARDWildcard used for Guid key comparisonsstatic IntegerINTEGER_WILDCARDWildcard used for integer comparisonsstatic LongLONG_WILDCARDWildcard used for long comparisonsstatic StringSTRING_WILDCARDWildcard 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddSimulatedResult(String methodName, Object[] parameters, boolean result)Add an expected boolean result for a methodprotected voidaddSimulatedResult(String methodName, Object[] parameters, long result)Add an expected long result for a methodprotected voidaddSimulatedResult(String methodName, Object[] parameters, Object result)Add an expected object result for a methodprotected intgetCallCount(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 numberMapgetUnusedCalls()Get a mapping of method names to the unused calls that were prepared for that method.protected ObjectsimulateCall(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 Detail
-
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 Detail
-
ClientSoapMockStub
public ClientSoapMockStub(String soapServerUrl)
Constructor for the mock stub class.- Parameters:
soapServerUrl- SOAP server URL.
-
-
Method Detail
-
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 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
protected void addSimulatedResult(String methodName, Object[] parameters, boolean result)
Add an expected boolean result for a method- Parameters:
methodName- the method nameparameters- the call parametersresult- 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 nameparameters- the call parametersresult- 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 nameparameters- the call parametersresult- an object value
-
getUnusedCalls
public Map 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
-
-