ps6.test
Class TestRecord

java.lang.Object
  extended by ps6.test.TestRecord

public final class TestRecord
extends Object

A test record is a fairly simple record type to hold a query and its expected results


Nested Class Summary
static class TestRecord.TestDB
          Database information the various testing databases
static class TestRecord.TestType
          Types of tests, e.g.
 
Constructor Summary
TestRecord(String testName, TestRecord.TestDB db, TestRecord.TestType type, Address start, Address end, String[] directions, String tripLength, double length, String errorMessage)
           
 
Method Summary
 TestRecord.TestDB getDb()
          Get the database information for the test
 String[] getDirections()
          Get the expected direction lines
 String getDirectionType()
          Get a string rep.
 Address getEnd()
          Get the test's ending address
 String getErrorMessage()
          Get the expected error message
 double getLength()
          Get the expected length of the path
 Address getStart()
          Get the starting test's starting address
 String getTestName()
          Get the name of the Test
 String getTripLength()
          Get the expected length / travel time line
 TestRecord.TestType getType()
          Get the type of test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRecord

public TestRecord(String testName,
                  TestRecord.TestDB db,
                  TestRecord.TestType type,
                  Address start,
                  Address end,
                  String[] directions,
                  String tripLength,
                  double length,
                  String errorMessage)
Parameters:
testName - name of the test (for use by JUnit)
db - database information for the test
type - type of the test
start - starting address of the query
end - ending address of the query
directions - sequence of directions lines expected from getDirections, or null if we expect not to find any directions. the elements must not contain newlines at the end.
tripLength - the trip length or trip time that appear at the end of the directions
length - expected length of the path, or NaN if we expect not to find any directions
errorMessage - expected error message or null if no error is expected
Method Detail

getDirectionType

public String getDirectionType()
Get a string rep. of the direction type for the test (e.g. "w" or "d")

Returns:
a string representation of the direction type for the test

getTestName

public String getTestName()
Get the name of the Test

Returns:
the name of the test

getStart

public Address getStart()
Get the starting test's starting address

Returns:
the starting address

getEnd

public Address getEnd()
Get the test's ending address

Returns:
the ending address

getType

public TestRecord.TestType getType()
Get the type of test

Returns:
the type of test

getDirections

public String[] getDirections()
Get the expected direction lines

Returns:
the expected direction lines

getTripLength

public String getTripLength()
Get the expected length / travel time line

Returns:
the expected length / travel time line

getLength

public double getLength()
Get the expected length of the path

Returns:
the expected length of path

getErrorMessage

public String getErrorMessage()
Get the expected error message

Returns:
the expected error message

getDb

public TestRecord.TestDB getDb()
Get the database information for the test

Returns:
the database for the test