|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTestCase
com.savarese.algorithms.graph.GraphTestCase<V,E>
public abstract class GraphTestCase<V,E extends com.savarese.algorithms.graph.Edge<V,?>>
GraphTest tests implementations of the Graph interface.
Field Summary | |
---|---|
protected com.savarese.algorithms.graph.Graph<V,E> |
_graph_
A Graph fixture initalized in setUp() by calling
_newGraphFixture_() . |
Constructor Summary | |
---|---|
GraphTestCase()
|
Method Summary | |
---|---|
protected abstract com.savarese.algorithms.graph.Graph<V,E> |
_newGraphFixture_()
Creates a new Graph instance for testing. |
protected abstract E[] |
_populateGraph_()
Adds a set of test edges to the _graph_ fixture. |
protected void |
setUp()
Instantiates _graph_ to use as a fixture for tests. |
protected void |
tearDown()
Clears the Graph fixture, removing all its contents so that a subsequent test will not be affected by the previous one. |
void |
testAdd()
Tests the add method by adding a set of edges to the graph fixture and seeing if they are contained in the edge set and if their vertices are contained in the vertex set. |
void |
testClear()
Tests the clear method by adding a set of edges to the graph fixture and clearing it, seeing if the size is zero. |
void |
testEdgeSet()
Tests that edgeSet retuns null and non-null values in appropriate cases. |
void |
testSize()
Tests the size method by adding a set of edges to the graph fixture and seeing if the size matches the number of edges added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.savarese.algorithms.graph.Graph<V,E extends com.savarese.algorithms.graph.Edge<V,?>> _graph_
setUp()
by calling
_newGraphFixture_()
.
Constructor Detail |
---|
public GraphTestCase()
Method Detail |
---|
protected abstract com.savarese.algorithms.graph.Graph<V,E> _newGraphFixture_()
protected abstract E[] _populateGraph_()
_graph_
fixture.
protected void setUp()
_graph_
to use as a fixture for tests.
protected void tearDown()
public void testAdd()
public void testSize()
public void testClear()
public void testEdgeSet()
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |