Class FaultInjector

java.lang.Object
me.ahoo.cosid.store.tck.FaultInjector

public final class FaultInjector extends Object
The faults a FaultyRangeStore or FaultySlotLeaseStore applies, per operation: one-shot faults in the order they were queued, then the standing fault if any. Thread-safe.
  • Constructor Details

    • FaultInjector

      public FaultInjector()
      An injector without faults.
  • Method Details

    • once

      public FaultInjector once(FaultInjector.Operation operation, Fault fault)
      Applies fault to the next call of operation only.
      Parameters:
      operation - the operation
      fault - the fault
      Returns:
      this injector
    • always

      public FaultInjector always(FaultInjector.Operation operation, Fault fault)
      Applies fault to every call of operation until clear().
      Parameters:
      operation - the operation
      fault - the fault
      Returns:
      this injector
    • clear

      public void clear()
      Removes every fault.
    • calls

      public long calls(FaultInjector.Operation operation)
      How many calls of operation reached the wrapped store.
      Parameters:
      operation - the operation
      Returns:
      the count