Savarese Software Research

com.savarese.algorithms.graph
Class SingleSourceShortestPathFinderTestCase

java.lang.Object
  extended by TestCase
      extended by com.savarese.algorithms.graph.SingleSourceShortestPathFinderTestCase
Direct Known Subclasses:
DijkstraShortestPathFinderTest

public abstract class SingleSourceShortestPathFinderTestCase
extends TestCase

SingleSourceShortestPathFinderTestCase tests implementations of the SingleSourcePathFinder interface that find shortest paths.

Author:
Daniel F. Savarese

Nested Class Summary
static class SingleSourceShortestPathFinderTestCase.GalacticMap
          A convenience class acting as a typedef for a particular graph type used in tests.
static class SingleSourceShortestPathFinderTestCase.HyperspaceTransit
          A convenience class acting as a typedef for a particular edge type used in tests.
 
Field Summary
protected  SingleSourceShortestPathFinderTestCase.GalacticMap _map_
          The graph used for testing, initialized by _createMapFixture_().
protected  com.savarese.algorithms.graph.SingleSourcePathFinder<java.lang.String,java.lang.Integer,SingleSourceShortestPathFinderTestCase.HyperspaceTransit> _pathFinder_
          A SingleSourcePathFinder fixture initalized in setUp() by calling _newPathFinderFixture_().
static java.lang.String Alderaan
           
static java.lang.String Bespin
           
static java.lang.String Coruscant
           
static java.lang.String Dagobah
           
static java.lang.String Earth
           
static java.lang.String Hoth
           
static java.lang.String Tatooine
           
static java.lang.String Yavin
           
 
Constructor Summary
SingleSourceShortestPathFinderTestCase()
           
 
Method Summary
protected  SingleSourceShortestPathFinderTestCase.GalacticMap _createMapFixture_()
          Creates the GalacticMap used by tests.
protected abstract  com.savarese.algorithms.graph.SingleSourcePathFinder<java.lang.String,java.lang.Integer,SingleSourceShortestPathFinderTestCase.HyperspaceTransit> _newPathFinderFixture_()
          Creates a new SingleSourcePathFinder instance for testing.
protected  void setUp()
          Instantiates _pathFinder_ and _map_ to use as fixtures for tests.
protected  void tearDown()
          Clears the GalacticMap fixture, removing all its contents so that a subsequent test will not be affected by the previous one.
 void testFindPath()
          Tests the findPath method by verifying a number of shortest paths.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Coruscant

public static final java.lang.String Coruscant
See Also:
Constant Field Values

Alderaan

public static final java.lang.String Alderaan
See Also:
Constant Field Values

Tatooine

public static final java.lang.String Tatooine
See Also:
Constant Field Values

Yavin

public static final java.lang.String Yavin
See Also:
Constant Field Values

Hoth

public static final java.lang.String Hoth
See Also:
Constant Field Values

Dagobah

public static final java.lang.String Dagobah
See Also:
Constant Field Values

Bespin

public static final java.lang.String Bespin
See Also:
Constant Field Values

Earth

public static final java.lang.String Earth
See Also:
Constant Field Values

_pathFinder_

protected com.savarese.algorithms.graph.SingleSourcePathFinder<java.lang.String,java.lang.Integer,SingleSourceShortestPathFinderTestCase.HyperspaceTransit> _pathFinder_
A SingleSourcePathFinder fixture initalized in setUp() by calling _newPathFinderFixture_().


_map_

protected SingleSourceShortestPathFinderTestCase.GalacticMap _map_
The graph used for testing, initialized by _createMapFixture_().

Constructor Detail

SingleSourceShortestPathFinderTestCase

public SingleSourceShortestPathFinderTestCase()
Method Detail

_newPathFinderFixture_

protected abstract com.savarese.algorithms.graph.SingleSourcePathFinder<java.lang.String,java.lang.Integer,SingleSourceShortestPathFinderTestCase.HyperspaceTransit> _newPathFinderFixture_()
Creates a new SingleSourcePathFinder instance for testing.

Returns:
A new SingleSourcePathFinder instance for testing.

_createMapFixture_

protected SingleSourceShortestPathFinderTestCase.GalacticMap _createMapFixture_()
Creates the GalacticMap used by tests.

Returns:
A GalacticMap used by tests

setUp

protected void setUp()
Instantiates _pathFinder_ and _map_ to use as fixtures for tests.


tearDown

protected void tearDown()
Clears the GalacticMap fixture, removing all its contents so that a subsequent test will not be affected by the previous one.


testFindPath

public void testFindPath()
Tests the findPath method by verifying a number of shortest paths.


Savarese Software Research

Copyright © 2004-2005 Savarese Software Research and Daniel F. Savarese. All Rights Reserved.