7146552: java/util/logging/LoggingMXBeanTest.java failing intermittently
authorjgish
Sat, 13 Oct 2012 10:15:57 +0100
changeset 14181 f723098d438c
parent 14180 66f6161a0bcb
child 14182 3041082abb40
7146552: java/util/logging/LoggingMXBeanTest.java failing intermittently Reviewed-by: alanb, mchung
jdk/test/java/util/logging/LoggingMXBeanTest.java
jdk/test/java/util/logging/LoggingMXBeanTest2.java
--- a/jdk/test/java/util/logging/LoggingMXBeanTest.java	Fri Oct 12 14:52:24 2012 -0700
+++ b/jdk/test/java/util/logging/LoggingMXBeanTest.java	Sat Oct 13 10:15:57 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,8 @@
     ObjectName objectName = null;
     static String LOGGER_NAME_1 = "com.sun.management.Logger1";
     static String LOGGER_NAME_2 = "com.sun.management.Logger2";
+    static Logger logger1;
+    static Logger logger2;
 
     public LoggingMXBeanTest() throws Exception {
 
@@ -131,8 +133,8 @@
         System.out.println( "*********** Phase 3 ***********" );
         System.out.println( "*******************************" );
         System.out.println( " Create and test new Loggers" );
-        Logger logger1 = Logger.getLogger( LOGGER_NAME_1 );
-        Logger logger2 = Logger.getLogger( LOGGER_NAME_2 );
+        logger1 = Logger.getLogger( LOGGER_NAME_1 );
+        logger2 = Logger.getLogger( LOGGER_NAME_2 );
 
         // check that Level object are returned properly
         try {
--- a/jdk/test/java/util/logging/LoggingMXBeanTest2.java	Fri Oct 12 14:52:24 2012 -0700
+++ b/jdk/test/java/util/logging/LoggingMXBeanTest2.java	Sat Oct 13 10:15:57 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,12 +42,14 @@
     static String LOGGER_NAME_1 = "com.sun.management.Logger";
     static String LOGGER_NAME_2 = "com.sun.management.Logger.Logger2";
     static String UNKNOWN_LOGGER_NAME = "com.sun.management.Unknown";
+    static Logger logger1;
+    static Logger logger2;
 
     public LoggingMXBeanTest2() throws Exception {
 
-        Logger logger1 = Logger.getLogger( LOGGER_NAME_1 );
+        logger1 = Logger.getLogger( LOGGER_NAME_1 );
         logger1.setLevel(Level.FINE);
-        Logger logger2 = Logger.getLogger( LOGGER_NAME_2 );
+        logger2 = Logger.getLogger( LOGGER_NAME_2 );
         logger2.setLevel(null);
 
         /*