| org.geotools.graph.traverse.standard.DijkstraIteratorTest
DijkstraIteratorTest | public class DijkstraIteratorTest extends TestCase (Code) | | |
Method Summary | |
protected GraphBuilder | builder() | protected GraphBuilder | createBuilder() | protected DijkstraIterator | createIterator() | protected void | setUp() | public void | test_0() Create a graph with no bifurcations and start a full traversal from start
node. | public void | test_1() Create a graph with no bifurcations and start a traversal from start
node, then suspend, and resume. | public void | test_2() Create a graph with no bifurcations and start a traversal from start
node, then kill branch, and resume. | public void | test_3() Create a balanced binary tree and do a normal traversal starting at root. | public void | test_4() Create a balanced binary tree and do a normal traversal starting at root
and then suspend at right right child of root, then resume
Expected: After suspend:
1. | public void | test_5() Create a balanced binary tree and do a normal traversal starting at root
and then kill at right right child of root, then resume
Expected: 1. | public void | test_6() Create a circular graph and perform a full traversal. |
DijkstraIteratorTest | public DijkstraIteratorTest(String name)(Code) | | |
test_0 | public void test_0()(Code) | | Create a graph with no bifurcations and start a full traversal from start
node.
Expected: 1. Every node should be visited in order.
2. Every node should have a cost associated with == id
3. Every node should havea parent with id node id + 1
|
test_1 | public void test_1()(Code) | | Create a graph with no bifurcations and start a traversal from start
node, then suspend, and resume.
Expected: After supsend:
1. Nodes from 0 to suspend node should be visted, others not.
After resume:
1. Next node visited should have id suspend node id + 1
2. Every node should have a cost associated with it == id
3. Every node should have a parent with id node id + 1
|
test_2 | public void test_2()(Code) | | Create a graph with no bifurcations and start a traversal from start
node, then kill branch, and resume.
Expected: After kill branch:
1. Traversal ends
After resume:
2. No more nodes visited.
|
test_3 | public void test_3()(Code) | | Create a balanced binary tree and do a normal traversal starting at root.
Expected: 1. Every node should be visited.
2. The dijsktra parent of each node should be the same as
the parent of the tree.
3. The cost of each node should be equal to its depth.
|
test_4 | public void test_4()(Code) | | Create a balanced binary tree and do a normal traversal starting at root
and then suspend at right right child of root, then resume
Expected: After suspend:
1. Not every node should be visited
After resume:
1. Every node should be visited.
|
test_5 | public void test_5()(Code) | | Create a balanced binary tree and do a normal traversal starting at root
and then kill at right right child of root, then resume
Expected: 1. Every node in left subtree should be visited
2. Every node in right substree (minus right child of root)
should not be visited
|
test_6 | public void test_6()(Code) | | Create a circular graph and perform a full traversal.
Expected : 1. For nodes with id < (total # of nodes) / 2:
a. parent should be node with id - 1
b. cost == id
2. For nodes with id > (total # of nodes) / 2;
a. parent should be node with id + 1
b. cost == total # of nodes - id
|
|
|