Kore/tools/json
Martijn Brekhof 1cb77876be Implemented testing actionbar state (#382)
* Added JSON datafiles for TV shows and music videos
   * Implemented instrumentations tests for MoviesActivity, MusicActivity,
     TVShowActivity, and AddonsActivity.
   * Moved RestoreSearchQueryViewPagerTest to music package as it uses
     the MusicActivity
   * Moved RestoreSearchQueryListFragmentTest to movies packages as it
     uses the MoviesActivity
   * Added scripts to get JSON data for music videos, addons, and TV shows
   * Added sequence diagram for BaseMediaActivity to clarify new setup
   * Refactored BaseMediaActivity to comply with diagram
   * Refactored SyncMusicVideos and SyncTVShows so we can use the same code
     for adding test data as we use for adding real data.
   * Removed unused StringBuffer and synchronize block in MockTcpServer
2017-04-29 16:08:15 +01:00
..
.gitignore Implemented integration tests to test restoring search query 2016-06-16 11:04:25 +02:00
JsonTools.pm Updated integration tests for MediaProvider 2016-11-18 10:23:07 +00:00
README.md Unittest/mediaprovider (#251) 2016-09-23 19:08:22 +01:00
gentestnumbers.pl Added unittest for multi-disc albums (#317) 2016-11-30 12:21:21 +00:00
getaddons.pl Implemented testing actionbar state (#382) 2017-04-29 16:08:15 +01:00
getmovies.pl Implemented integration tests to test restoring search query 2016-06-16 11:04:25 +02:00
getmusic.pl Updated integration tests for MediaProvider 2016-11-18 10:23:07 +00:00
getmusicvideos.pl Implemented testing actionbar state (#382) 2017-04-29 16:08:15 +01:00
gettvshows.pl Implemented testing actionbar state (#382) 2017-04-29 16:08:15 +01:00

README.md

JSON Tools

Here you will find perl scripts that can be used to retrieve JSON responses from a Kodi instance. The scripts are primarily used to create the JSON source files needed by the instrumentation tests.

Getting json responses

Currently there are two scripts available to get media details from a Kodi instance.

  • getmovies.pl: retrieves movie details
  • getmusic.pl: retrieves music details

By default the scripts connect to Kodi running on the same machine (127.0.0.1) on port 8080. If you need to contact a Kodi instance on a different port and/or IP-address change the following line in each script:

my $url = "http://127.0.0.1:8080/jsonrpc";

Generating test values

The instrumentation tests require some values such as "total number of songs", "list of artistids", "genre ids", etc. etc. To generate these values from the JSON files, you can run gentestnumbers.pl. This script expects the JSON files to be located in the same directory you execute the script. It also assumes the names of the JSON files are the same as generated by getmovies.pl and getmusic.pl.