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

Comparing jsr166/src/test/tck/AbstractQueuedLongSynchronizerTest.java (file contents):
Revision 1.5 by jsr166, Mon Nov 2 20:28:31 2009 UTC vs.
Revision 1.6 by jsr166, Mon Nov 16 04:57:09 2009 UTC

# Line 76 | Line 76 | public class AbstractQueuedLongSynchroni
76          public void run() {
77              try {
78                  sync.acquireInterruptibly(1);
79 <            } catch(InterruptedException success){}
79 >            } catch (InterruptedException success){}
80          }
81      }
82  
# Line 92 | Line 92 | public class AbstractQueuedLongSynchroni
92              try {
93                  sync.acquireInterruptibly(1);
94                  threadShouldThrow();
95 <            } catch(InterruptedException success){}
95 >            } catch (InterruptedException success){}
96          }
97      }
98  
# Line 149 | Line 149 | public class AbstractQueuedLongSynchroni
149              assertFalse(sync.hasQueuedThreads());
150              t1.join();
151              t2.join();
152 <        } catch(Exception e){
152 >        } catch (Exception e){
153              unexpectedException();
154          }
155      }
# Line 195 | Line 195 | public class AbstractQueuedLongSynchroni
195              assertFalse(sync.isQueued(t2));
196              t1.join();
197              t2.join();
198 <        } catch(Exception e){
198 >        } catch (Exception e){
199              unexpectedException();
200          }
201      }
# Line 225 | Line 225 | public class AbstractQueuedLongSynchroni
225              assertNull(sync.getFirstQueuedThread());
226              t1.join();
227              t2.join();
228 <        } catch(Exception e){
228 >        } catch (Exception e){
229              unexpectedException();
230          }
231      }
# Line 255 | Line 255 | public class AbstractQueuedLongSynchroni
255              assertTrue(sync.hasContended());
256              t1.join();
257              t2.join();
258 <        } catch(Exception e){
258 >        } catch (Exception e){
259              unexpectedException();
260          }
261      }
# Line 287 | Line 287 | public class AbstractQueuedLongSynchroni
287              assertTrue(sync.getQueuedThreads().isEmpty());
288              t1.join();
289              t2.join();
290 <        } catch(Exception e){
290 >        } catch (Exception e){
291              unexpectedException();
292          }
293      }
# Line 319 | Line 319 | public class AbstractQueuedLongSynchroni
319              assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
320              t1.join();
321              t2.join();
322 <        } catch(Exception e){
322 >        } catch (Exception e){
323              unexpectedException();
324          }
325      }
# Line 349 | Line 349 | public class AbstractQueuedLongSynchroni
349              assertTrue(sync.getSharedQueuedThreads().isEmpty());
350              t1.join();
351              t2.join();
352 <        } catch(Exception e){
352 >        } catch (Exception e){
353              unexpectedException();
354          }
355      }
# Line 365 | Line 365 | public class AbstractQueuedLongSynchroni
365                      try {
366                          sync.tryAcquireNanos(1, MEDIUM_DELAY_MS * 1000 * 1000);
367                          threadShouldThrow();
368 <                    } catch(InterruptedException success){}
368 >                    } catch (InterruptedException success){}
369                  }
370              });
371          try {
372              t.start();
373              t.interrupt();
374 <        } catch(Exception e){
374 >        } catch (Exception e){
375              unexpectedException();
376          }
377      }
# Line 392 | Line 392 | public class AbstractQueuedLongSynchroni
392              t.start();
393              t.join();
394              sync.release(1);
395 <        } catch(Exception e){
395 >        } catch (Exception e){
396              unexpectedException();
397          }
398      }
# Line 416 | Line 416 | public class AbstractQueuedLongSynchroni
416              t.start();
417              t.join();
418              sync.release(1);
419 <        } catch(Exception e){
419 >        } catch (Exception e){
420              unexpectedException();
421          }
422      }
# Line 437 | Line 437 | public class AbstractQueuedLongSynchroni
437                      try {
438                          Thread.sleep(SMALL_DELAY_MS);
439                      }
440 <                    catch(Exception e) {
440 >                    catch (Exception e) {
441                          threadUnexpectedException();
442                      }
443                      sync.release(1);
# Line 449 | Line 449 | public class AbstractQueuedLongSynchroni
449              assertTrue(sync.isHeldExclusively());
450              t.join();
451              assertFalse(sync.isHeldExclusively());
452 <        } catch(Exception e){
452 >        } catch (Exception e){
453              unexpectedException();
454          }
455      }
# Line 469 | Line 469 | public class AbstractQueuedLongSynchroni
469              Thread.sleep(SHORT_DELAY_MS);
470              sync.release(1);
471              t.join();
472 <        } catch(Exception e){
472 >        } catch (Exception e){
473              unexpectedException();
474          }
475      }
# Line 481 | Line 481 | public class AbstractQueuedLongSynchroni
481          final Mutex sync = new Mutex();
482          try {
483              sync.acquireInterruptibly(1);
484 <        } catch(Exception e) {
484 >        } catch (Exception e) {
485              unexpectedException();
486          }
487          Thread t = new Thread(new InterruptedSyncRunnable(sync));
# Line 490 | Line 490 | public class AbstractQueuedLongSynchroni
490              t.interrupt();
491              assertTrue(sync.isHeldExclusively());
492              t.join();
493 <        } catch(Exception e){
493 >        } catch (Exception e){
494              unexpectedException();
495          }
496      }
# Line 603 | Line 603 | public class AbstractQueuedLongSynchroni
603                          c.await();
604                          sync.release(1);
605                      }
606 <                    catch(InterruptedException e) {
606 >                    catch (InterruptedException e) {
607                          threadUnexpectedException();
608                      }
609                  }
# Line 781 | Line 781 | public class AbstractQueuedLongSynchroni
781                          c.await();
782                          sync.release(1);
783                      }
784 <                    catch(InterruptedException e) {
784 >                    catch (InterruptedException e) {
785                          threadUnexpectedException();
786                      }
787                  }
# Line 823 | Line 823 | public class AbstractQueuedLongSynchroni
823                          c.await();
824                          sync.release(1);
825                      }
826 <                    catch(InterruptedException e) {
826 >                    catch (InterruptedException e) {
827                          threadUnexpectedException();
828                      }
829                  }
# Line 838 | Line 838 | public class AbstractQueuedLongSynchroni
838                          c.await();
839                          sync.release(1);
840                      }
841 <                    catch(InterruptedException e) {
841 >                    catch (InterruptedException e) {
842                          threadUnexpectedException();
843                      }
844                  }
# Line 883 | Line 883 | public class AbstractQueuedLongSynchroni
883                          c.await();
884                          sync.release(1);
885                      }
886 <                    catch(InterruptedException e) {
886 >                    catch (InterruptedException e) {
887                          threadUnexpectedException();
888                      }
889                  }
# Line 897 | Line 897 | public class AbstractQueuedLongSynchroni
897                          c.await();
898                          sync.release(1);
899                      }
900 <                    catch(InterruptedException e) {
900 >                    catch (InterruptedException e) {
901                          threadUnexpectedException();
902                      }
903                  }
# Line 977 | Line 977 | public class AbstractQueuedLongSynchroni
977                          sync.release(1);
978                          threadShouldThrow();
979                      }
980 <                    catch(InterruptedException success) {
980 >                    catch (InterruptedException success) {
981                      }
982                  }
983              });
# Line 1008 | Line 1008 | public class AbstractQueuedLongSynchroni
1008                          sync.release(1);
1009                          threadShouldThrow();
1010                      }
1011 <                    catch(InterruptedException success) {
1011 >                    catch (InterruptedException success) {
1012                      }
1013                  }
1014              });
# Line 1040 | Line 1040 | public class AbstractQueuedLongSynchroni
1040                          sync.release(1);
1041                          threadShouldThrow();
1042                      }
1043 <                    catch(InterruptedException success) {
1043 >                    catch (InterruptedException success) {
1044                      }
1045                  }
1046              });
# Line 1070 | Line 1070 | public class AbstractQueuedLongSynchroni
1070                          c.await();
1071                          sync.release(1);
1072                      }
1073 <                    catch(InterruptedException e) {
1073 >                    catch (InterruptedException e) {
1074                          threadUnexpectedException();
1075                      }
1076                  }
# Line 1083 | Line 1083 | public class AbstractQueuedLongSynchroni
1083                          c.await();
1084                          sync.release(1);
1085                      }
1086 <                    catch(InterruptedException e) {
1086 >                    catch (InterruptedException e) {
1087                          threadUnexpectedException();
1088                      }
1089                  }
# Line 1137 | Line 1137 | public class AbstractQueuedLongSynchroni
1137              ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
1138              Mutex r = (Mutex) in.readObject();
1139              assertTrue(r.isHeldExclusively());
1140 <        } catch(Exception e){
1140 >        } catch (Exception e){
1141              e.printStackTrace();
1142              unexpectedException();
1143          }
# Line 1178 | Line 1178 | public class AbstractQueuedLongSynchroni
1178                          threadAssertFalse(l.isSignalled());
1179                          l.acquireSharedInterruptibly(0);
1180                          threadAssertTrue(l.isSignalled());
1181 <                    } catch(InterruptedException e){
1181 >                    } catch (InterruptedException e){
1182                          threadUnexpectedException();
1183                      }
1184                  }
# Line 1209 | Line 1209 | public class AbstractQueuedLongSynchroni
1209                          threadAssertTrue(l.tryAcquireSharedNanos(0, MEDIUM_DELAY_MS* 1000 * 1000));
1210                          threadAssertTrue(l.isSignalled());
1211  
1212 <                    } catch(InterruptedException e){
1212 >                    } catch (InterruptedException e){
1213                          threadUnexpectedException();
1214                      }
1215                  }
# Line 1237 | Line 1237 | public class AbstractQueuedLongSynchroni
1237                          threadAssertFalse(l.isSignalled());
1238                          l.acquireSharedInterruptibly(0);
1239                          threadShouldThrow();
1240 <                    } catch(InterruptedException success){}
1240 >                    } catch (InterruptedException success){}
1241                  }
1242              });
1243          t.start();
# Line 1261 | Line 1261 | public class AbstractQueuedLongSynchroni
1261                          threadAssertFalse(l.isSignalled());
1262                          l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000);
1263                          threadShouldThrow();
1264 <                    } catch(InterruptedException success){}
1264 >                    } catch (InterruptedException success){}
1265                  }
1266              });
1267          t.start();
# Line 1285 | Line 1285 | public class AbstractQueuedLongSynchroni
1285                      try {
1286                          threadAssertFalse(l.isSignalled());
1287                          threadAssertFalse(l.tryAcquireSharedNanos(0, SMALL_DELAY_MS* 1000 * 1000));
1288 <                    } catch(InterruptedException ie){
1288 >                    } catch (InterruptedException ie){
1289                          threadUnexpectedException();
1290                      }
1291                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines