未验证 提交 bfa3a36c 编写于 作者: K khadgarmage 提交者: GitHub

unit test graph (#1479)

上级 6ec5f2e3
......@@ -125,6 +125,10 @@ public class DAGTest {
assertTrue(graph.containsEdge(1, 2));
assertEquals(graph.getEdgesCount(), 1);
int node = 3;
graph.addNode(node, "v(3)");
assertFalse(graph.addEdge(node, node));
}
......@@ -347,4 +351,14 @@ public class DAGTest {
}
@Test
public void testTopologicalSort4() {
clear();
try {
graph.topologicalSort();
} catch (Exception e) {
assertTrue(e.getMessage().contains("serious error: graph has cycle"));
}
}
}
......@@ -612,6 +612,7 @@
<version>${maven-surefire-plugin.version}</version>
<configuration>
<includes>
<include>**/common/graph/*.java</include>
<include>**/*CollectionUtilsTest.java</include><!--run test classes-->
</includes>
<!-- <skip>true</skip> -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册