ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.6 by dl, Sun Oct 5 23:00:40 2003 UTC vs.
Revision 1.7 by dl, Sat Oct 25 16:02:13 2003 UTC

# Line 9 | Line 9 | import junit.framework.*;
9   import java.util.*;
10   import java.util.concurrent.*;
11   import java.io.*;
12 <
12 > import java.security.*;
13  
14   /**
15   * Base class for JSR166 Junit TCK tests.  Defines some constants,
# Line 128 | Line 128 | public class JSR166TestCase extends Test
128          suite.addTest(new TestSuite(LockSupportTest.class));
129          suite.addTest(new TestSuite(PriorityBlockingQueueTest.class));
130          suite.addTest(new TestSuite(PriorityQueueTest.class));
131 +        suite.addTest(new TestSuite(PrivilegedFutureTaskTest.class));
132          suite.addTest(new TestSuite(ReentrantLockTest.class));
133          suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class));
134          suite.addTest(new TestSuite(ScheduledExecutorTest.class));
# Line 321 | Line 322 | public class JSR166TestCase extends Test
322      static final Integer m10 = new Integer(-10);
323  
324  
325 +    /**
326 +     * A security policy where new permissions can be dynamically added
327 +     * or all cleared.
328 +     */
329 +    static class AdjustablePolicy extends java.security.Policy {
330 +        Permissions perms = new Permissions();
331 +        AdjustablePolicy() { }
332 +        void addPermission(Permission perm) { perms.add(perm); }
333 +        void clearPermissions() { perms = new Permissions(); }
334 +        public PermissionCollection getPermissions(CodeSource cs) {
335 +            return perms;
336 +        }
337 +        public PermissionCollection getPermissions(ProtectionDomain pd) {
338 +            return perms;
339 +        }
340 +        public boolean implies(ProtectionDomain pd, Permission p) {
341 +            return perms.implies(p);
342 +        }
343 +        public void refresh() {}
344 +    }
345 +
346 +
347      // Some convenient Runnable classes
348  
349      static class NoOpRunnable implements Runnable {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines