< prev index next >

test/java/util/logging/LogManager/Configuration/ParentLoggerWithHandlerGC.java

Print this page




  42 import java.util.List;
  43 import java.util.Properties;
  44 import java.util.Set;
  45 import java.util.UUID;
  46 import java.util.concurrent.Callable;
  47 import java.util.concurrent.atomic.AtomicBoolean;
  48 import java.util.logging.FileHandler;
  49 import java.util.logging.Handler;
  50 import java.util.logging.LogManager;
  51 import java.util.logging.Logger;
  52 import java.util.logging.LoggingPermission;
  53 
  54 /**
  55  * @test
  56  * @bug 8060132
  57  * @summary tests that FileHandlers configured on abstract nodes in logging.properties
  58  *          will be closed by reset().
  59  * @run main/othervm ParentLoggerWithHandlerGC UNSECURE
  60  * @run main/othervm ParentLoggerWithHandlerGC SECURE
  61  * @author danielfuchs

  62  */
  63 public class ParentLoggerWithHandlerGC {
  64 
  65     /**
  66      * We will test the handling of abstract logger nodes with file handlers in
  67      * two configurations:
  68      * UNSECURE: No security manager.
  69      * SECURE: With the security manager present - and the required
  70      *         permissions granted.
  71      */
  72     public static enum TestCase {
  73         UNSECURE, SECURE;
  74         public void run(Properties propertyFile) throws Exception {
  75             System.out.println("Running test case: " + name());
  76             Configure.setUp(this, propertyFile);
  77             test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
  78         }
  79     }
  80 
  81 




  42 import java.util.List;
  43 import java.util.Properties;
  44 import java.util.Set;
  45 import java.util.UUID;
  46 import java.util.concurrent.Callable;
  47 import java.util.concurrent.atomic.AtomicBoolean;
  48 import java.util.logging.FileHandler;
  49 import java.util.logging.Handler;
  50 import java.util.logging.LogManager;
  51 import java.util.logging.Logger;
  52 import java.util.logging.LoggingPermission;
  53 
  54 /**
  55  * @test
  56  * @bug 8060132
  57  * @summary tests that FileHandlers configured on abstract nodes in logging.properties
  58  *          will be closed by reset().
  59  * @run main/othervm ParentLoggerWithHandlerGC UNSECURE
  60  * @run main/othervm ParentLoggerWithHandlerGC SECURE
  61  * @author danielfuchs
  62  * @key randomness
  63  */
  64 public class ParentLoggerWithHandlerGC {
  65 
  66     /**
  67      * We will test the handling of abstract logger nodes with file handlers in
  68      * two configurations:
  69      * UNSECURE: No security manager.
  70      * SECURE: With the security manager present - and the required
  71      *         permissions granted.
  72      */
  73     public static enum TestCase {
  74         UNSECURE, SECURE;
  75         public void run(Properties propertyFile) throws Exception {
  76             System.out.println("Running test case: " + name());
  77             Configure.setUp(this, propertyFile);
  78             test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
  79         }
  80     }
  81 
  82 


< prev index next >