You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
6 years ago
..
.gitignore Implemented integration tests to test restoring search query 7 years ago
JsonTools.pm Updated integration tests for MediaProvider 7 years ago
README.md Unittest/mediaprovider (#251) 7 years ago
gentestnumbers.pl Added unittest for multi-disc albums (#317) 7 years ago
getaddons.pl Implemented testing actionbar state (#382) 6 years ago
getmovies.pl Implemented integration tests to test restoring search query 7 years ago
getmusic.pl Updated integration tests for MediaProvider 7 years ago
getmusicvideos.pl Implemented testing actionbar state (#382) 6 years ago
gettvshows.pl Implemented testing actionbar state (#382) 6 years ago

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.