From commits-return-21094-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Fri Jan 4 20:24:17 2013 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55DFDDBA9 for ; Fri, 4 Jan 2013 20:24:17 +0000 (UTC) Received: (qmail 67843 invoked by uid 500); 4 Jan 2013 20:24:17 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 67818 invoked by uid 500); 4 Jan 2013 20:24:17 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 67809 invoked by uid 99); 4 Jan 2013 20:24:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 20:24:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2013 20:24:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6AC2723888D2; Fri, 4 Jan 2013 20:23:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1429089 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java Date: Fri, 04 Jan 2013 20:23:56 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130104202356.6AC2723888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Fri Jan 4 20:23:56 2013 New Revision: 1429089 URL: http://svn.apache.org/viewvc?rev=1429089&view=rev Log: fix test case after changes in https://issues.apache.org/jira/browse/AMQ-4237 broke the test's MBean lookup Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java?rev=1429089&r1=1429088&r2=1429089&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java Fri Jan 4 20:23:56 2013 @@ -57,28 +57,28 @@ public class DuplexNetworkMBeanTest { BrokerService broker = createBroker(); try { broker.start(); - assertEquals(1, countMbeans(broker, "Connector", 30000)); - assertEquals(0, countMbeans(broker, "Connection")); + assertEquals(1, countMbeans(broker, "connector", 30000)); + assertEquals(0, countMbeans(broker, "connectionName")); BrokerService networkedBroker = null; for (int i=0; i mbeans = null; + + if (!type.contains("=")) { + type = type + "=*"; + } + + final ObjectName beanName = new ObjectName("org.apache.activemq:type=Broker,brokerName=" + + broker.getBrokerName() + "," + type +",*"); + Set mbeans = null; int count = 0; do { if (timeout > 0) { Thread.sleep(100); } + LOG.info("Query name: " + beanName); mbeans = broker.getManagementContext().queryNames(beanName, null); if (mbeans != null) { @@ -141,9 +146,8 @@ public class DuplexNetworkMBeanTest { } } while ((mbeans == null || mbeans.isEmpty()) && expiryTime > System.currentTimeMillis()); - // If port 1099 is in use when the Broker starts, starting the jmx - // connector will fail. So, if we have no mbsc to query, skip the - // test. + // If port 1099 is in use when the Broker starts, starting the jmx connector + // will fail. So, if we have no mbsc to query, skip the test. if (timeout > 0) { assumeNotNull(mbeans); }