hdr=new RequestCorrelator.Header(RequestCorrelator.Header.REQ, 322649, false, "HelloWorld");
_testSize(hdr);
hdr=new RequestCorrelator.Header(RequestCorrelator.Header.RSP, 322649, true, "bla");
java.util.List l=new LinkedList();
l.add(new IpAddress(1111));
l.add(new IpAddress(2222));
hdr.dest_mbrs=l;
hdr.callStack=new Stack();
hdr.callStack.push(new IpAddress(2222));
hdr.callStack.push(new IpAddress(3333));
_testSize(hdr);
hdr=new RequestCorrelator.Header(RequestCorrelator.Header.RSP, 322649, true, "bla");
hdr.callStack=new Stack();
hdr.callStack.push(new IpAddress(2222));
hdr.callStack.push(new IpAddress(3333));
ByteArrayOutputStream output=new ByteArrayOutputStream();
DataOutputStream out=new DataOutputStream(output);
hdr.writeTo(out);
out.flush();
byte[] buf=output.toByteArray();
out.close();
ByteArrayInputStream input=new ByteArrayInputStream(buf);
DataInputStream in=new DataInputStream(input);
hdr=new RequestCorrelator.Header();
hdr.readFrom(in);
System.out.println("call stack is " + hdr.callStack);
Address tmp=(Address)hdr.callStack.pop();
assertEquals(tmp, new IpAddress(3333));
tmp=(Address)hdr.callStack.pop();
assertEquals(tmp, new IpAddress(2222));
assertEquals(322649, hdr.id);
assertTrue(hdr.rsp_expected);
assertEquals("bla", hdr.corrName);
assertEquals(hdr.type, RequestCorrelator.Header.RSP);
}