@Test public void lateProgressCallback() throws Exception { InboundMessageQueuer[] channels = { connectPeer(1), connectPeer(2), connectPeer(3), connectPeer(4) }; Transaction tx = FakeTxBuilder.createFakeTx(UNITTEST, CENT, address); tx.getConfidence().setSource(TransactionConfidence.Source.SELF); TransactionBroadcast broadcast = peerGroup.broadcastTransaction(tx); inbound(channels[1], InventoryMessage.with(tx)); pingAndWait(channels[1]); final AtomicDouble p = new AtomicDouble(); broadcast.setProgressCallback(new TransactionBroadcast.ProgressCallback() { @Override public void onBroadcastProgress(double progress) { p.set(progress); } }, Threading.SAME_THREAD); assertEquals(1.0, p.get(), 0.01); }
public void setProgressCallback(ProgressCallback callback) { setProgressCallback(callback, Threading.USER_THREAD); }
TransactionBroadcast { public void setProgressCallback(ProgressCallback callback) { setProgressCallback(callback, Threading.USER_THREAD); } }
TransactionBroadcast { public void setProgressCallback(ProgressCallback callback) { setProgressCallback(callback, Threading.USER_THREAD); } TransactionBroadcast(PeerGroup peerGroup, Transaction tx); private  TransactionBroadcast(Transaction tx); }
TransactionBroadcast { public void setProgressCallback(ProgressCallback callback) { setProgressCallback(callback, Threading.USER_THREAD); } TransactionBroadcast(PeerGroup peerGroup, Transaction tx); private  TransactionBroadcast(Transaction tx); @VisibleForTesting static TransactionBroadcast createMockBroadcast(Transaction tx, final SettableFuture<Transaction> future); ListenableFuture<Transaction> future(); void setMinConnections(int minConnections); void setDropPeersAfterBroadcast(boolean dropPeersAfterBroadcast); ListenableFuture<Transaction> broadcast(); void setProgressCallback(ProgressCallback callback); void setProgressCallback(ProgressCallback callback, @Nullable Executor executor); }
TransactionBroadcast { public void setProgressCallback(ProgressCallback callback) { setProgressCallback(callback, Threading.USER_THREAD); } TransactionBroadcast(PeerGroup peerGroup, Transaction tx); private  TransactionBroadcast(Transaction tx); @VisibleForTesting static TransactionBroadcast createMockBroadcast(Transaction tx, final SettableFuture<Transaction> future); ListenableFuture<Transaction> future(); void setMinConnections(int minConnections); void setDropPeersAfterBroadcast(boolean dropPeersAfterBroadcast); ListenableFuture<Transaction> broadcast(); void setProgressCallback(ProgressCallback callback); void setProgressCallback(ProgressCallback callback, @Nullable Executor executor); @VisibleForTesting
    static Random random; }