public class AGMapServerTest extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static double |
doubleThreshhold |
(package private) static boolean |
initialized |
(package private) static double |
leniency |
(package private) static List<TestParams> |
params |
(package private) static int |
passedRaster |
(package private) static int |
passedRoute |
(package private) static double |
SSD_THRESHHOLD |
Constructor and Description |
---|
AGMapServerTest() |
Modifier and Type | Method and Description |
---|---|
private void |
assertImageArrayEquals(String msg,
byte[] imarr1,
byte[] imarr2) |
private void |
assertImageArrayEquals(String msg,
byte[] imarr1,
byte[] imarr2,
double threshhold) |
private void |
checkParamsMap(String err,
Map<String,Object> m1,
Map<String,Object> m2) |
private double |
computePixelSSD(int rgb1,
int rgb2) |
private double |
computeSSD(BufferedImage im1,
BufferedImage im2) |
void |
setUp()
Initializes the student MapServer statically.
|
void |
testAGetMapRaster()
Test the rastering functionality of the student code, by writing the ByteArrayOutputStream
to a byte[] array and comparing it with the staff result byte-wise.
|
void |
testBGetMapRasterParams()
Check the student raster output parameters against the staff output parameters.
|
void |
testCFindAndSetRoute()
Test the routefinding functionality by comparing the node id list item by item.
|
void |
testDRouteRaster()
Test the route raster the same way the map raster is tested, except with the route pre-set
before making the call to raster.
|
void |
testGGetLocationsByPrefix()
Test Autocomplete for each prefix, comparing the sets of outputs against each other.
|
void |
testHGetLocations()
Test location search by full search string, comparing the output lists against each other
element by element; note that we assume the most reasonable construction of each of these
lists, that is, that they are in order of the locations as they appear in the OSM file.
|
static List<TestParams> params
static double leniency
static final double doubleThreshhold
static final double SSD_THRESHHOLD
static int passedRaster
static int passedRoute
static boolean initialized
public void setUp() throws Exception
List
of TestParams.Exception
private double computePixelSSD(int rgb1, int rgb2)
private double computeSSD(BufferedImage im1, BufferedImage im2)
private void assertImageArrayEquals(String msg, byte[] imarr1, byte[] imarr2) throws IOException
IOException
private void assertImageArrayEquals(String msg, byte[] imarr1, byte[] imarr2, double threshhold) throws IOException
IOException
private void checkParamsMap(String err, Map<String,Object> m1, Map<String,Object> m2)
public void testAGetMapRaster() throws Exception
Exception
public void testBGetMapRasterParams() throws Exception
Exception
public void testCFindAndSetRoute() throws Exception
Exception
public void testDRouteRaster() throws Exception
Exception
public void testGGetLocationsByPrefix() throws Exception
Exception
public void testHGetLocations() throws Exception
Exception