@Test public void test() throws InterruptedException, Exception { final ArrayList<String> completionOrder = new ArrayList<String>(); DependencyGraph<String> graph = new DependencyGraph<String>(); graph.addDependency("@0", "A8"); graph.addDependency("@1", "A1"); graph.addDependency("@2", "A7"); graph.addDependency("@3", "A2"); graph.addDependency("@4", "A3"); graph.addDependency("@5", "A3"); graph.addDependency("@6", "A4"); graph.addDependency("@7", "A4"); graph.addDependency("@A", "A5"); graph.addDependency("@B", "A5"); graph.addDependency("@C", "A6"); graph.addDependency("@D", "A6"); graph.addDependency("@E", "A7"); graph.addDependency("@F", "A2"); graph.addDependency("@G", "A8"); graph.addDependency("@H", "A1"); graph.addDependency("A1", "B4"); graph.addDependency("A2", "B1"); graph.addDependency("A3", "B2"); graph.addDependency("A4", "B2"); graph.addDependency("A5", "B3"); graph.addDependency("A6", "B3"); graph.addDependency("A7", "B4"); graph.addDependency("A8", "B1"); graph.addDependency("B1", "C2"); graph.addDependency("B2", "C1"); graph.addDependency("B3", "C2"); graph.addDependency("B4", "C1"); graph.addDependency("C1", "D1"); graph.addDependency("C2", "D1"); assertTrue(!graph.hasCycles()); DependencyGraph<String> savedGraph = graph.copy(); GThreadPool pool = GThreadPool.getPrivateThreadPool("ConcurrentGraphQ Test"); QRunnable<String> runnable = new QRunnable<String>() { @Override public void run(String item, TaskMonitor monitor) throws Exception { synchronized (completionOrder) { completionOrder.add(item); } } }; ConcurrentGraphQ<String> queue = new ConcurrentGraphQ<String>(runnable, graph, pool, null); queue.execute(); checkOrderSatisfiesDependencies(savedGraph, completionOrder); }
public void execute() throws InterruptedException, Exception { Set<I> values = graph.getUnvisitedIndependentValues(); queue.add(values); queue.waitUntilDone(); }
ConcurrentGraphQ { public void execute() throws InterruptedException, Exception { Set<I> values = graph.getUnvisitedIndependentValues(); queue.add(values); queue.waitUntilDone(); } }
ConcurrentGraphQ { public void execute() throws InterruptedException, Exception { Set<I> values = graph.getUnvisitedIndependentValues(); queue.add(values); queue.waitUntilDone(); } ConcurrentGraphQ(QRunnable<I> runnable, DependencyGraph<I> graph, GThreadPool pool,
			TaskMonitor monitor); }
ConcurrentGraphQ { public void execute() throws InterruptedException, Exception { Set<I> values = graph.getUnvisitedIndependentValues(); queue.add(values); queue.waitUntilDone(); } ConcurrentGraphQ(QRunnable<I> runnable, DependencyGraph<I> graph, GThreadPool pool,
			TaskMonitor monitor); void execute(); void dispose(); }
ConcurrentGraphQ { public void execute() throws InterruptedException, Exception { Set<I> values = graph.getUnvisitedIndependentValues(); queue.add(values); queue.waitUntilDone(); } ConcurrentGraphQ(QRunnable<I> runnable, DependencyGraph<I> graph, GThreadPool pool,
			TaskMonitor monitor); void execute(); void dispose();  }