}
@Test
public void testMultipleLineHeaders() throws Exception
{
EventHandler handler = new EventHandler();
InputStream is = getClass().getResourceAsStream("/org/cipango/MultipleLineRequest.txt");
ByteArrayOutputStream os = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int read;
while ((read = is.read(buffer)) != -1)
{
os.write(buffer, 0, read);
}
SipParser parser = new SipParser(new ByteArrayBuffer(os.toByteArray()), handler);
parser.parse();
SipMessage message = handler.getMessage();
String toString = message.toString();
System.out.println(message);
assertEquals(1, count(toString, "Accept:"));
assertEquals(3, count(toString, "Via:"));