ps2.test
Class GeoPointTest

java.lang.Object
  extended by ps2.test.GeoPointTest

public class GeoPointTest
extends Object

Unit tests for the GeoPoint class.


Constructor Summary
Constructor and Description
GeoPointTest()
           
 
Method Summary
Modifier and Type Method and Description
 void testDistance01()
          Test that distance 0 is handled correctly: same object
 void testDistance02()
          Test that distance 0 is handled correctly: equal objects
 void testDistanceDueEast()
          Test that points due east are handled correctly
 void testDistanceDueNorth()
          Test that points due north are handled correctly
 void testDistanceDueNorthEast()
          Test that points north east are handled correctly
 void testDistanceDueSouth()
          Test that points due south are handled correctly
 void testDistanceDueSouthWest()
          Test that points south west are handled correctly
 void testDistanceDueWest()
          Test that points due west are handled correctly
 void testEquals1()
          Test positive case: same object
 void testEquals2()
          Test positive case: equal objects
 void testHashCode1()
          Test positive case: same object
 void testHashCode2()
          Test positive case: equal objects
 void testHeadingDueEast()
          Test that points due east are handled correctly
 void testHeadingDueNorth()
          Test that points due north are handled correctly
 void testHeadingDueSouth()
          Test that points due south are handled correctly
 void testHeadingDueWest()
          Test that points due west are handled correctly
 void testHeadingNorthEast()
          Test that points north east are handled correctly
 void testHeadingSouthWest()
          Test that points south west are handled correctly
 void testLegalValues1()
          Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.
 void testLegalValues2()
          Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.
 void testLegalValuesExtreme()
          Tests that GeoPoints can be created with the max/min latitudes and longitudes
 void testLocationToIntMethod()
          Sanity check for our locationToInt() method
 void testNotEqualsDiff()
          Test that two GeoPoints with different data do not register as equal.
 void testNotEqualsNull()
          Test that null values are handled correctly
 void testNotEqualsSwapped()
          Test that two GeoPoints with "swapped" latitude and longitude values (i.e., they both sum to the same value) do not register as equal.
 void testNotEqualsWrongType()
          Test that objects of a different type are handled appropriately
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoPointTest

public GeoPointTest()
Method Detail

testLocationToIntMethod

public void testLocationToIntMethod()
Sanity check for our locationToInt() method


testLegalValues1

public void testLegalValues1()
Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.


testLegalValues2

public void testLegalValues2()
Tests that GeoPoints can be created with some legal latitude and longitude values that are in the greater Seattle area, and that the values it's provided are returned unchanged.


testLegalValuesExtreme

public void testLegalValuesExtreme()
Tests that GeoPoints can be created with the max/min latitudes and longitudes


testDistance01

public void testDistance01()
Test that distance 0 is handled correctly: same object


testDistance02

public void testDistance02()
Test that distance 0 is handled correctly: equal objects


testDistanceDueNorth

public void testDistanceDueNorth()
Test that points due north are handled correctly


testDistanceDueSouth

public void testDistanceDueSouth()
Test that points due south are handled correctly


testDistanceDueEast

public void testDistanceDueEast()
Test that points due east are handled correctly


testDistanceDueWest

public void testDistanceDueWest()
Test that points due west are handled correctly


testDistanceDueNorthEast

public void testDistanceDueNorthEast()
Test that points north east are handled correctly


testDistanceDueSouthWest

public void testDistanceDueSouthWest()
Test that points south west are handled correctly


testHeadingDueNorth

public void testHeadingDueNorth()
Test that points due north are handled correctly


testHeadingDueSouth

public void testHeadingDueSouth()
Test that points due south are handled correctly


testHeadingDueEast

public void testHeadingDueEast()
Test that points due east are handled correctly


testHeadingDueWest

public void testHeadingDueWest()
Test that points due west are handled correctly


testHeadingNorthEast

public void testHeadingNorthEast()
Test that points north east are handled correctly


testHeadingSouthWest

public void testHeadingSouthWest()
Test that points south west are handled correctly


testEquals1

public void testEquals1()
Test positive case: same object


testEquals2

public void testEquals2()
Test positive case: equal objects


testNotEqualsNull

public void testNotEqualsNull()
Test that null values are handled correctly


testNotEqualsWrongType

public void testNotEqualsWrongType()
Test that objects of a different type are handled appropriately


testNotEqualsDiff

public void testNotEqualsDiff()
Test that two GeoPoints with different data do not register as equal.


testNotEqualsSwapped

public void testNotEqualsSwapped()
Test that two GeoPoints with "swapped" latitude and longitude values (i.e., they both sum to the same value) do not register as equal.


testHashCode1

public void testHashCode1()
Test positive case: same object


testHashCode2

public void testHashCode2()
Test positive case: equal objects