@Test
public void testGetParameterable() throws Exception
{
SipRequest request = (SipRequest) getMessage(INVITE);
Parameterable p = request.getParameterableHeader("from");
assertEquals("Bob <sips:bob@biloxi.example.com>", p.getValue());
assertEquals("a73kszlfl", p.getParameter("tag"));
// FIXME p = request.getParameterableHeader("Via");
p = request.getParameterableHeader("Accept");
assertEquals("application/sdp", p.getValue());
assertEquals("1", p.getParameter("level"));
ListIterator<? extends Parameterable> it = request.getParameterableHeaders("Accept");
while (it.hasNext())
{
int index = it.nextIndex();
p = (Parameterable) it.next();
switch (index)
{
case 0:
assertEquals("application/sdp", p.getValue());
assertEquals("1", p.getParameter("level"));
break;
case 1:
assertEquals("application/x-private", p.getValue());
assertFalse(p.getParameterNames().hasNext());
break;
case 2:
assertEquals("text/html", p.getValue());
assertFalse(p.getParameterNames().hasNext());
break;
default:
fail("Too much parameterable");
break;
}