protected void testParser(Class parserClass, String[] headers) {
try {
for (int i = 0; i < headers.length; i++) {
System.out.print(headers[i]);
HeaderParser hp = createParser(parserClass, headers[i]);
SIPHeader hdr = (SIPHeader) hp.parse();
hp = createParser(parserClass, ((SIPHeader) hdr.clone()).encode().trim() + "\n");
System.out.println("Encoded header = " + hdr.encode());
assertEquals(hdr, hp.parse());
}
} catch (java.text.ParseException ex) {
ex.printStackTrace();
fail(getClass().getName());