forked from upstream-mirrors/OpenTracks
Add a category icon in Track.java and TracksColumns.java.
Clean up Track.java and TracksColumns.java.
This commit is contained in:
@@ -180,7 +180,7 @@ public class SendDocsUtilsTest extends AndroidTestCase {
|
||||
track.setName("trackName");
|
||||
track.setDescription("trackDescription");
|
||||
track.setMapId("trackMapId");
|
||||
track.setStatistics(stats);
|
||||
track.setTripStatistics(stats);
|
||||
return track;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ import static com.google.android.testing.mocking.AndroidMock.eq;
|
||||
import static com.google.android.testing.mocking.AndroidMock.expect;
|
||||
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils.Factory;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.TracksColumns;
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils.Factory;
|
||||
import com.google.android.apps.mytracks.io.file.GpxImporter;
|
||||
import com.google.android.apps.mytracks.testing.TestingProviderUtilsFactory;
|
||||
import com.google.android.testing.mocking.AndroidMock;
|
||||
import com.google.android.testing.mocking.UsesMocks;
|
||||
@@ -171,7 +170,7 @@ public class GpxImporterTest extends AndroidTestCase {
|
||||
Track track = trackParam.getValue();
|
||||
assertEquals(TRACK_NAME, track.getName());
|
||||
assertEquals(TRACK_DESC, track.getDescription());
|
||||
assertEquals(DATE_FORMAT2.parse(TRACK_TIME_1).getTime(), track.getStatistics()
|
||||
assertEquals(DATE_FORMAT2.parse(TRACK_TIME_1).getTime(), track.getTripStatistics()
|
||||
.getStartTime());
|
||||
assertNotSame(-1, track.getStartId());
|
||||
assertNotSame(-1, track.getStopId());
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@ public class SendFusionTablesUtilsTest extends TestCase {
|
||||
Track track = new Track();
|
||||
TripStatistics stats = new TripStatistics();
|
||||
stats.setBounds((int) 100.E6, (int) 10.E6, (int) 50.E6, (int) 5.E6);
|
||||
track.setStatistics(stats);
|
||||
track.setTripStatistics(stats);
|
||||
track.setTableId(null);
|
||||
assertEquals(null, SendFusionTablesUtils.getMapUrl(track));
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class SendFusionTablesUtilsTest extends TestCase {
|
||||
*/
|
||||
public void testGetMapUrl_null_stats() {
|
||||
Track track = new Track();
|
||||
track.setStatistics(null);
|
||||
track.setTripStatistics(null);
|
||||
track.setTableId("123");
|
||||
assertEquals(null, SendFusionTablesUtils.getMapUrl(track));
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class SendFusionTablesUtilsTest extends TestCase {
|
||||
Track track = new Track();
|
||||
TripStatistics stats = new TripStatistics();
|
||||
stats.setBounds((int) 100.E6, (int) 10.E6, (int) 50.E6, (int) 5.E6);
|
||||
track.setStatistics(stats);
|
||||
track.setTripStatistics(stats);
|
||||
track.setTableId("123");
|
||||
assertEquals(
|
||||
"https://www.google.com/fusiontables/embedviz?"
|
||||
|
||||
+5
-4
@@ -56,13 +56,14 @@ public class SendToGoogleUtilsTest extends TestCase {
|
||||
*/
|
||||
public void testPrepareTrackSegment_noStopTime() {
|
||||
Track trackStub = TrackStubUtils.createTrack(2);
|
||||
assertEquals(-1L, trackStub.getStatistics().getStopTime());
|
||||
assertEquals(-1L, trackStub.getTripStatistics().getStopTime());
|
||||
|
||||
ArrayList<Track> tracksArray = new ArrayList<Track>();
|
||||
assertTrue(SendToGoogleUtils.prepareTrackSegment(trackStub, tracksArray));
|
||||
assertEquals(trackStub, tracksArray.get(0));
|
||||
// The stop time should be the time of last location
|
||||
assertEquals(trackStub.getLocations().get(1).getTime(), trackStub.getStatistics().getStopTime());
|
||||
assertEquals(
|
||||
trackStub.getLocations().get(1).getTime(), trackStub.getTripStatistics().getStopTime());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,12 +76,12 @@ public class SendToGoogleUtilsTest extends TestCase {
|
||||
// Gives a margin to make sure the this time will be not same with the last
|
||||
// location in the track.
|
||||
long stopTime = System.currentTimeMillis() + 1000;
|
||||
trackStub.getStatistics().setStopTime(stopTime);
|
||||
trackStub.getTripStatistics().setStopTime(stopTime);
|
||||
|
||||
ArrayList<Track> tracksArray = new ArrayList<Track>();
|
||||
SendToGoogleUtils.prepareTrackSegment(trackStub, tracksArray);
|
||||
assertEquals(trackStub, tracksArray.get(0));
|
||||
assertEquals(stopTime, trackStub.getStatistics().getStopTime());
|
||||
assertEquals(stopTime, trackStub.getTripStatistics().getStopTime());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user