@Test public void testComputeDelay() { delay.sleep(5L); verify(random, atLeastOnce()).nextDouble(); }
void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } }
Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } } }
Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } }  }
Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } }  int prepare(long id, Serializable context); void commit(long id, Serializable context); void abort(long id, Serializable context); void setConfiguration(Configuration cfg); }
Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } }  int prepare(long id, Serializable context); void commit(long id, Serializable context); void abort(long id, Serializable context); void setConfiguration(Configuration cfg);  }