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.10 by dl, Mon Dec 22 00:48:55 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 98 | Line 98 | public class JSR166TestCase extends Test
98      public static Test suite ( ) {
99          TestSuite suite = new TestSuite("JSR166 Unit Tests");
100          
101 +        suite.addTest(new TestSuite(AbstractExecutorServiceTest.class));
102          suite.addTest(new TestSuite(ArrayBlockingQueueTest.class));
103          suite.addTest(new TestSuite(AtomicBooleanTest.class));
104          suite.addTest(new TestSuite(AtomicIntegerArrayTest.class));
# Line 111 | Line 112 | public class JSR166TestCase extends Test
112          suite.addTest(new TestSuite(AtomicReferenceFieldUpdaterTest.class));
113          suite.addTest(new TestSuite(AtomicReferenceTest.class));
114          suite.addTest(new TestSuite(AtomicStampedReferenceTest.class));
114        suite.addTest(new TestSuite(CancellableTaskTest.class));
115          suite.addTest(new TestSuite(ConcurrentHashMapTest.class));
116          suite.addTest(new TestSuite(ConcurrentLinkedQueueTest.class));
117          suite.addTest(new TestSuite(CopyOnWriteArrayListTest.class));
# 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));
# Line 321 | Line 320 | public class JSR166TestCase extends Test
320      static final Integer m10 = new Integer(-10);
321  
322  
323 +    /**
324 +     * A security policy where new permissions can be dynamically added
325 +     * or all cleared.
326 +     */
327 +    static class AdjustablePolicy extends java.security.Policy {
328 +        Permissions perms = new Permissions();
329 +        AdjustablePolicy() { }
330 +        void addPermission(Permission perm) { perms.add(perm); }
331 +        void clearPermissions() { perms = new Permissions(); }
332 +        public PermissionCollection getPermissions(CodeSource cs) {
333 +            return perms;
334 +        }
335 +        public PermissionCollection getPermissions(ProtectionDomain pd) {
336 +            return perms;
337 +        }
338 +        public boolean implies(ProtectionDomain pd, Permission p) {
339 +            return perms.implies(p);
340 +        }
341 +        public void refresh() {}
342 +    }
343 +
344 +
345      // Some convenient Runnable classes
346  
347      static class NoOpRunnable implements Runnable {
# Line 331 | Line 352 | public class JSR166TestCase extends Test
352          public Object call() { return Boolean.TRUE; }
353      }
354  
355 +    static final String TEST_STRING = "a test string";
356 +
357 +    static class StringTask implements Callable<String> {
358 +        public String call() { return TEST_STRING; }
359 +    }
360 +
361 +    static class NPETask implements Callable<String> {
362 +        public String call() { throw new NullPointerException(); }
363 +    }
364 +
365 +    static class CallableOne implements Callable<Integer> {
366 +        public Integer call() { return one; }
367 +    }
368 +
369      class ShortRunnable implements Runnable {
370          public void run() {
371              try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines