Package org.apache.qpid.server.store

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


    private TestableMemoryMessageStore _store;


    protected void setUp() throws Exception
    {
        _store = new TestableMemoryMessageStore();
    }
View Full Code Here


    // todo: collect to a general testing class -duplicated from Systest/MessageReturntest
    private void verifyBrokerState()
    {

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) _virtualHost.getMessageStore());

        // Unlike MessageReturnTest there is no need for a delay as there this thread does the clean up.
        assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());      
        assertEquals("Expected the store to have no content:" + store.getContentBodyMap(), 0, store.getContentBodyMap().size());
        assertNotNull("MessageMetaDataMap should not be null", store.getMessageMetaDataMap());
        assertEquals("Expected the store to have no metadata:" + store.getMessageMetaDataMap(), 0, store.getMessageMetaDataMap().size());
    }
View Full Code Here

        private final List<Long> _unacked;
        private StoreContext _storeContext = new StoreContext();

        Scenario(int messageCount, List<Long> acked, List<Long> unacked)
        {
            TransactionalContext txnContext = new NonTransactionalContext(new TestableMemoryMessageStore(),
                                                                          _storeContext, null,
                                                                          new LinkedList<RequiredDeliveryException>(),
                                                                          new HashSet<Long>());
            for (int i = 0; i < messageCount; i++)
            {
View Full Code Here

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());

        _initialContentBodyMapSize = store.getContentBodyMap() == null ? 0 : store.getContentBodyMap().size();
        _initilaMessageMetaDataMapSize = store.getMessageMetaDataMap() == null ? 0 : store.getMessageMetaDataMap().size();

        if (_initialContentBodyMapSize != 0)
        {
            _logger.warn("Store is dirty: ContentBodyMap has Size:" + _initialContentBodyMapSize);
            System.out.println("Store is dirty: ContentBodyMap has Size:" + _initialContentBodyMapSize);
View Full Code Here

        VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);

        assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());


        assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());

        // If the CBM has content it may be due to the broker not yet purging.
        // Closing the producer connection before testing should give the store time to clean up.
        // Perform a quick sleep just in case
        while (store.getContentBodyMap().size() > _initialContentBodyMapSize)
        {
            try
            {
                Thread.sleep(500);
            }
            catch (InterruptedException e)
            {
            }
        }
        assertTrue("Expected the store content size not reached at test start it was :" + _initialContentBodyMapSize + " Now it is :" + store.getContentBodyMap().size(), _initialContentBodyMapSize >= store.getContentBodyMap().size());
        assertNotNull("MessageMetaDataMap should not be null", store.getMessageMetaDataMap());
        assertTrue("Expected the store MessageMetaData size not reached at test start it was :" + _initilaMessageMetaDataMapSize + " Now it is :" + store.getMessageMetaDataMap().size(), _initialContentBodyMapSize >= store.getMessageMetaDataMap().size());
    }
View Full Code Here

        _vHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
        _queueRegistry = _vHost.getQueueRegistry();
        _exchangeFactory = _vHost.getExchangeFactory();
        _exchangeRegistry = _vHost.getExchangeRegistry();

        _messageStore = new TestableMemoryMessageStore();

        _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
    }
View Full Code Here

    private TestableMemoryMessageStore _store;


    protected void setUp() throws Exception
    {
        _store = new TestableMemoryMessageStore();
    }
View Full Code Here

        // Create ACLManager
       
        _pluginManager = new MockPluginManager("");
        _authzManager = new ACLManager(_conf, _pluginManager);
       
        _session = new MockProtocolSession(new TestableMemoryMessageStore());
    }
View Full Code Here

    private AMQMinaProtocolSession _session;

    @Override
    public void setUp() throws Exception
    {
        _store = new TestableMemoryMessageStore();
        PropertiesConfiguration env = new PropertiesConfiguration();
        _virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env));
        TestIoSession iosession = new TestIoSession();
        iosession.setAddress("127.0.0.1");
        VirtualHostRegistry virtualHostRegistry = null;
View Full Code Here

    // todo: collect to a general testing class -duplicated from Systest/MessageReturntest
    private void verifyBrokerState()
    {

        TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) _virtualHost.getMessageStore());

        // Unlike MessageReturnTest there is no need for a delay as there this thread does the clean up.
        assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());      
        assertEquals("Expected the store to have no content:" + store.getContentBodyMap(), 0, store.getContentBodyMap().size());
        assertNotNull("MessageMetaDataMap should not be null", store.getMessageMetaDataMap());
        assertEquals("Expected the store to have no metadata:" + store.getMessageMetaDataMap(), 0, store.getMessageMetaDataMap().size());
    }
View Full Code Here

TOP

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

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.