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

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


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

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

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

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

        List<String> results = _monitor.findMatches("BND-1001");

        assertEquals("More than one bind creation found", 1, results.size());
View Full Code Here


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

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

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

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

        List<String> results = _monitor.findMatches("BND-1001");

        assertEquals("More than one bind creation found", 1, results.size());
View Full Code Here

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

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

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

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

        List<String> results = _monitor.findMatches("BND-1001");

        assertEquals("More than one bind creation found", 1, results.size());
View Full Code Here

    public void testDefaultBindings() throws Exception
    {
        int bindings = _queue.getBindingCount();
       
        Exchange exchange = _queue.getVirtualHost().getExchangeRegistry().getDefaultExchange();
        ManagedExchange mbean = (ManagedExchange) ((AbstractExchange) exchange).getManagedObject();
       
        mbean.createNewBinding(_queue.getName(), "robot");
        mbean.createNewBinding(_queue.getName(), "kitten");

        assertEquals("Should have added two bindings", bindings + 2, _queue.getBindingCount());
       
        mbean.removeBinding(_queue.getName(), "robot");

        assertEquals("Should have one extra binding", bindings + 1, _queue.getBindingCount());
       
        mbean.removeBinding(_queue.getName(), "kitten");

        assertEquals("Should have original number of binding", bindings, _queue.getBindingCount());
    }
View Full Code Here

    public void testTopicBindings() throws Exception
    {
        int bindings = _queue.getBindingCount();
       
        Exchange exchange = _queue.getVirtualHost().getExchangeRegistry().getExchange(new AMQShortString("amq.topic"));
        ManagedExchange mbean = (ManagedExchange) ((AbstractExchange) exchange).getManagedObject();
       
        mbean.createNewBinding(_queue.getName(), "robot.#");
        mbean.createNewBinding(_queue.getName(), "#.kitten");

        assertEquals("Should have added two bindings", bindings + 2, _queue.getBindingCount());
       
        mbean.removeBinding(_queue.getName(), "robot.#");

        assertEquals("Should have one extra binding", bindings + 1, _queue.getBindingCount());
       
        mbean.removeBinding(_queue.getName(), "#.kitten");

        assertEquals("Should have original number of binding", bindings, _queue.getBindingCount());
    }
View Full Code Here

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

        // test general exchange properties
        assertEquals("Unexpected exchange name", "amq.direct", mbean.getName());
        assertEquals("Unexpected exchange type", "direct", mbean.getExchangeType());
        assertEquals("Unexpected ticket number", Integer.valueOf(0), mbean.getTicketNo());
        assertFalse("Unexpected durable flag", mbean.isDurable());
        assertTrue("Unexpected auto delete flag", mbean.isAutoDelete());
    }
View Full Code Here

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

        mbean.createNewBinding(_queue.getNameShortString().toString(), "binding1");
        mbean.createNewBinding(_queue.getNameShortString().toString(), "binding2");

        TabularData data = mbean.bindings();
        ArrayList<Object> list = new ArrayList<Object>(data.values());
        assertTrue(list.size() == 2);
    }
View Full Code Here

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

        mbean.createNewBinding(_queue.getNameShortString().toString(), "binding1");
        mbean.createNewBinding(_queue.getNameShortString().toString(), "binding2");

        TabularData data = mbean.bindings();
        ArrayList<Object> list = new ArrayList<Object>(data.values());
        assertTrue(list.size() == 2);
    }
View Full Code Here

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

        mbean.createNewBinding(_queue.getNameShortString().toString(), "x-match=any,key1=binding1,key2=binding2");

        TabularData data = mbean.bindings();
        ArrayList<Object> list = new ArrayList<Object>(data.values());
        assertEquals("Unexpected number of bindings", 1, list.size());

        final Iterator<CompositeDataSupport> rowItr = (Iterator<CompositeDataSupport>) data.values().iterator();
        CompositeDataSupport row = rowItr.next();
View Full Code Here

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

        mbean.createNewBinding(_queue.getNameShortString().toString(), "x-match=any,key4,key5=");

        TabularData data = mbean.bindings();
        ArrayList<Object> list = new ArrayList<Object>(data.values());
        assertEquals("Unexpected number of bindings", 1, list.size());

        final Iterator<CompositeDataSupport> rowItr = (Iterator<CompositeDataSupport>) data.values().iterator();
        CompositeDataSupport row = rowItr.next();
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.