This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mock trace tests and sample app (#127)
* Un-ignore mock trace tests * Removes Thread.sleep(100) statements * Update test runner * Extract TraceThread class * Refactors mock gpx trace logic to be more testable * Adds fastest interval to sample app * Unused imports * Load sample app gpx trace from external files dir * Adds bash script to install gpx trace file into app external files dir * Update mock-locations-routes.md
- Loading branch information
Showing
14 changed files
with
411 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lost/src/main/java/com/mapzen/android/lost/internal/GpxTraceThreadFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
import android.content.Context; | ||
|
||
import java.io.File; | ||
|
||
public class GpxTraceThreadFactory implements TraceThreadFactory { | ||
@Override public TraceThread createTraceThread(Context context, File traceFile, MockEngine engine, | ||
SleepFactory sleepFactory) { | ||
return new TraceThread(context, traceFile, engine, sleepFactory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
lost/src/main/java/com/mapzen/android/lost/internal/SleepFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
interface SleepFactory { | ||
void sleep(long millis); | ||
} |
11 changes: 11 additions & 0 deletions
11
lost/src/main/java/com/mapzen/android/lost/internal/ThreadSleepFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.mapzen.android.lost.internal; | ||
|
||
class ThreadSleepFactory implements SleepFactory { | ||
@Override public void sleep(long millis) { | ||
try { | ||
Thread.sleep(millis); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.