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.22 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.23 by jsr166, Mon Nov 16 04:57:09 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 434 | Line 434 | public class AbstractQueuedSynchronizerT
434                      try {
435                          Thread.sleep(SMALL_DELAY_MS);
436                      }
437 <                    catch(Exception e) {
437 >                    catch (Exception e) {
438                          threadUnexpectedException();
439                      }
440                      sync.release(1);
# 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 478 | Line 478 | public class AbstractQueuedSynchronizerT
478          final Mutex sync = new Mutex();
479          try {
480              sync.acquireInterruptibly(1);
481 <        } catch(Exception e) {
481 >        } catch (Exception e) {
482              unexpectedException();
483          }
484          Thread t = new Thread(new InterruptedSyncRunnable(sync));
# 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 600 | Line 600 | public class AbstractQueuedSynchronizerT
600                          c.await();
601                          sync.release(1);
602                      }
603 <                    catch(InterruptedException e) {
603 >                    catch (InterruptedException e) {
604                          threadUnexpectedException();
605                      }
606                  }
# Line 778 | Line 778 | public class AbstractQueuedSynchronizerT
778                          c.await();
779                          sync.release(1);
780                      }
781 <                    catch(InterruptedException e) {
781 >                    catch (InterruptedException e) {
782                          threadUnexpectedException();
783                      }
784                  }
# Line 820 | Line 820 | public class AbstractQueuedSynchronizerT
820                          c.await();
821                          sync.release(1);
822                      }
823 <                    catch(InterruptedException e) {
823 >                    catch (InterruptedException e) {
824                          threadUnexpectedException();
825                      }
826                  }
# Line 835 | Line 835 | public class AbstractQueuedSynchronizerT
835                          c.await();
836                          sync.release(1);
837                      }
838 <                    catch(InterruptedException e) {
838 >                    catch (InterruptedException e) {
839                          threadUnexpectedException();
840                      }
841                  }
# Line 880 | Line 880 | public class AbstractQueuedSynchronizerT
880                          c.await();
881                          sync.release(1);
882                      }
883 <                    catch(InterruptedException e) {
883 >                    catch (InterruptedException e) {
884                          threadUnexpectedException();
885                      }
886                  }
# Line 894 | Line 894 | public class AbstractQueuedSynchronizerT
894                          c.await();
895                          sync.release(1);
896                      }
897 <                    catch(InterruptedException e) {
897 >                    catch (InterruptedException e) {
898                          threadUnexpectedException();
899                      }
900                  }
# Line 974 | Line 974 | public class AbstractQueuedSynchronizerT
974                          sync.release(1);
975                          threadShouldThrow();
976                      }
977 <                    catch(InterruptedException success) {
977 >                    catch (InterruptedException success) {
978                      }
979                  }
980              });
# Line 1005 | Line 1005 | public class AbstractQueuedSynchronizerT
1005                          sync.release(1);
1006                          threadShouldThrow();
1007                      }
1008 <                    catch(InterruptedException success) {
1008 >                    catch (InterruptedException success) {
1009                      }
1010                  }
1011              });
# Line 1037 | Line 1037 | public class AbstractQueuedSynchronizerT
1037                          sync.release(1);
1038                          threadShouldThrow();
1039                      }
1040 <                    catch(InterruptedException success) {
1040 >                    catch (InterruptedException success) {
1041                      }
1042                  }
1043              });
# Line 1067 | Line 1067 | public class AbstractQueuedSynchronizerT
1067                          c.await();
1068                          sync.release(1);
1069                      }
1070 <                    catch(InterruptedException e) {
1070 >                    catch (InterruptedException e) {
1071                          threadUnexpectedException();
1072                      }
1073                  }
# Line 1080 | Line 1080 | public class AbstractQueuedSynchronizerT
1080                          c.await();
1081                          sync.release(1);
1082                      }
1083 <                    catch(InterruptedException e) {
1083 >                    catch (InterruptedException e) {
1084                          threadUnexpectedException();
1085                      }
1086                  }
# 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 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 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 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 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                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines