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.11 by dl, Tue Dec 23 19:40:24 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(ExecutorCompletionServiceTest.class));
125          suite.addTest(new TestSuite(FutureTaskTest.class));
126          suite.addTest(new TestSuite(LinkedBlockingQueueTest.class));
127          suite.addTest(new TestSuite(LinkedListTest.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 {
# Line 331 | Line 353 | public class JSR166TestCase extends Test
353          public Object call() { return Boolean.TRUE; }
354      }
355  
356 +    static final String TEST_STRING = "a test string";
357 +
358 +    static class StringTask implements Callable<String> {
359 +        public String call() { return TEST_STRING; }
360 +    }
361 +
362 +    static class NPETask implements Callable<String> {
363 +        public String call() { throw new NullPointerException(); }
364 +    }
365 +
366 +    static class CallableOne implements Callable<Integer> {
367 +        public Integer call() { return one; }
368 +    }
369 +
370      class ShortRunnable implements Runnable {
371          public void run() {
372              try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines