Package org.apache.qpid.management.common.mbeans

Examples of org.apache.qpid.management.common.mbeans.ManagedExchange


    public void testInvalidHeaderBindingMalformed() throws Exception
    {
        HeadersExchange exchange = new HeadersExchange();
        exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
        ManagedObject managedObj = exchange.getManagedObject();
        ManagedExchange mbean = (ManagedExchange)managedObj;

        try
        {
            mbean.createNewBinding(_queue.getNameShortString().toString(), "x-match=any,=value4");
            fail("Exception not thrown");
        }
        catch (JMException jme)
        {
            //pass
View Full Code Here


        //Remove any previous queue declares
        _monitor.markDiscardPoint();

        _jmxUtils.createQueue("test", getName(), null, false);

        ManagedExchange managedExchange = _jmxUtils.getManagedExchange("amq.direct");

        managedExchange.createNewBinding(getName(), getName());

        List<String> results = waitAndFindMatches("BND-1001");

        assertEquals("Unexpected number of bindings logged", 2, results.size());
View Full Code Here

        //Remove any previous queue declares
        _monitor.markDiscardPoint();

        _jmxUtils.createQueue("test", getName(), null, false);

        ManagedExchange managedExchange = _jmxUtils.getManagedExchange("amq.topic");

        managedExchange.createNewBinding(getName(), getName());

        List<String> results = waitAndFindMatches("BND-1001");

        assertEquals("Unexpected number of bindings logged", 2, results.size());
View Full Code Here

        //Remove any previous queue declares
        _monitor.markDiscardPoint();

        _jmxUtils.createQueue("test", getName(), null, false);

        ManagedExchange managedExchange = _jmxUtils.getManagedExchange("amq.fanout");

        managedExchange.createNewBinding(getName(), getName());

        List<String> results = waitAndFindMatches("BND-1001");

        assertEquals("Unexpected number of bindings logged", 2, results.size());
View Full Code Here

     * Tests queue creation/deletion also verifying the automatic binding to the default exchange.
     */
    public void testCreateQueueAndDeletion() throws Exception
    {
        final String queueName = getTestQueueName();
        final ManagedExchange defaultExchange = _jmxUtils.getManagedExchange(ExchangeDefaults.DEFAULT_EXCHANGE_NAME.asString());

        // Check that bind does not exist before queue creation
        assertFalse("Binding to " + queueName + " should not exist in default exchange before queue creation",
                     defaultExchange.bindings().containsKey(new String[] {queueName}));

        _managedBroker.createNewQueue(queueName, "testowner", true);

        // Ensure the queue exists
        assertNotNull("Queue object name expected to exist", _jmxUtils.getQueueObjectName("test", queueName));
        assertNotNull("Manager queue expected to be available", _jmxUtils.getManagedQueue(queueName));

        // Now verify that the default exchange has been bound.
        assertTrue("Binding to " + queueName + " should exist in default exchange after queue creation",
                     defaultExchange.bindings().containsKey(new String[] {queueName}));

        // Now delete the queue
        _managedBroker.deleteQueue(queueName);

        // Finally ensure that the binding has been removed.
        assertFalse("Binding to " + queueName + " should not exist in default exchange after queue deletion",
                defaultExchange.bindings().containsKey(new String[] {queueName}));
    }
View Full Code Here

        String exchangeName = getTestName();
        _managedBroker.createNewExchange(exchangeName, "topic", true);
        String queryString = "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost="
                + ObjectName.quote(VIRTUAL_HOST) + ",name=" + ObjectName.quote(exchangeName) + ",ExchangeType="
                + EXCHANGE_TYPE;
        ManagedExchange exchange = _jmxUtils.getManagedObject(ManagedExchange.class, queryString);
        assertNotNull("Exchange should exist", exchange);

        _managedBroker.unregisterExchange(exchangeName);
        assertFalse("Exchange should have been removed", _jmxUtils.isManagedObjectExist(queryString));
    }
View Full Code Here

        {
            // PASS
            assertEquals("Error in unregistering exchange " + defaultExchangeName, mbe.getMessage());
            assertTrue(mbe.getCause().getMessage().contains("Cannot unregister the default exchange"));
        }
        final ManagedExchange defaultExchange = _jmxUtils.getManagedExchange(defaultExchangeName);
        assertNotNull("Exchange should exist", defaultExchange);
    }
View Full Code Here

        }

        try
        {
            //verify the DLE exchange exists, has the expected type, and a single binding for the DLQ
            ManagedExchange exchange = jmxUtils.getManagedExchange(QUEUE_WITH_DLQ_NAME + "_DLE");
            assertEquals("Wrong exchange type", "fanout", exchange.getExchangeType());
            TabularDataSupport bindings = (TabularDataSupport) exchange.bindings();
            assertEquals(1, bindings.size());
            for(Object o : bindings.values())
            {
                CompositeData binding = (CompositeData) o;
View Full Code Here

TOP

Related Classes of org.apache.qpid.management.common.mbeans.ManagedExchange

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.