@Test(expected = IllegalArgumentException.class) public void initExceptionNoActorPairs() { new ActorPairSuite().run(); }
public void run() { if (pairs.isEmpty()) { throw new IllegalArgumentException("add actor pairs"); } if (maxParallel < 1) { throw new IllegalArgumentException("maxParallel: " + maxParallel); } if (maxParallel > pairs.size()) { maxParallel = pairs.size(); } finishTime = runMillis == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + runMillis; for (ActorPair p : pairs) { pairRunners.add(new OneShotPairRunner<Object>(p)); } for (int i = 0; i < maxParallel; i++) { executor.execute(new Runnable() { @Override public void run() { runLoop(); } }); } try { finishLatch.await(); } catch (InterruptedException ignore) { } checkForExceptions(); }
ActorPairSuite { public void run() { if (pairs.isEmpty()) { throw new IllegalArgumentException("add actor pairs"); } if (maxParallel < 1) { throw new IllegalArgumentException("maxParallel: " + maxParallel); } if (maxParallel > pairs.size()) { maxParallel = pairs.size(); } finishTime = runMillis == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + runMillis; for (ActorPair p : pairs) { pairRunners.add(new OneShotPairRunner<Object>(p)); } for (int i = 0; i < maxParallel; i++) { executor.execute(new Runnable() { @Override public void run() { runLoop(); } }); } try { finishLatch.await(); } catch (InterruptedException ignore) { } checkForExceptions(); } }
ActorPairSuite { public void run() { if (pairs.isEmpty()) { throw new IllegalArgumentException("add actor pairs"); } if (maxParallel < 1) { throw new IllegalArgumentException("maxParallel: " + maxParallel); } if (maxParallel > pairs.size()) { maxParallel = pairs.size(); } finishTime = runMillis == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + runMillis; for (ActorPair p : pairs) { pairRunners.add(new OneShotPairRunner<Object>(p)); } for (int i = 0; i < maxParallel; i++) { executor.execute(new Runnable() { @Override public void run() { runLoop(); } }); } try { finishLatch.await(); } catch (InterruptedException ignore) { } checkForExceptions(); }  }
ActorPairSuite { public void run() { if (pairs.isEmpty()) { throw new IllegalArgumentException("add actor pairs"); } if (maxParallel < 1) { throw new IllegalArgumentException("maxParallel: " + maxParallel); } if (maxParallel > pairs.size()) { maxParallel = pairs.size(); } finishTime = runMillis == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + runMillis; for (ActorPair p : pairs) { pairRunners.add(new OneShotPairRunner<Object>(p)); } for (int i = 0; i < maxParallel; i++) { executor.execute(new Runnable() { @Override public void run() { runLoop(); } }); } try { finishLatch.await(); } catch (InterruptedException ignore) { } checkForExceptions(); }  ActorPairSuite runMillis(long v); ActorPairSuite maxParallel(int v); ActorPairSuite stopAtFirstException(boolean v); ActorPairSuite addPair(ActorPair<?>... ps); ActorPairSuite executor(Executor v); void run(); }
ActorPairSuite { public void run() { if (pairs.isEmpty()) { throw new IllegalArgumentException("add actor pairs"); } if (maxParallel < 1) { throw new IllegalArgumentException("maxParallel: " + maxParallel); } if (maxParallel > pairs.size()) { maxParallel = pairs.size(); } finishTime = runMillis == Long.MAX_VALUE ? Long.MAX_VALUE : System.currentTimeMillis() + runMillis; for (ActorPair p : pairs) { pairRunners.add(new OneShotPairRunner<Object>(p)); } for (int i = 0; i < maxParallel; i++) { executor.execute(new Runnable() { @Override public void run() { runLoop(); } }); } try { finishLatch.await(); } catch (InterruptedException ignore) { } checkForExceptions(); }  ActorPairSuite runMillis(long v); ActorPairSuite maxParallel(int v); ActorPairSuite stopAtFirstException(boolean v); ActorPairSuite addPair(ActorPair<?>... ps); ActorPairSuite executor(Executor v); void run();  }