[cvs] / jsr166 / src / test / tck / AbstractExecutorServiceTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AbstractExecutorServiceTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Fri Dec 19 20:38:55 2003 UTC revision 1.5, Fri Dec 19 20:42:44 2003 UTC
# Line 91  Line 91 
91          Policy.setPolicy(policy);          Policy.setPolicy(policy);
92          try {          try {
93              ExecutorService e = new DirectExecutorService();              ExecutorService e = new DirectExecutorService();
94              Future future = e.submit(new PrivilegedAction() {              Future future = e.submit(Executors.callable(new PrivilegedAction() {
95                      public Object run() {                      public Object run() {
96                          return TEST_STRING;                          return TEST_STRING;
97                      }});                      }}));
98    
99              Object result = future.get();              Object result = future.get();
100              assertSame(TEST_STRING, result);              assertSame(TEST_STRING, result);
# Line 121  Line 121 
121          Policy.setPolicy(policy);          Policy.setPolicy(policy);
122          try {          try {
123              ExecutorService e = new DirectExecutorService();              ExecutorService e = new DirectExecutorService();
124              Future future = e.submit(new PrivilegedExceptionAction() {              Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
125                      public Object run() {                      public Object run() {
126                          return TEST_STRING;                          return TEST_STRING;
127                      }});                      }}));
128    
129              Object result = future.get();              Object result = future.get();
130              assertSame(TEST_STRING, result);              assertSame(TEST_STRING, result);
# Line 151  Line 151 
151          Policy.setPolicy(policy);          Policy.setPolicy(policy);
152          try {          try {
153              ExecutorService e = new DirectExecutorService();              ExecutorService e = new DirectExecutorService();
154              Future future = e.submit(new PrivilegedExceptionAction() {              Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
155                      public Object run() throws Exception {                      public Object run() throws Exception {
156                          throw new IndexOutOfBoundsException();                          throw new IndexOutOfBoundsException();
157                      }});                      }}));
158    
159              Object result = future.get();              Object result = future.get();
160              shouldThrow();              shouldThrow();

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8