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.6 by jsr166, Mon Nov 16 04:57:09 2009 UTC vs.
Revision 1.7 by jsr166, Mon Nov 16 05:30:07 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 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 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 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 1190 | Line 1190 | public class AbstractQueuedLongSynchroni
1190              l.releaseShared(0);
1191              assertTrue(l.isSignalled());
1192              t.join();
1193 <        } catch (InterruptedException e){
1193 >        } catch (InterruptedException e) {
1194              unexpectedException();
1195          }
1196      }
# 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 1221 | Line 1221 | public class AbstractQueuedLongSynchroni
1221              l.releaseShared(0);
1222              assertTrue(l.isSignalled());
1223              t.join();
1224 <        } catch (InterruptedException e){
1224 >        } catch (InterruptedException e) {
1225              unexpectedException();
1226          }
1227      }
# 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 1245 | Line 1245 | public class AbstractQueuedLongSynchroni
1245              assertFalse(l.isSignalled());
1246              t.interrupt();
1247              t.join();
1248 <        } catch (InterruptedException e){
1248 >        } catch (InterruptedException e) {
1249              unexpectedException();
1250          }
1251      }
# 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 1270 | Line 1270 | public class AbstractQueuedLongSynchroni
1270              assertFalse(l.isSignalled());
1271              t.interrupt();
1272              t.join();
1273 <        } catch (InterruptedException e){
1273 >        } catch (InterruptedException e) {
1274              unexpectedException();
1275          }
1276      }
# 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                  }
# Line 1295 | Line 1295 | public class AbstractQueuedLongSynchroni
1295              Thread.sleep(SHORT_DELAY_MS);
1296              assertFalse(l.isSignalled());
1297              t.join();
1298 <        } catch (InterruptedException e){
1298 >        } catch (InterruptedException e) {
1299              unexpectedException();
1300          }
1301      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines