@Test public void givenUnfinishedProgress_allTransactionsRemainInWindow() { t1.setSize(100); t1.setTransferred(0); t2.setSize(100); t2.setTransferred(0); group.add(t1); group.add(t2); t1.setTransferred(100); t1.toState(FINISHED); assertEquals(0.5, group.getProgress(), 0.001); }
@Override public void add(Transaction transaction) { if (!isDone(transaction)) { transaction.onProgress(() -> { if (isDone(transaction)) { runningTransactions.remove(transaction); } if (runningTransactions.isEmpty()) { clear(); } }); super.add(transaction); runningTransactions.add(transaction); } }
WindowedTransactionGroup extends TransactionGroup { @Override public void add(Transaction transaction) { if (!isDone(transaction)) { transaction.onProgress(() -> { if (isDone(transaction)) { runningTransactions.remove(transaction); } if (runningTransactions.isEmpty()) { clear(); } }); super.add(transaction); runningTransactions.add(transaction); } } }
WindowedTransactionGroup extends TransactionGroup { @Override public void add(Transaction transaction) { if (!isDone(transaction)) { transaction.onProgress(() -> { if (isDone(transaction)) { runningTransactions.remove(transaction); } if (runningTransactions.isEmpty()) { clear(); } }); super.add(transaction); runningTransactions.add(transaction); } }  }
WindowedTransactionGroup extends TransactionGroup { @Override public void add(Transaction transaction) { if (!isDone(transaction)) { transaction.onProgress(() -> { if (isDone(transaction)) { runningTransactions.remove(transaction); } if (runningTransactions.isEmpty()) { clear(); } }); super.add(transaction); runningTransactions.add(transaction); } }  @Override void add(Transaction transaction); @Override long finishedElements(); }
WindowedTransactionGroup extends TransactionGroup { @Override public void add(Transaction transaction) { if (!isDone(transaction)) { transaction.onProgress(() -> { if (isDone(transaction)) { runningTransactions.remove(transaction); } if (runningTransactions.isEmpty()) { clear(); } }); super.add(transaction); runningTransactions.add(transaction); } }  @Override void add(Transaction transaction); @Override long finishedElements();  }