Examples of onDataChanged()


Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

        /**
         * Test broker root node event, should ignore
         */
        changeMap.put("", "".getBytes());
        brokerFarm.onDataChanged("/broker", changeMap);
        assertTrue(brokerFarm.getAllBrokers().isEmpty());

        /**
         * Test add broker
         */
 
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

         * Test add broker
         */
        changeMap.clear();
        ZooKeeperInfo.Broker brkNode = genBrokerInfo("127.0.0.1", 7676, true, "OpenMQ", false);
        changeMap.put("127.0.0.1", brkNode.toString().getBytes());
        brokerFarm.onDataChanged("/broker", changeMap);
        assertEquals(brkNode, brokerFarm.getBrokerByHost("127.0.0.1"));

        /**
         * Test add loading
         */
 
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

         * Test add loading
         */
        changeMap.clear();
        ZooKeeperInfo.Loading loadingNode = genBrokerLoading(10);
        changeMap.put("127.0.0.1/loading", loadingNode.toString().getBytes());
        brokerFarm.onDataChanged("/broker", changeMap);
        assertEquals(brkNode, brokerFarm.getBrokerByHost("127.0.0.1"));
        assertEquals(loadingNode, brokerFarm.getAllLoading().get("127.0.0.1"));
        assertEquals(1, brokerFarm.getBrokerCount());

        /**
 
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

        /**
         * Test remove loading
         */
        changeMap.clear();
        changeMap.put("127.0.0.1/loading", null);
        brokerFarm.onDataChanged("/broker", changeMap);
        assertTrue(brokerFarm.getAllLoading().isEmpty());

        /**
         * Test remove broker
         */
 
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

        /**
         * Test remove broker
         */
        changeMap.clear();
        changeMap.put("127.0.0.1", null);
        brokerFarm.onDataChanged("/broker", changeMap);
        assertTrue(brokerFarm.getAllBrokers().isEmpty());
        assertEquals(0, brokerFarm.getBrokerCount());

        /**
         * Test add multiple nodes
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

         * Test add multiple nodes
         */
        changeMap.clear();
        changeMap.put("127.0.0.1", brkNode.toString().getBytes());
        changeMap.put("127.0.0.1/loading", loadingNode.toString().getBytes());
        brokerFarm.onDataChanged("/broker", changeMap);
        assertEquals(brkNode, brokerFarm.getBrokerByHost("127.0.0.1"));
        assertEquals(loadingNode, brokerFarm.getAllLoading().get("127.0.0.1"));
        assertEquals(1, brokerFarm.getBrokerCount());

        /**
 
View Full Code Here

Examples of com.trendmicro.tme.mfr.BrokerFarm.onDataChanged()

         * Test remove multiple nodes
         */
        changeMap.clear();
        changeMap.put("127.0.0.1", null);
        changeMap.put("127.0.0.1/loading", null);
        brokerFarm.onDataChanged("/broker", changeMap);
        assertTrue(brokerFarm.getAllBrokers().isEmpty());
        assertTrue(brokerFarm.getAllLoading().isEmpty());
        assertEquals(0, brokerFarm.getBrokerCount());
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.