[asterisk-dev] [Code Review] Test for app_voicemail's VoiceMailMain that exercises new TestEvent AMI event
mjordan
reviewboard at asterisk.org
Fri Aug 19 11:28:14 CDT 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1363/#review4099
-----------------------------------------------------------
/asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/extensions.conf
<https://reviewboard.asterisk.org/r/1363/#comment8051>
I agree, but I'm not sure what else to do here. The Wait() ensures that the UserEvent is delivered to the test suite prior to the channel being hanged up. Without it, I noticed that the UserEvents failed to get delivered.
/asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/run-test
<https://reviewboard.asterisk.org/r/1363/#comment8053>
The ordering in these blocks is typically going to try to match the order in which the statements come back from app_voicemail (although they aren't always in the same order, so it's a rule that's bound to be broken)
In this case this is backwards, so I'll switch it - but there are going to be times when the code makes more sense with the larger blobs in the middle or end.
Think of these if-elif blocks less of a binary conditional test and more as a switch statement.
/asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/run-test
<https://reviewboard.asterisk.org/r/1363/#comment8052>
Not that I like repeating myself in code, but doing that does two things:
1. It breaks the OO pattern by tying the concrete implementations to definitions in the base class
2. It ties the test tighter to what is defined in app_voicemail - the test is more likely to be a subset of the states that are possible in app_voicemail, rather than there being a perfect one to one correlation
As it is, I could use the python class name instead of having this method, but that can get a little tricky to print out (and isn't always as nicely formatted)
- mjordan
On Aug. 16, 2011, 4:55 p.m., mjordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1363/
> -----------------------------------------------------------
>
> (Updated Aug. 16, 2011, 4:55 p.m.)
>
>
> Review request for Asterisk Developers, David Vossel and Paul Belanger.
>
>
> 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
> -----
>
> /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/20110819/8fb2d0fd/attachment-0001.htm>
More information about the asterisk-dev
mailing list