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.8 by dl, Mon Nov 3 13:50:07 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 121 | Line 121 | public class JSR166TestCase extends Test
121          suite.addTest(new TestSuite(DelayQueueTest.class));
122          suite.addTest(new TestSuite(ExchangerTest.class));
123          suite.addTest(new TestSuite(ExecutorsTest.class));
124        suite.addTest(new TestSuite(FairSemaphoreTest.class));
124          suite.addTest(new TestSuite(FutureTaskTest.class));
125          suite.addTest(new TestSuite(LinkedBlockingQueueTest.class));
126          suite.addTest(new TestSuite(LinkedListTest.class));
127          suite.addTest(new TestSuite(LockSupportTest.class));
128          suite.addTest(new TestSuite(PriorityBlockingQueueTest.class));
129          suite.addTest(new TestSuite(PriorityQueueTest.class));
130 +        suite.addTest(new TestSuite(PrivilegedFutureTaskTest.class));
131          suite.addTest(new TestSuite(ReentrantLockTest.class));
132          suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class));
133          suite.addTest(new TestSuite(ScheduledExecutorTest.class));
# Line 321 | Line 321 | public class JSR166TestCase extends Test
321      static final Integer m10 = new Integer(-10);
322  
323  
324 +    /**
325 +     * A security policy where new permissions can be dynamically added
326 +     * or all cleared.
327 +     */
328 +    static class AdjustablePolicy extends java.security.Policy {
329 +        Permissions perms = new Permissions();
330 +        AdjustablePolicy() { }
331 +        void addPermission(Permission perm) { perms.add(perm); }
332 +        void clearPermissions() { perms = new Permissions(); }
333 +        public PermissionCollection getPermissions(CodeSource cs) {
334 +            return perms;
335 +        }
336 +        public PermissionCollection getPermissions(ProtectionDomain pd) {
337 +            return perms;
338 +        }
339 +        public boolean implies(ProtectionDomain pd, Permission p) {
340 +            return perms.implies(p);
341 +        }
342 +        public void refresh() {}
343 +    }
344 +
345 +
346      // Some convenient Runnable classes
347  
348      static class NoOpRunnable implements Runnable {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines