forked from upstream-mirrors/OpenTracks
Fixed tests.
This commit is contained in:
@@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.dennisguse.opentracks.R;
|
||||||
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
||||||
import de.dennisguse.opentracks.content.data.Track;
|
import de.dennisguse.opentracks.content.data.Track;
|
||||||
import de.dennisguse.opentracks.content.data.TrackPoint;
|
import de.dennisguse.opentracks.content.data.TrackPoint;
|
||||||
@@ -28,6 +29,7 @@ import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
|||||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||||
import de.dennisguse.opentracks.io.file.exporter.TrackExporter;
|
import de.dennisguse.opentracks.io.file.exporter.TrackExporter;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
import de.dennisguse.opentracks.stats.TrackStatistics;
|
||||||
|
import de.dennisguse.opentracks.util.PreferencesUtils;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
@@ -173,6 +175,7 @@ public class ExportImportTest {
|
|||||||
@Test
|
@Test
|
||||||
public void kml_with_trackdetail_and_sensordata_duplicate_trackUUID() {
|
public void kml_with_trackdetail_and_sensordata_duplicate_trackUUID() {
|
||||||
// given
|
// given
|
||||||
|
PreferencesUtils.setBoolean(context, R.string.import_prevent_reimport_key, true);
|
||||||
Track track = contentProviderUtils.getTrack(trackId);
|
Track track = contentProviderUtils.getTrack(trackId);
|
||||||
|
|
||||||
TrackExporter trackExporter = TrackFileFormat.KML_WITH_TRACKDETAIL_AND_SENSORDATA.newTrackExporter(context, new Track[]{track});
|
TrackExporter trackExporter = TrackFileFormat.KML_WITH_TRACKDETAIL_AND_SENSORDATA.newTrackExporter(context, new Track[]{track});
|
||||||
@@ -261,6 +264,7 @@ public class ExportImportTest {
|
|||||||
@Test
|
@Test
|
||||||
public void gpx_duplicate_trackUUID() {
|
public void gpx_duplicate_trackUUID() {
|
||||||
// given
|
// given
|
||||||
|
PreferencesUtils.setBoolean(context, R.string.import_prevent_reimport_key, true);
|
||||||
Track track = contentProviderUtils.getTrack(trackId);
|
Track track = contentProviderUtils.getTrack(trackId);
|
||||||
|
|
||||||
TrackExporter trackExporter = TrackFileFormat.GPX.newTrackExporter(context, new Track[]{track});
|
TrackExporter trackExporter = TrackFileFormat.GPX.newTrackExporter(context, new Track[]{track});
|
||||||
|
|||||||
@@ -341,8 +341,8 @@ public class PreferencesUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getPreventReimportTracks(Context context) {
|
public static boolean getPreventReimportTracks(Context context) {
|
||||||
final boolean defaultValue = getBoolean(context, R.bool.import_prevent_reimport_title_default, false);
|
final boolean defaultValue = getBoolean(context, R.bool.import_prevent_reimport_default, false);
|
||||||
return getBoolean(context, R.string.import_prevent_reimport_title_key, defaultValue);
|
return getBoolean(context, R.string.import_prevent_reimport_key, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated //Use TrackRecordingService
|
@Deprecated //Use TrackRecordingService
|
||||||
|
|||||||
@@ -227,8 +227,8 @@
|
|||||||
<!-- See TrackFileFormat -->
|
<!-- See TrackFileFormat -->
|
||||||
<string name="export_trackfileformat_default" translatable="false">KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES</string>
|
<string name="export_trackfileformat_default" translatable="false">KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES</string>
|
||||||
|
|
||||||
<string name="import_prevent_reimport_title_key" translatable="false">preventReimportTrackKey</string>
|
<string name="import_prevent_reimport_key" translatable="false">preventReimportTrackKey</string>
|
||||||
<bool name="import_prevent_reimport_title_default">false</bool>
|
<bool name="import_prevent_reimport_default">false</bool>
|
||||||
|
|
||||||
<string name="settings_recording_key" translatable="false">settingsRecordingKey</string>
|
<string name="settings_recording_key" translatable="false">settingsRecordingKey</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -154,8 +154,8 @@ limitations under the License.
|
|||||||
android:title="@string/settings_default_trackfileformat"
|
android:title="@string/settings_default_trackfileformat"
|
||||||
app:useSimpleSummaryProvider="true" />
|
app:useSimpleSummaryProvider="true" />
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
android:defaultValue="@bool/import_prevent_reimport_title_default"
|
android:defaultValue="@bool/import_prevent_reimport_default"
|
||||||
android:key="@string/import_prevent_reimport_title_key"
|
android:key="@string/import_prevent_reimport_key"
|
||||||
android:title="@string/settings_prevent_reimport_tracks_title" />
|
android:title="@string/settings_prevent_reimport_tracks_title" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user