public void setUp() throws QueueException {
SandeshaQueue sq = SandeshaQueue.getInstance(Constants.CLIENT);
ClientStorageManager csm = new ClientStorageManager();
RMMessageContext msg = new RMMessageContext();
//Creating a new outgoing sequence.
sq.createNewOutgoingSequence("seqid1");
//Adding messages to the outgoing sequence.
//Adding message 1
long nextMsgNo = csm.getNextMessageNumber("seqid1");
assertEquals(nextMsgNo, 1);
msg.setMessageID("rmsg1");
msg.setSequenceID("seqid1");
msg.setMsgNumber(nextMsgNo);
sq.addMessageToOutgoingSequence("seqid1", msg);
//Adding message 2
nextMsgNo = csm.getNextMessageNumber("seqid1");
assertEquals(nextMsgNo, 2);
msg = new RMMessageContext();
msg.setMessageID("rmsg2");
msg.setSequenceID("seqid1");
msg.setMsgNumber(nextMsgNo);
sq.addMessageToOutgoingSequence("seqid1", msg);
//Adding message 3
nextMsgNo = csm.getNextMessageNumber("seqid1");
assertEquals(nextMsgNo, 3);
msg = new RMMessageContext();
msg.setMessageID("rmsg3");
msg.setSequenceID("seqid1");
msg.setMsgNumber(nextMsgNo);
//Adding message 4
sq.addMessageToOutgoingSequence("seqid1", msg);
nextMsgNo = csm.getNextMessageNumber("seqid1");
assertEquals(nextMsgNo, 4);
msg = new RMMessageContext();
msg.setMessageID("rmsg4");
msg.setSequenceID("seqid1");
msg.setMsgNumber(nextMsgNo);
sq.addMessageToOutgoingSequence("seqid1", msg);
}