test.calculation
Class BuildTreeTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by test.calculation.BuildTreeTest
All Implemented Interfaces:
junit.framework.Test

public class BuildTreeTest
extends junit.framework.TestCase

The test class of the calcultaion.BuildTree.

Version:
1
Author:
Potkuri-group

Field Summary
(package private)  calculation.BuildTree buildTree
          BuildTree.
(package private)  calculation.BuildTree buildTree2
          Another BuildTee.
(package private)  general.DataCollection dataCollection
          DataCollection.
private  calculation.Vertex[][] graph
          Graph for testing.
(package private)  calculation.Graph graph2
          Another Graph for testing.
private static int MAP_HEIGHT
          Height of the test graph.
private static int MAP_WIDTH
          Width of the test graph.
private  calculation.Vertex nullVertex
          Nullvertex.
(package private)  calculation.Vertex vertex
          Vertex.
 
Constructor Summary
BuildTreeTest()
           
 
Method Summary
private  java.lang.String pathString(java.util.ArrayList<calculation.Vertex> path)
          Creates a string which shows which vertexes belong to a given path.
 void setUp()
          Creates MAP_WIDTH*MAP_HEIGHT-sized graph where some vertexes are not available.
 void testAStar()
          Tests if aStar finds correct paths in different situations in the test graph.
 void testCalculate()
          Tests method calculate and treeRecursion.
 void testCalculatePath()
          Tests method calculatePath.
 void testHalfTable()
          Tests method halfTable.
 void testPathLength()
          Test for pathLength().
 void testSetSafetyDistance()
          Tests method setSafetyDistance.
 void testSetSlidingSafetyDistance()
          Tests method setSlidingSafetyDistance.
 void testTestSide()
          Tests method testSide.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buildTree

calculation.BuildTree buildTree
BuildTree.


buildTree2

calculation.BuildTree buildTree2
Another BuildTee.


dataCollection

general.DataCollection dataCollection
DataCollection.


graph

private calculation.Vertex[][] graph
Graph for testing.


graph2

calculation.Graph graph2
Another Graph for testing.


MAP_HEIGHT

private static final int MAP_HEIGHT
Height of the test graph.

See Also:
Constant Field Values

MAP_WIDTH

private static final int MAP_WIDTH
Width of the test graph.

See Also:
Constant Field Values

nullVertex

private calculation.Vertex nullVertex
Nullvertex.


vertex

calculation.Vertex vertex
Vertex.

Constructor Detail

BuildTreeTest

public BuildTreeTest()
Method Detail

pathString

private java.lang.String pathString(java.util.ArrayList<calculation.Vertex> path)
Creates a string which shows which vertexes belong to a given path.

Parameters:
path - the path whose String representation is wanted
Returns:
path as String

setUp

public void setUp()
           throws java.lang.Exception
Creates MAP_WIDTH*MAP_HEIGHT-sized graph where some vertexes are not available.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception - if something bad happens.

testAStar

public final void testAStar()
Tests if aStar finds correct paths in different situations in the test graph. Test method for aStar().


testCalculate

public void testCalculate()
Tests method calculate and treeRecursion.


testCalculatePath

public void testCalculatePath()
Tests method calculatePath.


testHalfTable

public void testHalfTable()
Tests method halfTable.


testPathLength

public final void testPathLength()
Test for pathLength().


testSetSafetyDistance

public void testSetSafetyDistance()
Tests method setSafetyDistance.


testSetSlidingSafetyDistance

public void testSetSlidingSafetyDistance()
Tests method setSlidingSafetyDistance.


testTestSide

public void testTestSide()
Tests method testSide.