db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1211266 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java
Date Wed, 07 Dec 2011 01:44:42 GMT
Author: dag
Date: Wed Dec  7 01:44:41 2011
New Revision: 1211266

URL: http://svn.apache.org/viewvc?rev=1211266&view=rev
Log:
DERBY-5521 JDBCMBeanTest#testAttributeDriverLevel uses Java assert in lieu of JUnit assert:
no real testing happens

Patch derby-5521b which fixes this issue.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java?rev=1211266&r1=1211265&r2=1211266&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/management/JDBCMBeanTest.java
Wed Dec  7 01:44:41 2011
@@ -98,17 +98,24 @@ public class JDBCMBeanTest extends MBean
     public void testAttributeDriverLevel() throws Exception {
         // get JDBC version from DatabaseMetaData for comparison
         DatabaseMetaData dmd = getConnection().getMetaData();
-        String JDBCVersion = "" + dmd.getJDBCMajorVersion() + 
+
+        String JDBCVersion =
             dmd.getJDBCMajorVersion() + "." +
             dmd.getJDBCMinorVersion();
+
+        String driverLevelString = (String)getAttribute(
+            getJdbcMBeanObjectName(),
+            "DriverLevel");
+
         println("DatabaseMetaDataJDBCLevel = " + JDBCVersion);
-        ObjectName driverLevel = getJdbcMBeanObjectName();
-        String driverLevelString = driverLevel.toString();
         println("MBean driverLevel  = " + driverLevelString);
-       
-        assert(driverLevelString.indexOf('?') == -1);
-        assert(driverLevelString.matches("^JRE - JDBC: " + JDBCVersion + ".*"));
 
+        assertEquals(
+            "Unexpected driver level string: " + driverLevelString,
+            -1, driverLevelString.indexOf('?'));
+        assertTrue(
+            "Unexpected driver level string: " + driverLevelString,
+             driverLevelString.matches("^Java SE .*JDBC .*" + JDBCVersion));
     }
     
     /**



Mime
View raw message