change some code style of SendToGoogleUtilsTest.

This commit is contained in:
youtaol
2012-03-29 15:14:37 +08:00
parent 0f2d77400e
commit eae2b63586
@@ -37,6 +37,7 @@ public class SendToGoogleUtilsTest extends TestCase {
private final static String TRACK_CATEGORY = "trackCategory"; private final static String TRACK_CATEGORY = "trackCategory";
private final static String TRACK_NAME = "trackName"; private final static String TRACK_NAME = "trackName";
private final static double DIFFERENCE = 0.02; private final static double DIFFERENCE = 0.02;
private final static double INVALID_LATITUDE = 91;
/** /**
* Tests the method * Tests the method
@@ -95,13 +96,14 @@ public class SendToGoogleUtilsTest extends TestCase {
List<Location> locationsArray = new ArrayList<Location>(); List<Location> locationsArray = new ArrayList<Location>();
// Adds 100 location to List. // Adds 100 location to List.
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
// Use this variable to make all points in the track can be kept after the // Use this variable as a flag to make all points in the track can be kept
// after run the LocationUtils#decimate(Track, double) with
// Ramer–Douglas–Peucker algorithm. // Ramer–Douglas–Peucker algorithm.
int positiveOrNegative = (i % 2) - 1; int positiveOrNegative = (i % 2) == 0 ? -1 : 0;
// Inserts 9 points which have wrong latitude, so would have 10 segments. // Inserts 9 points which have wrong latitude, so would have 10 segments.
if (i % 10 == 0 && i > 0) { if (i % 10 == 0 && i > 0) {
MyTracksLocation location = TrackStubUtils.createMyTracksLocation(); MyTracksLocation location = TrackStubUtils.createMyTracksLocation();
location.setLatitude(91); location.setLatitude(INVALID_LATITUDE);
locationsArray.add(location); locationsArray.add(location);
} else { } else {
locationsArray.add(TrackStubUtils.createMyTracksLocation(TrackStubUtils.INITIAL_LATITUDE locationsArray.add(TrackStubUtils.createMyTracksLocation(TrackStubUtils.INITIAL_LATITUDE
@@ -130,10 +132,4 @@ public class SendToGoogleUtilsTest extends TestCase {
oneLocation.getLongitude()); oneLocation.getLongitude());
} }
} }
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
} }