-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
176 changed files
with
7,466 additions
and
1,811 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
32 changes: 0 additions & 32 deletions
32
Hyperrail/src/androidTest/java/be/hyperrail/android/test/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
2,651 changes: 2,651 additions & 0 deletions
2,651
Hyperrail/src/androidTest/java/be/hyperrail/android/test/IrailParserInstrumentedTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
Hyperrail/src/androidTest/java/be/hyperrail/android/test/StationsDbInstrumentedTest.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,56 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package be.hyperrail.android.test; | ||
|
||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import be.hyperrail.android.irail.contracts.IrailStationProvider; | ||
import be.hyperrail.android.irail.db.Station; | ||
import be.hyperrail.android.irail.db.StationsDb; | ||
|
||
import static junit.framework.Assert.assertEquals; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class StationsDbInstrumentedTest { | ||
|
||
IrailStationProvider provider = new StationsDb(InstrumentationRegistry.getTargetContext()); | ||
|
||
@Test | ||
public void testStationSearch(){ | ||
//BE.NMBS.008811437 Bosvoorde/Boitsfort Boitsfort Bosvoorde be 4.408112 50.794698 31.947976878613 | ||
Station bosvoorde = provider.getStationById("BE.NMBS.008811437"); | ||
assertEquals("BE.NMBS.008811437", bosvoorde.getId()); | ||
assertEquals("Bosvoorde/Boitsfort", bosvoorde.getName()); | ||
assertEquals("Bosvoorde", bosvoorde.getAlternativeNl()); | ||
assertEquals("Boitsfort", bosvoorde.getAlternativeFr()); | ||
assertEquals("", bosvoorde.getAlternativeEn()); | ||
assertEquals("", bosvoorde.getAlternativeDe()); | ||
assertEquals("be", bosvoorde.getCountryCode()); | ||
assertEquals(4.408112, bosvoorde.getLongitude(),0.0000001); | ||
assertEquals(50.794698, bosvoorde.getLatitude(),0.0000001); | ||
assertEquals( 31.947976878613, bosvoorde.getAvgStopTimes(),0.0001); | ||
|
||
// Test for caps variations, different languages, and diferent separator symbols | ||
String searchnames[] = new String[]{"Bosvoorde","Boitsfort","Bosvoorde/Boitsfort","Bosvoorde Boitsfort","Bosvoorde-Boitsfort","BOSVOORDE"}; | ||
for (String name :searchnames) { | ||
assertEquals(bosvoorde.getId(),provider.getStationByName(name).getId()); | ||
} | ||
// BE.NMBS.008866001 Arlon Aarlen Arel | ||
Station arlon = provider.getStationById("BE.NMBS.008866001"); | ||
assertEquals("BE.NMBS.008866001", arlon.getId()); | ||
assertEquals("Arlon", arlon.getName()); | ||
assertEquals("Aarlen", arlon.getAlternativeNl()); | ||
assertEquals("", arlon.getAlternativeFr()); | ||
assertEquals("", arlon.getAlternativeEn()); | ||
assertEquals("Arel", arlon.getAlternativeDe()); | ||
|
||
} | ||
} |
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,28 @@ | ||
<!-- | ||
~ This Source Code Form is subject to the terms of the Mozilla Public | ||
~ License, v. 2.0. If a copy of the MPL was not distributed with this | ||
~ file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
--> | ||
|
||
<resources> | ||
<!-- | ||
To get one, follow this link, follow the directions and press "Create" at the end: | ||
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=A1:A3:0E:79:C2:F8:0C:4A:B9:69:A5:1B:F0:91:CB:45:8E:4C:40:31%3Bbe.hyperrail.android | ||
You can also add your credentials to an existing key, using these values: | ||
Package name: | ||
A1:A3:0E:79:C2:F8:0C:4A:B9:69:A5:1B:F0:91:CB:45:8E:4C:40:31 | ||
SHA-1 certificate fingerprint: | ||
A1:A3:0E:79:C2:F8:0C:4A:B9:69:A5:1B:F0:91:CB:45:8E:4C:40:31 | ||
Alternatively, follow the directions here: | ||
https://developers.google.com/maps/documentation/android/start#get-key | ||
Once you have your key (it starts with "AIza"), replace the "google_maps_key" | ||
string in this file. | ||
--> | ||
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyAcxOmBuJfsO11qC1Ig9xP4FewwXpb_KN0</string> | ||
</resources> |
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
Oops, something went wrong.