public class MockProtocolFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static <any> |
CREATOR |
MockProtocol |
mockProtocol |
Constructor and Description |
---|
MockProtocolFactory() |
Modifier and Type | Method and Description |
---|---|
MockProtocol |
create(android.content.Context context) |
int |
describeContents() |
static MockProtocol |
fromJson(org.json.JSONObject json) |
HostProtocol |
getType() |
void |
init() |
static ProtocolFactory |
willFailConnect()
willFailConnect with default parameters
|
static ProtocolFactory |
willFailConnect(long delayInMs) |
static ProtocolFactory |
willFailConnect(long delayInMs,
java.lang.Exception errorThrown)
Create a mock protocol that will fail connection in delayInMs and throw errorThrow
|
static ProtocolFactory |
willSucceed() |
static ProtocolFactory |
willSucceed(long delayInMs) |
void |
writeToParcel(android.os.Parcel parcel,
int i) |
public MockProtocol mockProtocol
public static final <any> CREATOR
public void init()
public MockProtocol create(android.content.Context context) throws java.lang.Exception
java.lang.Exception
public static MockProtocol fromJson(org.json.JSONObject json)
public HostProtocol getType()
public int describeContents()
public void writeToParcel(android.os.Parcel parcel, int i)
public static ProtocolFactory willFailConnect()
public static ProtocolFactory willFailConnect(long delayInMs)
delayInMs
- delay in milliseconds before error is thrownpublic static ProtocolFactory willFailConnect(long delayInMs, java.lang.Exception errorThrown)
delayInMs
- delay in milliseconds before error is thrownerrorThrown
- error to be thrownpublic static ProtocolFactory willSucceed()
public static ProtocolFactory willSucceed(long delayInMs)