Examples of SandeshaQueue


Examples of org.apache.sandesha.storage.queue.SandeshaQueue

public class TCClientStorageManager extends TestCase {

    //For testing weather messages are re-transmitted correctly
    public void testRetransmission() {

        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.CLIENT);
        ClientStorageManager csm = new ClientStorageManager();
        RMMessageContext msg1;
       
        //approving the out sequence
        csm.setTemporaryOutSequence("seqid1", "uuid:aaaa-bbbb-cccc");
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    }

    //Testing weather the tr-transmission stops after a acknowledgement
    public void testAcknowledgement() {
        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.CLIENT);
        ClientStorageManager csm = new ClientStorageManager();

        csm.setTemporaryOutSequence("seqid1", "uuid:aaaa-bbbb-cccc");
        csm.setApprovedOutSequence("uuid:aaaa-bbbb-cccc", "approved1");
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    }*/
   
   
    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);
    }
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

public class TCServerStorageManager extends TestCase {

    //For testing weather messages are re-transmitted correctly
    public void testRetransmission() {

        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();
        RMMessageContext msg1;

//approving the out sequence
        csm.setTemporaryOutSequence("seqid1", "uuid:aaaa-bbbb-cccc");
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    }


    //Testing weather the tr-transmission stops after a acknowledgement
    public void testAcknowledgement() {
        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();

        csm.setTemporaryOutSequence("seqid1", "uuid:aaaa-bbbb-cccc");
        csm.setApprovedOutSequence("uuid:aaaa-bbbb-cccc", "approved1");
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

        assertNull(msg1);
    }

    //For testing weather getNextMsgToSend method works correctly
    public void testNextMsgToSend() {
        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();
        RMMessageContext msg1;
       
        //Next message to sent should be null (before approving outsequence)
        msg1 = csm.getNextMessageToSend();
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    }

    //Testing weather the out-sequence concept works correctly.
    //Outgoing messages should be sent only when the out sequence is approved.
    public void testOutSequence() {
        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();
       
        //setting temporary out sequence
        csm.setTemporaryOutSequence("seqid1", "uuid:aaaa-bbbb-cccc");
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    //Testing weather priority messages are sent correctly.
    //They should be sent before application messages and should be sent
    //even before the out-sequence get set.
    public void testPriorityQueue() {
        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();
       
        //Addign a create sequence request message (this will be added to the priority
        //area of the storage)
        RMMessageContext createSeqReq1 = new RMMessageContext();
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue

    }


    public void setUp() throws QueueException {

        SandeshaQueue sq = SandeshaQueue.getInstance(Constants.SERVER);
        ServerStorageManager csm = new ServerStorageManager();
        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);
    }
View Full Code Here

Examples of org.apache.sandesha.storage.queue.SandeshaQueue


    public boolean addIncomingSequence(String sequenceId) {
        boolean result = false;
        try {
            SandeshaQueue sq = SandeshaQueue.getInstance(endPoint);
            sq.createNewIncomingSequence(sequenceId);
            result = true;
        } catch (QueueException e) {
            SandeshaQueueDAO.log.error(e);
        }
        return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.