32 import java.security.Permissions;
33 import java.security.Policy;
34 import java.security.ProtectionDomain;
35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.Enumeration;
38 import java.util.List;
39 import java.util.Properties;
40 import java.util.UUID;
41 import java.util.concurrent.atomic.AtomicBoolean;
42 import java.util.logging.FileHandler;
43 import java.util.logging.LogManager;
44
45 /**
46 * @test
47 * @bug 8025690
48 * @summary tests that an empty or null pattern always result in an exception.
49 * @run main/othervm FileHandlerPatternExceptions UNSECURE
50 * @run main/othervm FileHandlerPatternExceptions SECURE
51 * @author danielfuchs
52 */
53 public class FileHandlerPatternExceptions {
54
55 /**
56 * We will test null/empty pattern in two configurations.
57 * UNSECURE: No security manager.
58 * SECURE: With the security manager present - and the required
59 * permissions granted.
60 */
61 public static enum TestCase {
62 UNSECURE, SECURE;
63 public void run(Properties propertyFile) throws Exception {
64 System.out.println("Running test case: " + name());
65 Configure.setUp(this, propertyFile);
66 test(this.name() + " " + propertyFile.getProperty("test.name"));
67 }
68 }
69
70
71 private static final String PREFIX =
|
32 import java.security.Permissions;
33 import java.security.Policy;
34 import java.security.ProtectionDomain;
35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.Enumeration;
38 import java.util.List;
39 import java.util.Properties;
40 import java.util.UUID;
41 import java.util.concurrent.atomic.AtomicBoolean;
42 import java.util.logging.FileHandler;
43 import java.util.logging.LogManager;
44
45 /**
46 * @test
47 * @bug 8025690
48 * @summary tests that an empty or null pattern always result in an exception.
49 * @run main/othervm FileHandlerPatternExceptions UNSECURE
50 * @run main/othervm FileHandlerPatternExceptions SECURE
51 * @author danielfuchs
52 * @key randomness
53 */
54 public class FileHandlerPatternExceptions {
55
56 /**
57 * We will test null/empty pattern in two configurations.
58 * UNSECURE: No security manager.
59 * SECURE: With the security manager present - and the required
60 * permissions granted.
61 */
62 public static enum TestCase {
63 UNSECURE, SECURE;
64 public void run(Properties propertyFile) throws Exception {
65 System.out.println("Running test case: " + name());
66 Configure.setUp(this, propertyFile);
67 test(this.name() + " " + propertyFile.getProperty("test.name"));
68 }
69 }
70
71
72 private static final String PREFIX =
|