Class LockSupportTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by JSR166TestCase
              extended by LockSupportTest
All Implemented Interfaces:
junit.framework.Test

public class LockSupportTest
extends JSR166TestCase


Nested Class Summary
 
Nested classes/interfaces inherited from class JSR166TestCase
JSR166TestCase.AdjustablePolicy, JSR166TestCase.CallableOne, JSR166TestCase.CheckedBarrier, JSR166TestCase.CheckedCallable<T>, JSR166TestCase.CheckedInterruptedCallable<T>, JSR166TestCase.CheckedInterruptedRunnable, JSR166TestCase.CheckedRecursiveAction, JSR166TestCase.CheckedRecursiveTask<T>, JSR166TestCase.CheckedRunnable, JSR166TestCase.LongPossiblyInterruptedRunnable, JSR166TestCase.MediumInterruptedRunnable, JSR166TestCase.MediumPossiblyInterruptedRunnable, JSR166TestCase.MediumRunnable, JSR166TestCase.NoOpCallable, JSR166TestCase.NoOpREHandler, JSR166TestCase.NoOpRunnable, JSR166TestCase.NPETask, JSR166TestCase.RunnableShouldThrow, JSR166TestCase.ShortInterruptedRunnable, JSR166TestCase.ShortRunnable, JSR166TestCase.SimpleThreadFactory, JSR166TestCase.SmallCallable, JSR166TestCase.SmallPossiblyInterruptedRunnable, JSR166TestCase.SmallRunnable, JSR166TestCase.StringTask, JSR166TestCase.ThreadShouldThrow, JSR166TestCase.TrackedCallable, JSR166TestCase.TrackedLongRunnable, JSR166TestCase.TrackedMediumRunnable, JSR166TestCase.TrackedNoOpRunnable, JSR166TestCase.TrackedRunnable, JSR166TestCase.TrackedShortRunnable, JSR166TestCase.TrackedSmallRunnable
 
Field Summary
 
Fields inherited from class JSR166TestCase
eight, expensiveTests, five, four, LONG_DELAY_MS, m1, m10, m2, m3, m4, m5, m6, MEDIUM_DELAY_MS, nine, one, seven, SHORT_DELAY_MS, six, SIZE, SMALL_DELAY_MS, TEST_STRING, three, two, zero
 
Constructor Summary
LockSupportTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testGetBlockerNull()
          getBlocker(null) throws NullPointerException
 void testParkAfterInterrupt()
          park is released by preceding interrupt
 void testParkAfterUnpark()
          park is released by preceding unpark
 void testParkBeforeInterrupt()
          park is released by subsequent interrupt
 void testParkBeforeUnpark()
          park is released by subsequent unpark
 void testParkNanosAfterInterrupt()
          parkNanos is released by preceding interrupt
 void testParkNanosAfterUnpark()
          parkNanos is released by preceding unpark
 void testParkNanosBeforeInterrupt()
          parkNanos is released by subsequent interrupt
 void testParkNanosBeforeUnpark()
          parkNanos is released by subsequent unpark
 void testParkNanosTimesOut()
          parkNanos times out if not unparked
 void testParkUntil0Returns()
          parkUntil(0) returns immediately.
 void testParkUntilAfterInterrupt()
          parkUntil is released by preceding interrupt
 void testParkUntilAfterUnpark()
          parkUntil is released by preceding unpark
 void testParkUntilBeforeInterrupt()
          parkUntil is released by subsequent interrupt
 void testParkUntilBeforeUnpark()
          parkUntil is released by subsequent unpark
 void testParkUntilTimesOut()
          parkUntil times out if not unparked
 
Methods inherited from class JSR166TestCase
assertThreadJoinTimesOut, awaiter, checkEmpty, delay, getShortDelay, joinPool, latchAwaitingStringTask, newTestSuite, permissivePolicy, possiblyInterruptedRunnable, runTest, runTestProfiled, runWithoutPermissions, runWithPermissions, setDelays, setUp, shouldThrow, shouldThrow, tearDown, threadAssertEquals, threadAssertEquals, threadAssertFalse, threadAssertNull, threadAssertSame, threadAssertTrue, threadFail, threadRecordFailure, threadShouldThrow, threadShouldThrow, threadUnexpectedException, trackedRunnable
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockSupportTest

public LockSupportTest()
Method Detail

main

public static void main(java.lang.String[] args)

suite

public static junit.framework.Test suite()

testParkBeforeUnpark

public void testParkBeforeUnpark()
                          throws java.lang.InterruptedException
park is released by subsequent unpark

Throws:
java.lang.InterruptedException

testParkUntilBeforeUnpark

public void testParkUntilBeforeUnpark()
                               throws java.lang.InterruptedException
parkUntil is released by subsequent unpark

Throws:
java.lang.InterruptedException

testParkNanosBeforeUnpark

public void testParkNanosBeforeUnpark()
                               throws java.lang.InterruptedException
parkNanos is released by subsequent unpark

Throws:
java.lang.InterruptedException

testParkAfterUnpark

public void testParkAfterUnpark()
                         throws java.lang.Exception
park is released by preceding unpark

Throws:
java.lang.Exception

testParkUntilAfterUnpark

public void testParkUntilAfterUnpark()
                              throws java.lang.Exception
parkUntil is released by preceding unpark

Throws:
java.lang.Exception

testParkNanosAfterUnpark

public void testParkNanosAfterUnpark()
                              throws java.lang.Exception
parkNanos is released by preceding unpark

Throws:
java.lang.Exception

testParkBeforeInterrupt

public void testParkBeforeInterrupt()
                             throws java.lang.InterruptedException
park is released by subsequent interrupt

Throws:
java.lang.InterruptedException

testParkUntilBeforeInterrupt

public void testParkUntilBeforeInterrupt()
                                  throws java.lang.InterruptedException
parkUntil is released by subsequent interrupt

Throws:
java.lang.InterruptedException

testParkNanosBeforeInterrupt

public void testParkNanosBeforeInterrupt()
                                  throws java.lang.InterruptedException
parkNanos is released by subsequent interrupt

Throws:
java.lang.InterruptedException

testParkAfterInterrupt

public void testParkAfterInterrupt()
                            throws java.lang.Exception
park is released by preceding interrupt

Throws:
java.lang.Exception

testParkUntilAfterInterrupt

public void testParkUntilAfterInterrupt()
                                 throws java.lang.Exception
parkUntil is released by preceding interrupt

Throws:
java.lang.Exception

testParkNanosAfterInterrupt

public void testParkNanosAfterInterrupt()
                                 throws java.lang.Exception
parkNanos is released by preceding interrupt

Throws:
java.lang.Exception

testParkNanosTimesOut

public void testParkNanosTimesOut()
                           throws java.lang.InterruptedException
parkNanos times out if not unparked

Throws:
java.lang.InterruptedException

testParkUntilTimesOut

public void testParkUntilTimesOut()
                           throws java.lang.InterruptedException
parkUntil times out if not unparked

Throws:
java.lang.InterruptedException

testGetBlockerNull

public void testGetBlockerNull()
getBlocker(null) throws NullPointerException


testParkUntil0Returns

public void testParkUntil0Returns()
                           throws java.lang.InterruptedException
parkUntil(0) returns immediately. Requires hotspot fix for: 6763959 java.util.concurrent.locks.LockSupport.parkUntil(0) blocks forever which is in jdk7-b118 and 6u25.

Throws:
java.lang.InterruptedException