Skip to content
Snippets Groups Projects
Commit 8cd786fe authored by jakubs's avatar jakubs
Browse files

SSDM-3201 add test for NPE

SVN: 35690
parent 5e6539bf
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@ import java.util.Map;
import org.testng.AssertJUnit;
import org.testng.annotations.Test;
import ch.systemsx.cisd.common.collection.GroupingDAG;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
/**
......@@ -62,7 +61,6 @@ public class GroupingDAGTest extends AssertJUnit
adjacencyMap.put(childCode, Arrays.asList("CHAIN_" + (i - 1)));
}
List<List<String>> groups = sortTopologically(adjacencyMap);
assertAllEntitiesPresent(adjacencyMap.keySet(), groups);
......@@ -81,6 +79,24 @@ public class GroupingDAGTest extends AssertJUnit
}
}
@Test
public void testIndependentWithOneExtraPair()
{
HashMap<String, Collection<String>> adjacencyMap =
new HashMap<String, Collection<String>>();
adjacencyMap.put("A", new ArrayList<String>());
adjacencyMap.put("B", Arrays.asList("A"));
adjacencyMap.put("C", Arrays.asList("A", "B"));
adjacencyMap.put("D", Arrays.asList("C", "B", "A"));
adjacencyMap.put("E", Arrays.asList("C", "D"));
adjacencyMap.put("X", Arrays.asList("Z"));
List<List<String>> groups = sortTopologically(adjacencyMap);
assertEquals("[[E, X], [D, Z], [C], [B], [A]]", groups.toString());
}
@Test
public void testIndependent()
{
......
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