forked from upstream-mirrors/OpenTracks
Revert the change to make the method getMyTracksLocation static (I'll create a new change for it). And change comments which have Javadoc warnings in some classes.
This commit is contained in:
@@ -43,13 +43,13 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
private View zoomOut;
|
private View zoomOut;
|
||||||
private int currentZoomLevel;
|
private int currentZoomLevel;
|
||||||
|
|
||||||
private static final String LOCATION_PROVIDER = "gps";
|
private final String LOCATION_PROVIDER = "gps";
|
||||||
private static final double INITIAL_LONGTITUDE = 22;
|
private final double INITIAL_LONGTITUDE = 22;
|
||||||
private static final double INITIAL_LATITUDE = 22;
|
private final double INITIAL_LATITUDE = 22;
|
||||||
private static final double INITIAL_ALTITUDE = 22;
|
private final double INITIAL_ALTITUDE = 22;
|
||||||
private static final float INITIAL_ACCURACY = 5;
|
private final float INITIAL_ACCURACY = 5;
|
||||||
private static final float INITIAL_SPEED = 10;
|
private final float INITIAL_SPEED = 10;
|
||||||
private static final float INITIAL_BEARING = 3.0f;
|
private final float INITIAL_BEARING = 3.0f;
|
||||||
// 10 is same with the default value in ChartView
|
// 10 is same with the default value in ChartView
|
||||||
private final int MAX_ZOOM_LEVEL = 10;
|
private final int MAX_ZOOM_LEVEL = 10;
|
||||||
private final int MIN_ZOOM_LEVEL = 1;
|
private final int MIN_ZOOM_LEVEL = 1;
|
||||||
@@ -113,7 +113,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* There are two parts in this test. Tests
|
* There are two parts in this test. Tests
|
||||||
* {@link ChartActivity#OnCreateDialog()} which includes the logic to create
|
* {@link ChartActivity#onCreateDialog(int)} which includes the logic to create
|
||||||
* {@link ChartSettingsDialog}.
|
* {@link ChartSettingsDialog}.
|
||||||
*/
|
*/
|
||||||
public void testCreateSettingDialog() {
|
public void testCreateSettingDialog() {
|
||||||
@@ -134,7 +134,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the incorrect values of sensor in {@link
|
* Tests the logic to get the incorrect values of sensor in {@link
|
||||||
* ChartActivity#fillDataPoint(Location location, double result[])}.
|
* ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
*/
|
*/
|
||||||
public void testFillDataPoint_sensorIncorrect() {
|
public void testFillDataPoint_sensorIncorrect() {
|
||||||
MyTracksLocation myTracksLocation = getMyTracksLocation();
|
MyTracksLocation myTracksLocation = getMyTracksLocation();
|
||||||
@@ -166,7 +166,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the correct values of sensor in {@link
|
* Tests the logic to get the correct values of sensor in {@link
|
||||||
* ChartActivity#fillDataPoint(Location location, double result[])}.
|
* ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
*/
|
*/
|
||||||
public void testFillDataPoint_sensorCorrect() {
|
public void testFillDataPoint_sensorCorrect() {
|
||||||
MyTracksLocation myTracksLocation = getMyTracksLocation();
|
MyTracksLocation myTracksLocation = getMyTracksLocation();
|
||||||
@@ -197,7 +197,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the value of metric Distance in
|
* Tests the logic to get the value of metric Distance in
|
||||||
* {@link #fillDataPoint}.
|
* {@link ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
*/
|
*/
|
||||||
public void testFillDataPoint_distanceMetric() {
|
public void testFillDataPoint_distanceMetric() {
|
||||||
// By distance.
|
// By distance.
|
||||||
@@ -214,7 +214,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
// The third location is a new location, and use metric.
|
// The third location is a new location, and use metric.
|
||||||
MyTracksLocation myTracksLocation3 = getMyTracksLocation();
|
MyTracksLocation myTracksLocation3 = getMyTracksLocation();
|
||||||
myTracksLocation3.setLatitude(INITIAL_LONGTITUDE + 1 );
|
myTracksLocation3.setLatitude(23);
|
||||||
point = fillDataPointTestHelper(myTracksLocation3, false);
|
point = fillDataPointTestHelper(myTracksLocation3, false);
|
||||||
// Computes the distance between Latitude 22 and 23.
|
// Computes the distance between Latitude 22 and 23.
|
||||||
float[] results = new float[4];
|
float[] results = new float[4];
|
||||||
@@ -225,7 +225,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
// The fourth location is a new location, and use metric.
|
// The fourth location is a new location, and use metric.
|
||||||
MyTracksLocation myTracksLocation4 = getMyTracksLocation();
|
MyTracksLocation myTracksLocation4 = getMyTracksLocation();
|
||||||
myTracksLocation4.setLatitude(INITIAL_LONGTITUDE + 2 );
|
myTracksLocation4.setLatitude(24);
|
||||||
point = fillDataPointTestHelper(myTracksLocation4, false);
|
point = fillDataPointTestHelper(myTracksLocation4, false);
|
||||||
// Computes the distance between Latitude 23 and 24.
|
// Computes the distance between Latitude 23 and 24.
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the value of imperial Distance in
|
* Tests the logic to get the value of imperial Distance in
|
||||||
* {@link #fillDataPoint}.
|
* {@link ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
*/
|
*/
|
||||||
public void testFillDataPoint_distanceImperial() {
|
public void testFillDataPoint_distanceImperial() {
|
||||||
// Setups to use imperial.
|
// Setups to use imperial.
|
||||||
@@ -250,7 +250,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
// The second location is a new location, and use imperial.
|
// The second location is a new location, and use imperial.
|
||||||
MyTracksLocation myTracksLocation2 = getMyTracksLocation();
|
MyTracksLocation myTracksLocation2 = getMyTracksLocation();
|
||||||
myTracksLocation2.setLatitude(INITIAL_LONGTITUDE + 1 );
|
myTracksLocation2.setLatitude(23);
|
||||||
point = fillDataPointTestHelper(myTracksLocation2, false);
|
point = fillDataPointTestHelper(myTracksLocation2, false);
|
||||||
/*
|
/*
|
||||||
* Computes the distance between Latitude 22 and 23. And for we set using
|
* Computes the distance between Latitude 22 and 23. And for we set using
|
||||||
@@ -264,7 +264,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
// The third location is a new location, and use imperial.
|
// The third location is a new location, and use imperial.
|
||||||
MyTracksLocation myTracksLocation3 = getMyTracksLocation();
|
MyTracksLocation myTracksLocation3 = getMyTracksLocation();
|
||||||
myTracksLocation3.setLatitude(INITIAL_LONGTITUDE + 2 );
|
myTracksLocation3.setLatitude(24);
|
||||||
point = fillDataPointTestHelper(myTracksLocation3, false);
|
point = fillDataPointTestHelper(myTracksLocation3, false);
|
||||||
/*
|
/*
|
||||||
* Computes the distance between Latitude 23 and 24. And for we set using
|
* Computes the distance between Latitude 23 and 24. And for we set using
|
||||||
@@ -278,7 +278,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the values of time in {@link #fillDataPoint}.
|
* Tests the logic to get the values of time in {@link ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
*/
|
*/
|
||||||
public void testFillDataPoint_time() {
|
public void testFillDataPoint_time() {
|
||||||
// By time
|
// By time
|
||||||
@@ -390,7 +390,7 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
*
|
*
|
||||||
* @return a simulated location.
|
* @return a simulated location.
|
||||||
*/
|
*/
|
||||||
public static MyTracksLocation getMyTracksLocation() {
|
private MyTracksLocation getMyTracksLocation() {
|
||||||
// Initial Location
|
// Initial Location
|
||||||
Location loc = new Location(LOCATION_PROVIDER);
|
Location loc = new Location(LOCATION_PROVIDER);
|
||||||
loc.setLongitude(INITIAL_LONGTITUDE);
|
loc.setLongitude(INITIAL_LONGTITUDE);
|
||||||
|
|||||||
+2
-2
@@ -245,7 +245,7 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link SendRequest#writeToParcel(Parcel in)} when all input values
|
* Tests {@link SendRequest#writeToParcel(Parcel, int)} when all input values
|
||||||
* are true or affirmative.
|
* are true or affirmative.
|
||||||
*/
|
*/
|
||||||
public void testWriteToParcel_allTrue() {
|
public void testWriteToParcel_allTrue() {
|
||||||
@@ -283,7 +283,7 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link SendRequest#writeToParcel(Parcel in)} when all input values
|
* Tests {@link SendRequest#writeToParcel(Parcel, int)} when all input values
|
||||||
* are false or negative.
|
* are false or negative.
|
||||||
*/
|
*/
|
||||||
public void testWriteToParcel_allFalse() {
|
public void testWriteToParcel_allFalse() {
|
||||||
|
|||||||
+5
-5
@@ -51,7 +51,7 @@ public class UploadServiceChooserActivityTest extends
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to control display all send options. This test cover code
|
* Tests the logic to control display all send options. This test cover code
|
||||||
* in method {@link UploadServiceChooserActivity#onCreateDialog()},
|
* in method {@link UploadServiceChooserActivity#onCreateDialog(int)},
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
||||||
*/
|
*/
|
||||||
@@ -91,7 +91,7 @@ public class UploadServiceChooserActivityTest extends
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to check the send to Google Maps option. This test cover
|
* Tests the logic to check the send to Google Maps option. This test cover
|
||||||
* code in method {@link UploadServiceChooserActivity#onCreateDialog()},
|
* code in method {@link UploadServiceChooserActivity#onCreateDialog(int)},
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
||||||
*/
|
*/
|
||||||
@@ -120,7 +120,7 @@ public class UploadServiceChooserActivityTest extends
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to control display none. This test cover code in method
|
* Tests the logic to control display none. This test cover code in method
|
||||||
* {@link UploadServiceChooserActivity#onCreateDialog()},
|
* {@link UploadServiceChooserActivity#onCreateDialog(int)},
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
* {@link UploadServiceChooserActivity#updateStateBySendRequest()} and
|
||||||
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
* {@link UploadServiceChooserActivity#updateStateBySelection()}.
|
||||||
*/
|
*/
|
||||||
@@ -135,7 +135,7 @@ public class UploadServiceChooserActivityTest extends
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to initial state of check box to unchecked. This test cover
|
* Tests the logic to initial state of check box to unchecked. This test cover
|
||||||
* code in method {@link UploadServiceChooserActivity#onCreateDialog()},
|
* code in method {@link UploadServiceChooserActivity#onCreateDialog(int)},
|
||||||
* {@link UploadServiceChooserActivity#initState()}.
|
* {@link UploadServiceChooserActivity#initState()}.
|
||||||
*/
|
*/
|
||||||
public void testOnCreateDialog_initStateUnchecked() {
|
public void testOnCreateDialog_initStateUnchecked() {
|
||||||
@@ -162,7 +162,7 @@ public class UploadServiceChooserActivityTest extends
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to initial state of check box to checked. This test cover
|
* Tests the logic to initial state of check box to checked. This test cover
|
||||||
* code in method {@link UploadServiceChooserActivity#onCreateDialog()},
|
* code in method {@link UploadServiceChooserActivity#onCreateDialog(int)},
|
||||||
* {@link UploadServiceChooserActivity#initState()}.
|
* {@link UploadServiceChooserActivity#initState()}.
|
||||||
*/
|
*/
|
||||||
public void testOnCreateDialog_initStateChecked() {
|
public void testOnCreateDialog_initStateChecked() {
|
||||||
|
|||||||
Reference in New Issue
Block a user