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

Comparing jsr166/src/test/tck/AbstractExecutorServiceTest.java (file contents):
Revision 1.4 by dl, Fri Dec 19 20:38:55 2003 UTC vs.
Revision 1.5 by dl, Fri Dec 19 20:42:44 2003 UTC

# Line 91 | Line 91 | public class AbstractExecutorServiceTest
91          Policy.setPolicy(policy);
92          try {
93              ExecutorService e = new DirectExecutorService();
94 <            Future future = e.submit(new PrivilegedAction() {
94 >            Future future = e.submit(Executors.callable(new PrivilegedAction() {
95                      public Object run() {
96                          return TEST_STRING;
97 <                    }});
97 >                    }}));
98  
99              Object result = future.get();
100              assertSame(TEST_STRING, result);
# Line 121 | Line 121 | public class AbstractExecutorServiceTest
121          Policy.setPolicy(policy);
122          try {
123              ExecutorService e = new DirectExecutorService();
124 <            Future future = e.submit(new PrivilegedExceptionAction() {
124 >            Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
125                      public Object run() {
126                          return TEST_STRING;
127 <                    }});
127 >                    }}));
128  
129              Object result = future.get();
130              assertSame(TEST_STRING, result);
# Line 151 | Line 151 | public class AbstractExecutorServiceTest
151          Policy.setPolicy(policy);
152          try {
153              ExecutorService e = new DirectExecutorService();
154 <            Future future = e.submit(new PrivilegedExceptionAction() {
154 >            Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
155                      public Object run() throws Exception {
156                          throw new IndexOutOfBoundsException();
157 <                    }});
157 >                    }}));
158  
159              Object result = future.get();
160              shouldThrow();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines