// one sequence header
context = setupOutboundContext();
RMProperties rmps = RMContextUtils.retrieveRMProperties(context, true);
rmps.setSequence(s1);
assertTrue("expected dispatch to proceed", codec.handleMessage(context));
verifyHeaders(context, new String[] {Names.WSRM_SEQUENCE_NAME});
codec.close(context);
// one acknowledgment header
context = setupOutboundContext();
rmps = RMContextUtils.retrieveRMProperties(context, true);
Collection<SequenceAcknowledgement> acks = new ArrayList<SequenceAcknowledgement>();
acks.add(ack1);
rmps.setAcks(acks);
assertTrue("expected dispatch to proceed", codec.handleMessage(context));
verifyHeaders(context, new String[] {Names.WSRM_SEQUENCE_ACK_NAME});
// two acknowledgment headers
context = setupOutboundContext();
rmps = RMContextUtils.retrieveRMProperties(context, true);
acks.add(ack2);
rmps.setAcks(acks);
assertTrue("expected dispatch to proceed", codec.handleMessage(context));
verifyHeaders(context, new String[] {Names.WSRM_SEQUENCE_ACK_NAME, Names.WSRM_SEQUENCE_ACK_NAME});
// one ack requested header
context = setupOutboundContext();
rmps = RMContextUtils.retrieveRMProperties(context, true);
Collection<AckRequestedType> requested = new ArrayList<AckRequestedType>();
requested.add(ar1);
rmps.setAcksRequested(requested);
assertTrue("expected dispatch to proceed", codec.handleMessage(context));
verifyHeaders(context, new String[] {Names.WSRM_ACK_REQUESTED_NAME});
// two ack requested headers
context = setupOutboundContext();
rmps = RMContextUtils.retrieveRMProperties(context, true);
requested.add(ar2);
rmps.setAcksRequested(requested);
assertTrue("expected dispatch to proceed", codec.handleMessage(context));
verifyHeaders(context, new String[] {Names.WSRM_ACK_REQUESTED_NAME, Names.WSRM_ACK_REQUESTED_NAME});
}