mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 20:38:50 +00:00
Add a README.md file to the enabler project.
This commit is contained in:
parent
b1e89921a6
commit
258f127fa7
1 changed files with 31 additions and 0 deletions
31
enabler/README.md
Normal file
31
enabler/README.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
Public Transport Enabler
|
||||||
|
========================
|
||||||
|
|
||||||
|
This is a Java library allowing you to get data from public transport providers.
|
||||||
|
Look into [NetworkProvider.java](https://github.com/schildbach/public-transport-enabler/blob/master/enabler/src/de/schildbach/pte/NetworkProvider.java) for an overview of the API.
|
||||||
|
|
||||||
|
Using providers that require secrets
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
For some providers a secret like an API key is required to use their API.
|
||||||
|
Copy the `secrets.properties.template` file to `secrets.properties` like so:
|
||||||
|
|
||||||
|
$ cp test/de/schildbach/pte/live/secrets.properties.template test/de/schildbach/pte/live/secrets.properties
|
||||||
|
|
||||||
|
You need to request the secrets directly from the provider. For Navitia based providers, you can [request a secret here](http://www.navitia.io/register).
|
||||||
|
|
||||||
|
How to run live tests?
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Make sure the test you want to run does not require a secret and if it does, see above for how to get one.
|
||||||
|
Once you have the secret or if your provider does not need one, you can run the tests in your IDE.
|
||||||
|
Both IntelliJ and Eclipse have excellent support for JUnit tests.
|
||||||
|
|
||||||
|
If you prefer to run tests from the command line, you can comment out the test exclude at the end of
|
||||||
|
[build.gradle](https://github.com/schildbach/public-transport-enabler/blob/master/enabler/build.gradle#L30)
|
||||||
|
and use this command to only execute a test for a single provider:
|
||||||
|
|
||||||
|
$ gradle -Dtest.single=ParisProviderLive test
|
||||||
|
|
||||||
|
This uses the `ParisProvider` as an example.
|
||||||
|
Just replace it with the provider you want to test.
|
Loading…
Add table
Add a link
Reference in a new issue