< prev index next >

test/java/util/logging/FileHandlerLongLimit.java

Print this page




  38 import java.util.Collections;
  39 import java.util.Enumeration;
  40 import java.util.List;
  41 import java.util.Properties;
  42 import java.util.UUID;
  43 import java.util.concurrent.Callable;
  44 import java.util.concurrent.atomic.AtomicBoolean;
  45 import java.util.logging.FileHandler;
  46 import java.util.logging.Level;
  47 import java.util.logging.LogManager;
  48 import java.util.logging.LogRecord;
  49 import java.util.logging.LoggingPermission;
  50 
  51 /**
  52  * @test
  53  * @bug 8059767
  54  * @summary tests that FileHandler can accept a long limit.
  55  * @run main/othervm FileHandlerLongLimit UNSECURE
  56  * @run main/othervm FileHandlerLongLimit SECURE
  57  * @author danielfuchs

  58  */
  59 public class FileHandlerLongLimit {
  60 
  61     /**
  62      * We will test handling of limit and overflow of MeteredStream.written in
  63      * 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                     Long.parseLong(propertyFile.getProperty(FileHandler.class.getName()+".limit")));
  75         }
  76     }
  77 




  38 import java.util.Collections;
  39 import java.util.Enumeration;
  40 import java.util.List;
  41 import java.util.Properties;
  42 import java.util.UUID;
  43 import java.util.concurrent.Callable;
  44 import java.util.concurrent.atomic.AtomicBoolean;
  45 import java.util.logging.FileHandler;
  46 import java.util.logging.Level;
  47 import java.util.logging.LogManager;
  48 import java.util.logging.LogRecord;
  49 import java.util.logging.LoggingPermission;
  50 
  51 /**
  52  * @test
  53  * @bug 8059767
  54  * @summary tests that FileHandler can accept a long limit.
  55  * @run main/othervm FileHandlerLongLimit UNSECURE
  56  * @run main/othervm FileHandlerLongLimit SECURE
  57  * @author danielfuchs
  58  * @key randomness
  59  */
  60 public class FileHandlerLongLimit {
  61 
  62     /**
  63      * We will test handling of limit and overflow of MeteredStream.written in
  64      * 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                     Long.parseLong(propertyFile.getProperty(FileHandler.class.getName()+".limit")));
  76         }
  77     }
  78 


< prev index next >