@Override protected SyncFuture initialValue() { return new SyncFuture(); } };
@Test(expected = TimeoutIOException.class) public void testGet() throws Exception { long timeout = 5000; long txid = 100000; SyncFuture syncFulture = new SyncFuture().reset(txid); syncFulture.done(txid, null); assertEquals(txid, syncFulture.get(timeout)); syncFulture.reset(txid).get(timeout); } }
private SyncFuture getSyncFuture(final long sequence, Span span) { SyncFuture syncFuture = this.syncFuturesByHandler.get(Thread.currentThread()); if (syncFuture == null) { syncFuture = new SyncFuture(); this.syncFuturesByHandler.put(Thread.currentThread(), syncFuture); } return syncFuture.reset(sequence, span); }
@Test(expected = TimeoutIOException.class) public void testGet() throws Exception { long timeout = 5000; long txid = 100000; SyncFuture syncFulture = new SyncFuture().reset(txid); syncFulture.done(txid, null); assertEquals(txid, syncFulture.get(timeout)); syncFulture.reset(txid).get(timeout); } }