db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r633599 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management: JMXTest.java MBeanTest.java
Date Tue, 04 Mar 2008 19:27:19 GMT
Author: djd
Date: Tue Mar  4 11:27:17 2008
New Revision: 633599

URL: http://svn.apache.org/viewvc?rev=633599&view=rev
Log:
DERBY-3385 Test MBeans through the platform mbean server, ie. from within the same virtual
machine using the same test fixtures as the remote tests.

Modified:
    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/MBeanTest.java

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=633599&r1=633598&r2=633599&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
Tue Mar  4 11:27:17 2008
@@ -21,15 +21,11 @@
 
 package org.apache.derbyTesting.functionTests.tests.management;
 
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.sql.SQLException;
 import java.util.Set;
 
 import javax.management.MBeanInfo;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
-import javax.sql.DataSource;
 
 import junit.framework.Test;
 
@@ -61,6 +57,9 @@
     public void testDerbyRegisteredMBeansSimpleInfo() throws Exception
     {        
         Set<ObjectName> derbyMBeans = getDerbyDomainMBeans();
+        
+        // We expect Derby to have registered MBeans.
+        assertTrue(derbyMBeans.size() > 0);
         
         MBeanServerConnection jmx = getMBeanServerConnection();
         for (ObjectName name : derbyMBeans)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/MBeanTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/MBeanTest.java?rev=633599&r1=633598&r2=633599&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/MBeanTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/MBeanTest.java
Tue Mar  4 11:27:17 2008
@@ -55,14 +55,20 @@
         
         TestSuite outerSuite = new TestSuite(suiteName);
         
+        Test platform = new TestSuite(testClass,  suiteName + ":platform");
+        
+        // Start the network server to ensure Derby is running and
+        // all the MBeans are running.
+        platform = TestConfiguration.clientServerDecorator(platform);
+        platform = JMXConnectionDecorator.platformMBeanServer(platform);
+        
         // TODO: Run with no security for the moment, requires changes in the
         // test policy files that may clash with a couple of outstanding patches.
-        Test platform = SecurityManagerSetup.noSecurityManager(
-                new TestSuite(testClass,  suiteName + ":platform"))
-                ;
-        platform = JMXConnectionDecorator.platformMBeanServer(platform);
-        // TODO: Disabled - failing at the moment when Derby has not been started.
-        //outerSuite.addTest(platform);
+        platform = SecurityManagerSetup.noSecurityManager(platform);
+        
+        // Set of tests that run within the same virtual machine using
+        // the platform MBeanServer directly.
+        outerSuite.addTest(platform);
         
         // Create a suite of all "test..." methods in the class.
         Test suite = new TestSuite(testClass,  suiteName + ":client");



Mime
View raw message