[asterisk-dev] [Code Review] Test for app_voicemail's VoiceMailMain that exercises new TestEvent AMI event

mjordan reviewboard at asterisk.org
Tue Aug 16 16:15:26 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1363/
-----------------------------------------------------------

(Updated Aug. 16, 2011, 4:15 p.m.)


Review request for Asterisk Developers, David Vossel and Paul Belanger.


Changes
-------

Refactored out the large if-block, and added some utility classes to help with managing the state changes coming in from the TestEvent notifications (state design pattern).  Note that using these classes is optional, as the TestEvent can be handled directly in any TestCase derived class.


Summary
-------

This review is part 2 of 2.  It demonstrates writing a test in the Asterisk Test Suite that takes advantage of the TestEvent in Asterisk to exercise functionality in a complex application.  The test does the following:

1. Calls into VoiceMailMain and enters a password (optionally, it would also do a user mailbox, but the dialplan takes care of that.  The test is 'smart enough' to recognize this)
2. Listens to an Urgent message, making sure that it hears the Urgent message first, then saves it to the old folder
3. Listens to two new messages, saving them to the old folder as well
4. Exits cleanly

This involves triggering off a number of events returned from app_voicemail, telling the test where it is in the sequence of playing voice prompts and what menu it happens to be in.  Since app_voicemail tends to recycle voice prompts in various places, the test 'helps itself' a few times, but by and large the states are driven completely off of what is being sent from the application itself.


Diffs (updated)
-----

  /asterisk/trunk/lib/python/asterisk/TestCase.py 1839 
  /asterisk/trunk/lib/python/asterisk/TestState.py PRE-CREATION 
  /asterisk/trunk/lib/python/asterisk/voicemail.py 1839 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/extensions.conf PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/manager.general.conf.inc PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/manager.users.conf.inc PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/sip.conf PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/voicemail.conf PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/extensions.conf PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/manager.general.conf.inc PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/manager.users.conf.inc PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/sip.conf PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/run-test PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/test-config.yaml PRE-CREATION 
  /asterisk/trunk/tests/apps/voicemail/tests.yaml 1839 

Diff: https://reviewboard.asterisk.org/r/1363/diff


Testing
-------


Thanks,

mjordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110816/c0dd297e/attachment.htm>


More information about the asterisk-dev mailing list