OperationRegistry { public synchronized List<MasterOperation> getRunningOperations() { List<MasterOperation> operations = new ArrayList<MasterOperation>(); for (Iterator<OperationWatchdog> iterator = _watchdogs.iterator(); iterator.hasNext();) { OperationWatchdog watchdog = iterator.next(); if (watchdog.isDone()) { iterator.remove(); } else { operations.add(watchdog.getOperation()); } } return operations; } OperationRegistry(MasterContext context); synchronized void watchFor(OperationWatchdog watchdog); synchronized List<MasterOperation> getRunningOperations(); synchronized void shutdown();  }
@Test(timeout = 10000) public void testGetRunningOperations() throws Exception { Mocks.publisNodes(_protocol, _nodes); beginMasterOperation(_nodes, _masterOperation); assertEquals(1, _registry.getRunningOperations().size()); _registry.shutdown(); }