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

Comparing jsr166/src/test/tck/AbstractQueuedSynchronizerTest.java (file contents):
Revision 1.23 by jsr166, Mon Nov 16 04:57:09 2009 UTC vs.
Revision 1.24 by jsr166, Mon Nov 16 05:30:07 2009 UTC

# Line 73 | Line 73 | public class AbstractQueuedSynchronizerT
73          public void run() {
74              try {
75                  sync.acquireInterruptibly(1);
76 <            } catch (InterruptedException success){}
76 >            } catch (InterruptedException success) {}
77          }
78      }
79  
# Line 89 | Line 89 | public class AbstractQueuedSynchronizerT
89              try {
90                  sync.acquireInterruptibly(1);
91                  threadShouldThrow();
92 <            } catch (InterruptedException success){}
92 >            } catch (InterruptedException success) {}
93          }
94      }
95  
# Line 146 | Line 146 | public class AbstractQueuedSynchronizerT
146              assertFalse(sync.hasQueuedThreads());
147              t1.join();
148              t2.join();
149 <        } catch (Exception e){
149 >        } catch (Exception e) {
150              unexpectedException();
151          }
152      }
# Line 192 | Line 192 | public class AbstractQueuedSynchronizerT
192              assertFalse(sync.isQueued(t2));
193              t1.join();
194              t2.join();
195 <        } catch (Exception e){
195 >        } catch (Exception e) {
196              unexpectedException();
197          }
198      }
# Line 222 | Line 222 | public class AbstractQueuedSynchronizerT
222              assertNull(sync.getFirstQueuedThread());
223              t1.join();
224              t2.join();
225 <        } catch (Exception e){
225 >        } catch (Exception e) {
226              unexpectedException();
227          }
228      }
# Line 252 | Line 252 | public class AbstractQueuedSynchronizerT
252              assertTrue(sync.hasContended());
253              t1.join();
254              t2.join();
255 <        } catch (Exception e){
255 >        } catch (Exception e) {
256              unexpectedException();
257          }
258      }
# Line 284 | Line 284 | public class AbstractQueuedSynchronizerT
284              assertTrue(sync.getQueuedThreads().isEmpty());
285              t1.join();
286              t2.join();
287 <        } catch (Exception e){
287 >        } catch (Exception e) {
288              unexpectedException();
289          }
290      }
# Line 316 | Line 316 | public class AbstractQueuedSynchronizerT
316              assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
317              t1.join();
318              t2.join();
319 <        } catch (Exception e){
319 >        } catch (Exception e) {
320              unexpectedException();
321          }
322      }
# Line 346 | Line 346 | public class AbstractQueuedSynchronizerT
346              assertTrue(sync.getSharedQueuedThreads().isEmpty());
347              t1.join();
348              t2.join();
349 <        } catch (Exception e){
349 >        } catch (Exception e) {
350              unexpectedException();
351          }
352      }
# Line 362 | Line 362 | public class AbstractQueuedSynchronizerT
362                      try {
363                          sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000 * 1000);
364                          threadShouldThrow();
365 <                    } catch (InterruptedException success){}
365 >                    } catch (InterruptedException success) {}
366                  }
367              });
368          try {
369              t.start();
370              t.interrupt();
371 <        } catch (Exception e){
371 >        } catch (Exception e) {
372              unexpectedException();
373          }
374      }
# Line 389 | Line 389 | public class AbstractQueuedSynchronizerT
389              t.start();
390              t.join();
391              sync.release(1);
392 <        } catch (Exception e){
392 >        } catch (Exception e) {
393              unexpectedException();
394          }
395      }
# Line 413 | Line 413 | public class AbstractQueuedSynchronizerT
413              t.start();
414              t.join();
415              sync.release(1);
416 <        } catch (Exception e){
416 >        } catch (Exception e) {
417              unexpectedException();
418          }
419      }
# Line 446 | Line 446 | public class AbstractQueuedSynchronizerT
446              assertTrue(sync.isHeldExclusively());
447              t.join();
448              assertFalse(sync.isHeldExclusively());
449 <        } catch (Exception e){
449 >        } catch (Exception e) {
450              unexpectedException();
451          }
452      }
# Line 466 | Line 466 | public class AbstractQueuedSynchronizerT
466              Thread.sleep(SHORT_DELAY_MS);
467              sync.release(1);
468              t.join();
469 <        } catch (Exception e){
469 >        } catch (Exception e) {
470              unexpectedException();
471          }
472      }
# Line 487 | Line 487 | public class AbstractQueuedSynchronizerT
487              t.interrupt();
488              assertTrue(sync.isHeldExclusively());
489              t.join();
490 <        } catch (Exception e){
490 >        } catch (Exception e) {
491              unexpectedException();
492          }
493      }
# Line 1134 | Line 1134 | public class AbstractQueuedSynchronizerT
1134              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
1135              Mutex r = (Mutex) in.readObject();
1136              assertTrue(r.isHeldExclusively());
1137 <        } catch (Exception e){
1137 >        } catch (Exception e) {
1138              e.printStackTrace();
1139              unexpectedException();
1140          }
# Line 1175 | Line 1175 | public class AbstractQueuedSynchronizerT
1175                          threadAssertFalse(l.isSignalled());
1176                          l.acquireSharedInterruptibly(0);
1177                          threadAssertTrue(l.isSignalled());
1178 <                    } catch (InterruptedException e){
1178 >                    } catch (InterruptedException e) {
1179                          threadUnexpectedException();
1180                      }
1181                  }
# Line 1187 | Line 1187 | public class AbstractQueuedSynchronizerT
1187              l.releaseShared(0);
1188              assertTrue(l.isSignalled());
1189              t.join();
1190 <        } catch (InterruptedException e){
1190 >        } catch (InterruptedException e) {
1191              unexpectedException();
1192          }
1193      }
# Line 1206 | Line 1206 | public class AbstractQueuedSynchronizerT
1206                          threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS* 1000 * 1000));
1207                          threadAssertTrue(l.isSignalled());
1208  
1209 <                    } catch (InterruptedException e){
1209 >                    } catch (InterruptedException e) {
1210                          threadUnexpectedException();
1211                      }
1212                  }
# Line 1218 | Line 1218 | public class AbstractQueuedSynchronizerT
1218              l.releaseShared(0);
1219              assertTrue(l.isSignalled());
1220              t.join();
1221 <        } catch (InterruptedException e){
1221 >        } catch (InterruptedException e) {
1222              unexpectedException();
1223          }
1224      }
# Line 1234 | Line 1234 | public class AbstractQueuedSynchronizerT
1234                          threadAssertFalse(l.isSignalled());
1235                          l.acquireSharedInterruptibly(0);
1236                          threadShouldThrow();
1237 <                    } catch (InterruptedException success){}
1237 >                    } catch (InterruptedException success) {}
1238                  }
1239              });
1240          t.start();
# Line 1242 | Line 1242 | public class AbstractQueuedSynchronizerT
1242              assertFalse(l.isSignalled());
1243              t.interrupt();
1244              t.join();
1245 <        } catch (InterruptedException e){
1245 >        } catch (InterruptedException e) {
1246              unexpectedException();
1247          }
1248      }
# Line 1258 | Line 1258 | public class AbstractQueuedSynchronizerT
1258                          threadAssertFalse(l.isSignalled());
1259                          l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000);
1260                          threadShouldThrow();
1261 <                    } catch (InterruptedException success){}
1261 >                    } catch (InterruptedException success) {}
1262                  }
1263              });
1264          t.start();
# Line 1267 | Line 1267 | public class AbstractQueuedSynchronizerT
1267              assertFalse(l.isSignalled());
1268              t.interrupt();
1269              t.join();
1270 <        } catch (InterruptedException e){
1270 >        } catch (InterruptedException e) {
1271              unexpectedException();
1272          }
1273      }
# Line 1282 | Line 1282 | public class AbstractQueuedSynchronizerT
1282                      try {
1283                          threadAssertFalse(l.isSignalled());
1284                          threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000));
1285 <                    } catch (InterruptedException ie){
1285 >                    } catch (InterruptedException ie) {
1286                          threadUnexpectedException();
1287                      }
1288                  }
# Line 1292 | Line 1292 | public class AbstractQueuedSynchronizerT
1292              Thread.sleep(SHORT_DELAY_MS);
1293              assertFalse(l.isSignalled());
1294              t.join();
1295 <        } catch (InterruptedException e){
1295 >        } catch (InterruptedException e) {
1296              unexpectedException();
1297          }
1298      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines