@Test public void testSetConfiguration() throws ConfigurationException { delay.setConfiguration(cfg); verify(cfg, atLeastOnce()).getLong("prepare-delay"); verify(cfg, atLeastOnce()).getLong("commit-delay"); verify(cfg, atLeastOnce()).getLong("abort-delay"); verify(cfg, atLeastOnce()).getBoolean("random"); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; }
Delay implements TransactionParticipant, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; } }
Delay implements TransactionParticipant, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; }  }
Delay implements TransactionParticipant, Configurable { public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; }  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 { public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; }  int prepare(long id, Serializable context); void commit(long id, Serializable context); void abort(long id, Serializable context); void setConfiguration(Configuration cfg);  }