Output Tester

Kushal Kant Goyal edited this page Jun 25, 2015 · 6 revisions
Clone this wiki locally

The output tester is a program that can be used after deploying aidr-output, to test this module independently of the other modules.

It only requires the aidr-output module to be deployed.

Command line

The output tester is run through the following command:

mvn test -Dtest=OutputTesterTest PARAMETERS

These parameters are optional:

-DnItems=NUMBER (default 2000)

The config is the name of the output configuration (or of a centralized configuration) to read properties that the tester needs to know to perform the testing: the URL of the output's API, and the name of the REDIS queue from which output reads.

The nItems is the number of items that should be written to the persister. It should be strictly greater than GetBufferedAIDRData.MAX_MESSAGES_COUNT so that we can appreciate the effects of the buffer.


The output test should generate a collection name as YYYYMMDDhhssmm-output-test. It should also generate synthetic Twitter messages with fixed random texts and random tweetids. It should keep those messages in memory for the duration of the text.

  1. Write to REDIS nItems items in the channel expected by output, if it fails, FAIL.
  2. Call the /crisis/fetch/channel/{crisisCode} API, if it fails, FAIL.
  3. Read from that API the returned tweets, if the number of messages is different from MAX_MESSAGES_COUNT (i.e. if it is greater than or less than MAX_MESSAGES_COUNT), FAIL.
  4. Compare all the tweets received with the latest MAX_MESSAGES_COUNT tweets sent. If any of them is different, FAIL.
  5. If this point is reached, exit with success code.

FAIL means printing a clear and informative message describing the condition and exiting with code 1 (non success).

On interrupt by the user, no action is needed.