Package org.astrogrid.samp.test
Class TestXmlrpcClient
- java.lang.Object
-
- org.astrogrid.samp.xmlrpc.internal.InternalClient
-
- org.astrogrid.samp.test.TestXmlrpcClient
-
- All Implemented Interfaces:
SampXmlRpcClient
class TestXmlrpcClient extends InternalClient
SampXmlrpcClient implementation for testing success or failure of XML-RPC method invocations. Note the return value of theInternalClient.callAndWait(java.lang.String, java.util.List)method is eitherSUCCESSorFAILURE, rather than the actual result of the call. Methods may throwTestExceptions to indicate assertion failures.- Since:
- 28 Aug 2009
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description TestXmlrpcClient(java.net.URL endpoint)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckFailureCall(java.lang.String method, java.util.List params)Makes a call, and asserts that the result is an XML-RPC fault.voidcheckSuccessCall(java.lang.String method, java.util.List params)Makes a call, and asserts that the result is a normal XML-RPC response.protected java.lang.ObjectdeserializeResponse(java.io.InputStream in)-
Methods inherited from class org.astrogrid.samp.xmlrpc.internal.InternalClient
callAndForget, callAndWait, serializeCall
-
-
-
-
Method Detail
-
deserializeResponse
protected java.lang.Object deserializeResponse(java.io.InputStream in) throws java.io.IOException- Overrides:
deserializeResponsein classInternalClient- Parameters:
in- input stream containing response document- Throws:
java.io.IOException
-
checkSuccessCall
public void checkSuccessCall(java.lang.String method, java.util.List params) throws java.io.IOExceptionMakes a call, and asserts that the result is a normal XML-RPC response.- Parameters:
method- XML-RPC method nameparams- parameters for XML-RPC call (SAMP-compatible)- Throws:
TestException- if the response is not a successjava.io.IOException
-
checkFailureCall
public void checkFailureCall(java.lang.String method, java.util.List params) throws java.io.IOExceptionMakes a call, and asserts that the result is an XML-RPC fault.- Parameters:
method- XML-RPC method nameparams- parameters for XML-RPC call (SAMP-compatible)- Throws:
TestException- if the response is not a faultjava.io.IOException
-
-