verifyHeaders(message, new String[] {});
// one sequence header
message = setupOutboundMessage();
RMProperties rmps = RMContextUtils.retrieveRMProperties(message, true);
rmps.setSequence(s1);
codec.encode(message);
verifyHeaders(message, new String[] {RMConstants.SEQUENCE_NAME});
// one acknowledgment header
message = setupOutboundMessage();
rmps = RMContextUtils.retrieveRMProperties(message, true);
Collection<SequenceAcknowledgement> acks = new ArrayList<SequenceAcknowledgement>();
acks.add(ack1);
rmps.setAcks(acks);
codec.encode(message);
verifyHeaders(message, new String[] {RMConstants.SEQUENCE_ACK_NAME});
// two acknowledgment headers
message = setupOutboundMessage();
rmps = RMContextUtils.retrieveRMProperties(message, true);
acks.add(ack2);
rmps.setAcks(acks);
codec.encode(message);
verifyHeaders(message, new String[] {RMConstants.SEQUENCE_ACK_NAME,
RMConstants.SEQUENCE_ACK_NAME});
// one ack requested header
message = setupOutboundMessage();
rmps = RMContextUtils.retrieveRMProperties(message, true);
Collection<AckRequestedType> requested = new ArrayList<AckRequestedType>();
requested.add(ar1);
rmps.setAcksRequested(requested);
codec.encode(message);
verifyHeaders(message, new String[] {RMConstants.ACK_REQUESTED_NAME});
// two ack requested headers
message = setupOutboundMessage();
rmps = RMContextUtils.retrieveRMProperties(message, true);
requested.add(ar2);
rmps.setAcksRequested(requested);
codec.encode(message);
verifyHeaders(message, new String[] {RMConstants.ACK_REQUESTED_NAME,
RMConstants.ACK_REQUESTED_NAME});
}