Package org.knowm.xchange.simulated
Class RandomExceptionThrower
java.lang.Object
org.knowm.xchange.simulated.RandomExceptionThrower
- All Implemented Interfaces:
SimulatedExchangeOperationListener
This will cause
SimulatedExchange
to fail 0.5% of the time with a selection of commnplace
transient issues which could happen at any time in real life and should therefore be handled
gracefully in client code. Pass this to ExchangeSpecification.getExchangeSpecificParametersItem(String)
using the parameter name SimulatedExchange.ON_OPERATION_PARAM
during long-running integration testing to inject an
appropriate bit of chaos into proceedings.- Author:
- Graham Crockford
-
Constructor Summary
ConstructorDescriptionUses a random seed derived from the system clock.RandomExceptionThrower
(long seed) Uses a specified random seed -
Method Summary
-
Constructor Details
-
RandomExceptionThrower
public RandomExceptionThrower()Uses a random seed derived from the system clock. -
RandomExceptionThrower
public RandomExceptionThrower(long seed) Uses a specified random seed- Parameters:
seed
- the random seed.
-
-
Method Details
-
onSimulatedExchangeOperation
Description copied from interface:SimulatedExchangeOperationListener
Called every time- Specified by:
onSimulatedExchangeOperation
in interfaceSimulatedExchangeOperationListener
- Throws:
IOException
-