File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/test/com/mongodb/tools Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,23 @@ public class ConnectionPoolStatTest extends TestCase {
28
28
29
29
@ Test
30
30
public void testBasic () throws IOException , JMException {
31
+ if (!isAtLeastJava6 ()) {
32
+ return ;
33
+ }
31
34
ConnectionPoolStat stat = new ConnectionPoolStat ();
32
35
String stats = stat .getStats ();
33
36
assertNotNull (stats );
34
37
DBObject obj = (DBObject ) JSON .parse (stats );
35
38
assertNotNull (obj );
36
39
}
40
+
41
+ private boolean isAtLeastJava6 () {
42
+ String javaSpecificationVersion = System .getProperty ("java.specification.version" );
43
+ String minorVersionString = javaSpecificationVersion .substring (javaSpecificationVersion .lastIndexOf ("." ) + 1 );
44
+ try {
45
+ return Integer .parseInt (minorVersionString ) >= 6 ;
46
+ } catch (NumberFormatException e ) {
47
+ return false ;
48
+ }
49
+ }
37
50
}
You can’t perform that action at this time.
0 commit comments