db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r634147 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/services/jmx/ testing/org/apache/derbyTesting/functionTests/tests/management/
Date Thu, 06 Mar 2008 04:00:09 GMT
Author: djd
Date: Wed Mar  5 20:00:08 2008
New Revision: 634147

URL: http://svn.apache.org/viewvc?rev=634147&view=rev
Log:
DERBY-3499 Ensure Derby's ManagementMBean is registered on a startManagement call if it is
not currently registered.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JMXTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java?rev=634147&r1=634146&r2=634147&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java
Wed Mar  5 20:00:08 2008
@@ -339,7 +339,8 @@
             // If we registered this as a management bean
             // then leave it registered to allow the mbeans
             // to be re-registered with JMX
-            if (mbeanName.equals(myManagementBean))
+            if (mbeanName.equals(myManagementBean) &&
+                    mbeanServer.isRegistered(myManagementBean))
                 continue;
             
             try {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JMXTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JMXTest.java?rev=634147&r1=634146&r2=634147&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JMXTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JMXTest.java
Wed Mar  5 20:00:08 2008
@@ -58,8 +58,11 @@
     {        
         Set<ObjectName> derbyMBeans = getDerbyDomainMBeans();
         
-        // We expect Derby to have registered MBeans.
-        assertTrue(derbyMBeans.size() > 0);
+        // We expect Derby to have registered MBeans
+        // including a management MBean and the one registered
+        // by our setUp method.
+        assertTrue("Derby MBEan count:" + derbyMBeans.size(),
+                derbyMBeans.size() >= 2);
         
         MBeanServerConnection jmx = getMBeanServerConnection();
         for (ObjectName name : derbyMBeans)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java?rev=634147&r1=634146&r2=634147&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/ManagementMBeanTest.java
Wed Mar  5 20:00:08 2008
@@ -66,7 +66,7 @@
         assertBooleanAttribute(true, mbean, "ManagementActive");
         
         int derbyMbeanCount = getDerbyDomainMBeans().size();
-        assertTrue(derbyMbeanCount > 0);
+        assertTrue("DerbyMBeanCount:" + derbyMbeanCount, derbyMbeanCount >= 2);
         
         // Should be a no-op
         invokeOperation(mbean, "startManagement");



Mime
View raw message