Package org.apache.qpid.server.store

Examples of org.apache.qpid.server.store.MessageStore


     * store after it has been reloaded. Both 0-8 and 0-10 metadata is used to
     * verify their ability to co-exist within the store and be successful retrieved.
     */
    public void testBDBMessagePersistence() throws Exception
    {
        MessageStore store = getVirtualHost().getMessageStore();

        AbstractBDBMessageStore bdbStore = assertBDBStore(store);

        // Create content ByteBuffers.
        // Split the content into 2 chunks for the 0-8 message, as per broker behaviour.
View Full Code Here


        return props;
    }

    public void testGetContentWithOffset() throws Exception
    {
        MessageStore store = getVirtualHost().getMessageStore();
        AbstractBDBMessageStore bdbStore = assertBDBStore(store);
        StoredMessage<MessageMetaData> storedMessage_0_8 = createAndStoreSingleChunkMessage_0_8(store);
        long messageid_0_8 = storedMessage_0_8.getMessageNumber();

        // normal case: offset is 0
View Full Code Here

     * interrogating the store with its own implementation methods and verifying
     * expected exceptions are thrown to indicate the message is not present.
     */
    public void testMessageCreationAndRemoval() throws Exception
    {
        MessageStore store = getVirtualHost().getMessageStore();
        AbstractBDBMessageStore bdbStore = assertBDBStore(store);

        StoredMessage<MessageMetaData> storedMessage_0_8 = createAndStoreSingleChunkMessage_0_8(store);
        long messageid_0_8 = storedMessage_0_8.getMessageNumber();

View Full Code Here

     * in the TransactionLog interface implemented by the store, and verifying the
     * behaviour using BDB implementation methods.
     */
    public void testTranCommit() throws Exception
    {
        MessageStore log = getVirtualHost().getMessageStore();

        AbstractBDBMessageStore bdbStore = assertBDBStore(log);

        final UUID mockQueueId = UUIDGenerator.generateRandomUUID();
        TransactionLogResource mockQueue = new TransactionLogResource()
        {
            @Override
            public UUID getId()
            {
                return mockQueueId;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(1L));
        txn.enqueueMessage(mockQueue, new MockMessage(5L));
        txn.commitTran();

View Full Code Here

     * implemented by the store, and verifying the behaviour using BDB
     * implementation methods.
     */
    public void testTranRollbackBeforeCommit() throws Exception
    {
        MessageStore log = getVirtualHost().getMessageStore();

        AbstractBDBMessageStore bdbStore = assertBDBStore(log);

        final UUID mockQueueId = UUIDGenerator.generateRandomUUID();
        TransactionLogResource mockQueue = new TransactionLogResource()
        {
            @Override
            public UUID getId()
            {
                return mockQueueId;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(21L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(22L));
        txn.enqueueMessage(mockQueue, new MockMessage(23L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);
View Full Code Here

        assertEquals("Second Message is incorrect", 23L, val.longValue());
    }

    public void testOnDelete() throws Exception
    {
        MessageStore log = getVirtualHost().getMessageStore();
        AbstractBDBMessageStore bdbStore = assertBDBStore(log);
        String storeLocation = bdbStore.getStoreLocation();

        File location = new File(storeLocation);
        assertTrue("Store does not exist at " + storeLocation, location.exists());
View Full Code Here

     * implemented by the store, and verifying the behaviour using BDB
     * implementation methods.
     */
    public void testTranRollbackAfterCommit() throws Exception
    {
        MessageStore log = getVirtualHost().getMessageStore();

        AbstractBDBMessageStore bdbStore = assertBDBStore(log);

        final UUID mockQueueId = UUIDGenerator.generateRandomUUID();
        TransactionLogResource mockQueue = new TransactionLogResource()
        {
            @Override
            public UUID getId()
            {
                return mockQueueId;
            }
        };

        Transaction txn = log.newTransaction();

        txn.enqueueMessage(mockQueue, new MockMessage(30L));
        txn.commitTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(31L));
        txn.abortTran();

        txn = log.newTransaction();
        txn.enqueueMessage(mockQueue, new MockMessage(32L));
        txn.commitTran();

        List<Long> enqueuedIds = bdbStore.getEnqueuedMessages(mockQueueId);

View Full Code Here

    public void testMessageStoreCreator()
    {
        MessageStoreCreator messageStoreCreator = new MessageStoreCreator();
        for (String type : STORE_TYPES)
        {
            MessageStore store = messageStoreCreator.createMessageStore(type);
            assertNotNull("Store of type " + type + " is not created", store);
        }
    }
View Full Code Here

    }

    @Override
    protected MessageStore createStore() throws Exception
    {
        MessageStore store = new BDBMessageStore();
        return store;
    }
View Full Code Here

        }

        final ServerSession serverSession = (ServerSession) ssn;
        if(!queues.isEmpty())
        {
            final MessageStore store = getVirtualHost(ssn).getMessageStore();
            final StoredMessage<MessageMetaData_0_10> storeMessage = createStoreMessage(xfr, messageMetaData, store);
            MessageTransferMessage message = new MessageTransferMessage(storeMessage, serverSession.getReference());
            serverSession.enqueue(message, queues);
            storeMessage.flushToStore();
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.MessageStore

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.