becky mcelroy | 4 Mar 14:19 2010
Picon

Re: Regarding the header REASON and Methods UPDATE, PRACK, OPTION

Hi Mary Diana,

There are a few things to confirm on the first one:
- are you sure the last received response is what it should be? Call
assertResponseReceived() to check that. I'm seeing an immediate
improvement needed to SipUnit... currently that method just takes one
status code to check for, in your case it could be either 183 or 488.
There should be an additional signature for assertResponseReceived()
that takes a List of status codes, and the existing method changed to
call the new one. (would you mind submitting a SipUnit feature request
for this?)
- if the above is ok - is it possible that there are multiple Reason
headers in the message? The getHeader() call will just give you the
first one. (Of course, it could be that mul;tiple ones would be a
failure...) But you can call assertHeaderContains() to do the check
for you (these SIP assert methods are in SipTestCase class, recently
I've updated SipUnit for JUnit 4 so next release there'll be an
additional class SipAssert with all the same methods as static). It
will find all the headers of that type and see if there's at least one
with the string you specify.
- looks like there's some extra whitespace in your reason.contains()
call - you should remove that whitespace.
- is it failing because of case sensitivity?
- turn on sipunit trace and eyeball the message to see what's there

On the second issue:
Adding those into the high level SipCall class are on the TODO list
(http://www.cafesip.org/projects/sipunit/release_notes.html). In the
meantime, you can use low level SipSession methods to do it - see
http://www.cafesip.org/projects/sipunit/user_guide.html#mozTocId784534.
(Continue reading)


Gmane