Search in sources :

Example 6 with ActivityTrack

use of nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack in project Gadgetbridge by Freeyourgadget.

the class GPXExporterTest method shouldCreateValidGpxFromSimulatedData.

@Test
public void shouldCreateValidGpxFromSimulatedData() throws IOException, ParseException, GPXTrackEmptyException, SAXException {
    final List<ActivityPoint> points = readActivityPoints("/GPXExporterTest-SampleTracks.csv");
    final GPXExporter gpxExporter = new GPXExporter();
    gpxExporter.setCreator("Gadgetbridge Test");
    final ActivityTrack track = createTestTrack(points);
    final File tempFile = File.createTempFile("gpx-exporter-test-track", ".gpx");
    tempFile.deleteOnExit();
    gpxExporter.performExport(track, tempFile);
    validateGpxFile(tempFile);
}
Also used : ActivityPoint(nodomain.freeyourgadget.gadgetbridge.model.ActivityPoint) ActivityTrack(nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack) File(java.io.File) Test(org.junit.Test)

Aggregations

ActivityTrack (nodomain.freeyourgadget.gadgetbridge.model.ActivityTrack)6 ActivityPoint (nodomain.freeyourgadget.gadgetbridge.model.ActivityPoint)5 File (java.io.File)4 Test (org.junit.Test)4 HuamiActivityDetailsParser (nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiActivityDetailsParser)3 InputStream (java.io.InputStream)2 BipActivitySummary (nodomain.freeyourgadget.gadgetbridge.devices.amazfitbip.BipActivitySummary)2 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 DBHandler (nodomain.freeyourgadget.gadgetbridge.database.DBHandler)1 Device (nodomain.freeyourgadget.gadgetbridge.entities.Device)1 User (nodomain.freeyourgadget.gadgetbridge.entities.User)1 ActivityTrackExporter (nodomain.freeyourgadget.gadgetbridge.export.ActivityTrackExporter)1 GPXExporter (nodomain.freeyourgadget.gadgetbridge.export.GPXExporter)1