938 |
|
} |
939 |
|
|
940 |
|
/** |
941 |
+ |
* hasWaiters throws NPE if null |
942 |
+ |
*/ |
943 |
+ |
public void testHasWaitersNPE() { |
944 |
+ |
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
945 |
+ |
try { |
946 |
+ |
lock.hasWaiters(null); |
947 |
+ |
shouldThrow(); |
948 |
+ |
} catch (NullPointerException success) { |
949 |
+ |
} catch (Exception ex) { |
950 |
+ |
unexpectedException(); |
951 |
+ |
} |
952 |
+ |
} |
953 |
+ |
|
954 |
+ |
/** |
955 |
+ |
* getWaitQueueLength throws NPE if null |
956 |
+ |
*/ |
957 |
+ |
public void testGetWaitQueueLengthNPE() { |
958 |
+ |
final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); |
959 |
+ |
try { |
960 |
+ |
lock.getWaitQueueLength(null); |
961 |
+ |
shouldThrow(); |
962 |
+ |
} catch (NullPointerException success) { |
963 |
+ |
} catch (Exception ex) { |
964 |
+ |
unexpectedException(); |
965 |
+ |
} |
966 |
+ |
} |
967 |
+ |
|
968 |
+ |
|
969 |
+ |
/** |
970 |
+ |
* getWaitingThreads throws NPE if null |
971 |
+ |
*/ |
972 |
+ |
public void testGetWaitingThreadsNPE() { |
973 |
+ |
final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock(); |
974 |
+ |
try { |
975 |
+ |
lock.getWaitingThreads(null); |
976 |
+ |
shouldThrow(); |
977 |
+ |
} catch (NullPointerException success) { |
978 |
+ |
} catch (Exception ex) { |
979 |
+ |
unexpectedException(); |
980 |
+ |
} |
981 |
+ |
} |
982 |
+ |
|
983 |
+ |
/** |
984 |
|
* hasWaiters throws IAE if not owned |
985 |
|
*/ |
986 |
|
public void testHasWaitersIAE() { |