Package org.apache.qpid.server.message

Examples of org.apache.qpid.server.message.EnqueableMessage


    private Record getTestRecord(long messageNumber)
    {
        UUID queueId1 = UUIDGenerator.generateRandomUUID();
        TransactionLogResource queue1 = mock(TransactionLogResource.class);
        when(queue1.getId()).thenReturn(queueId1);
        EnqueableMessage message1 = mock(EnqueableMessage.class);
        when(message1.isPersistent()).thenReturn(true);
        when(message1.getMessageNumber()).thenReturn(messageNumber);
        final StoredMessage storedMessage = mock(StoredMessage.class);
        when(storedMessage.getMessageNumber()).thenReturn(messageNumber);
        when(message1.getStoredMessage()).thenReturn(storedMessage);
        Record enqueueRecord = new TestRecord(queue1, message1);
        return enqueueRecord;
    }
View Full Code Here


        Transaction transaction = _store.newTransaction();

        List<EnqueableMessage> messages = new ArrayList<EnqueableMessage>();
        for (int i = 0; i < getNumberOfMessagesToFillStore(); i++)
        {
            EnqueableMessage m = addMessage(i);
            messages.add(m);
            transaction.enqueueMessage(this, m);
        }
        transaction.commitTran();

        assertEvent(1, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL);

        for (EnqueableMessage m : messages)
        {
            m.getStoredMessage().remove();
        }

        assertEvent(2, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
    }
View Full Code Here

    private Record getTestRecord(long messageNumber)
    {
        UUID queueId1 = UUIDGenerator.generateRandomUUID();
        TransactionLogResource queue1 = mock(TransactionLogResource.class);
        when(queue1.getId()).thenReturn(queueId1);
        EnqueableMessage message1 = mock(EnqueableMessage.class);
        when(message1.isPersistent()).thenReturn(true);
        when(message1.getMessageNumber()).thenReturn(messageNumber);
        when(message1.getStoredMessage()).thenReturn(new MockStoredMessage(messageNumber));
        Record enqueueRecord = new TestRecord(queue1, message1);
        return enqueueRecord;
    }
View Full Code Here

        Transaction transaction = _store.newTransaction();

        List<EnqueableMessage> messages = new ArrayList<EnqueableMessage>();
        for (int i = 0; i < getNumberOfMessagesToFillStore(); i++)
        {
            EnqueableMessage m = addMessage(i);
            messages.add(m);
            transaction.enqueueMessage(this, m);
        }
        transaction.commitTran();

        assertEvent(1, Event.PERSISTENT_MESSAGE_SIZE_OVERFULL);

        for (EnqueableMessage m : messages)
        {
            m.getStoredMessage().remove();
        }

        assertEvent(2, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
    }
View Full Code Here

    private Record getTestRecord(long messageNumber)
    {
        UUID queueId1 = UUIDGenerator.generateRandomUUID();
        TransactionLogResource queue1 = mock(TransactionLogResource.class);
        when(queue1.getId()).thenReturn(queueId1);
        EnqueableMessage message1 = mock(EnqueableMessage.class);
        when(message1.isPersistent()).thenReturn(true);
        when(message1.getMessageNumber()).thenReturn(messageNumber);
        when(message1.getStoredMessage()).thenReturn(new MockStoredMessage(messageNumber));
        Record enqueueRecord = new TestRecord(queue1, message1);
        return enqueueRecord;
    }
View Full Code Here

                {
                    return queueName.asString();
                }
            };

            EnqueableMessage mockMessage = new EnqueableMessage()
            {
   
                public long getMessageNumber()
                {
                    return messageId;
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.message.EnqueableMessage

Copyright © 2018 www.massapicom. 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.