changeset 14416:271f5910f067

8156153: java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java fails with java.lang.RuntimeException Summary: runs each scenario in its own VM to avoid unwanted interaction and start from a clean slate. Reviewed-by: mchung
author dfuchs
date Wed, 11 May 2016 19:23:58 +0200
parents 21b1b5d178ff
children 53be425cbb83
files test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java	Tue May 10 14:51:29 2016 -0700
+++ b/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java	Wed May 11 19:23:58 2016 +0200
@@ -59,7 +59,9 @@
  * @modules java.base/sun.util.logging
  *          java.base/jdk.internal.logger
  *          java.logging/sun.util.logging.internal
- * @run  main/othervm DefaultLoggerBridgeTest
+ * @run  main/othervm DefaultLoggerBridgeTest NOSECURITY
+ * @run  main/othervm DefaultLoggerBridgeTest NOPERMISSIONS
+ * @run  main/othervm DefaultLoggerBridgeTest WITHPERMISSIONS
  * @author danielfuchs
  */
 public class DefaultLoggerBridgeTest {
@@ -275,7 +277,6 @@
             };
 
         Stream.of(args).map(TestCases::valueOf).forEach((testCase) -> {
-            LoggerFinder provider;
             switch (testCase) {
                 case NOSECURITY:
                     System.out.println("\n*** Without Security Manager\n");
@@ -396,10 +397,10 @@
         final boolean old = allowAll.get().get();
         allowAll.get().set(true);
         try {
+            appSink = LoggingProviderImpl.getLogManagerAccess().demandLoggerFor(
+                    LogManager.getLogManager(), "foo", DefaultLoggerBridgeTest.class.getModule());
             sysSink = LoggingProviderImpl.getLogManagerAccess().demandLoggerFor(
                     LogManager.getLogManager(), "foo", Thread.class.getModule());
-            appSink = LoggingProviderImpl.getLogManagerAccess().demandLoggerFor(
-                    LogManager.getLogManager(), "foo", DefaultLoggerBridgeTest.class.getModule());
             if (appSink == sysSink) {
                 throw new RuntimeException("identical backend loggers");
             }