Body of the test 1.
Test for "parameter-less" headers.
SipHeader sh;
String headerName;
for (int i = 0; i < parameterLessHeaders.length; i++) {
headerName = parameterLessHeaders[i];
sh = createSipHeader(headerName, "INVITE;test=10");
assertTrue("Cannot create '" + headerName + "' header!",
sh != null);
// Ensure that the header was not parsed
assertTrue("Header '" + headerName + "' was parsed!",
sh.getValue().equals(sh.getHeaderValue()));
String[] paramNames = sh.getParameterNames();
assertTrue("'" + headerName + "' header must not have " +
"any parameters!", paramNames == null);
String param = sh.getParameter("test");
assertTrue("'" + headerName + "' header has not parameter 'test'!",
param == null);
try {
sh.setParameter("test", "1");
fail("IAE was not thrown!");
} catch (IllegalArgumentException iae) {
// System.out.println(headerName + " OK!");
} catch (Exception e) {
fail("Exception was caught: " + e);
}
} // end for()