Skip to content
Snippets Groups Projects
Commit 51c0b351 authored by brinn's avatar brinn
Browse files

Add a new test for a chain of dependencies.

SVN: 27103
parent ab82d9b6
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,28 @@ public class GroupingDAGTest extends AssertJUnit
assertEquals("[[I, P1, P2], [A1, A2, A3]]", groups.toString());
}
@Test
public void testWithParentofParent()
{
HashMap<String, Collection<String>> adjacencyMap =
new HashMap<String, Collection<String>>();
adjacencyMap.put("P", Arrays.asList("A"));
adjacencyMap.put("A", Arrays.asList("B"));
adjacencyMap.put("B", new ArrayList<String>());
List<List<String>> groups = sortTopologically(adjacencyMap);
assertAllEntitiesPresent(adjacencyMap.keySet(), groups);
for (List<String> list : groups)
{
Collections.sort(list);
}
assertEquals("[[P], [A], [B]]", groups.toString());
}
@Test
public void testEmpty()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment