< prev index next >

test/java/util/logging/FileHandlerPath.java

Print this page




  39 import java.util.Arrays;
  40 import java.util.Collections;
  41 import java.util.Enumeration;
  42 import java.util.List;
  43 import java.util.Properties;
  44 import java.util.PropertyPermission;
  45 import java.util.UUID;
  46 import java.util.concurrent.atomic.AtomicBoolean;
  47 import java.util.logging.FileHandler;
  48 import java.util.logging.LogManager;
  49 import java.util.logging.LoggingPermission;
  50 
  51 /**
  52  * @test
  53  * @bug 8059269
  54  * @summary tests that using a simple (non composite) pattern does not lead
  55  *        to NPE when the lock file already exists.
  56  * @run main/othervm FileHandlerPath UNSECURE
  57  * @run main/othervm FileHandlerPath SECURE
  58  * @author danielfuchs

  59  */
  60 public class FileHandlerPath {
  61 
  62     /**
  63      * We will test the simple pattern in two configurations.
  64      * UNSECURE: No security manager.
  65      * SECURE: With the security manager present - and the required
  66      *         permissions granted.
  67      */
  68     public static enum TestCase {
  69         UNSECURE, SECURE;
  70         public void run(Properties propertyFile) throws Exception {
  71             System.out.println("Running test case: " + name());
  72             Configure.setUp(this, propertyFile);
  73             test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
  74         }
  75     }
  76 
  77 
  78     // Use a random name provided by UUID to avoid collision with other tests




  39 import java.util.Arrays;
  40 import java.util.Collections;
  41 import java.util.Enumeration;
  42 import java.util.List;
  43 import java.util.Properties;
  44 import java.util.PropertyPermission;
  45 import java.util.UUID;
  46 import java.util.concurrent.atomic.AtomicBoolean;
  47 import java.util.logging.FileHandler;
  48 import java.util.logging.LogManager;
  49 import java.util.logging.LoggingPermission;
  50 
  51 /**
  52  * @test
  53  * @bug 8059269
  54  * @summary tests that using a simple (non composite) pattern does not lead
  55  *        to NPE when the lock file already exists.
  56  * @run main/othervm FileHandlerPath UNSECURE
  57  * @run main/othervm FileHandlerPath SECURE
  58  * @author danielfuchs
  59  * @key randomness
  60  */
  61 public class FileHandlerPath {
  62 
  63     /**
  64      * We will test the simple pattern in two configurations.
  65      * UNSECURE: No security manager.
  66      * SECURE: With the security manager present - and the required
  67      *         permissions granted.
  68      */
  69     public static enum TestCase {
  70         UNSECURE, SECURE;
  71         public void run(Properties propertyFile) throws Exception {
  72             System.out.println("Running test case: " + name());
  73             Configure.setUp(this, propertyFile);
  74             test(this.name() + " " + propertyFile.getProperty("test.name"), propertyFile);
  75         }
  76     }
  77 
  78 
  79     // Use a random name provided by UUID to avoid collision with other tests


< prev index next >