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

Comparing jsr166/src/test/tck/LockSupportTest.java (file contents):
Revision 1.4 by dl, Thu Sep 25 11:02:41 2003 UTC vs.
Revision 1.8 by jsr166, Mon Nov 2 20:28:31 2009 UTC

# Line 1 | Line 1
1   /*
2 < * Written by members of JCP JSR-166 Expert Group and released to the
3 < * public domain. Use, modify, and redistribute this code in any way
4 < * without acknowledgement. Other contributors include Andrew Wright,
5 < * Jeffrey Hayes, Pat Fischer, Mike Judd.
2 > * Written by Doug Lea with assistance from members of JCP JSR-166
3 > * Expert Group and released to the public domain, as explained at
4 > * http://creativecommons.org/licenses/publicdomain
5 > * Other contributors include Andrew Wright, Jeffrey Hayes,
6 > * Pat Fisher, Mike Judd.
7   */
8  
9   import junit.framework.*;
# Line 12 | Line 13 | import java.util.concurrent.locks.*;
13  
14   public class LockSupportTest extends JSR166TestCase{
15      public static void main(String[] args) {
16 <        junit.textui.TestRunner.run (suite());  
16 >        junit.textui.TestRunner.run (suite());
17      }
18      public static Test suite() {
19          return new TestSuite(LockSupportTest.class);
20      }
21  
22      /**
23 <     * park is released by unpark occuring after park
23 >     * park is released by unpark occurring after park
24       */
25 <    public void testPark() {
25 >    public void testPark() {
26          Thread t = new Thread(new Runnable() {
27                  public void run() {
28                      try {
# Line 43 | Line 44 | public class LockSupportTest extends JSR
44      }
45  
46      /**
47 <     * park is released by unpark occuring before park
47 >     * park is released by unpark occurring before park
48       */
49 <    public void testPark2() {
49 >    public void testPark2() {
50          Thread t = new Thread(new Runnable() {
51                  public void run() {
52                      try {
# Line 67 | Line 68 | public class LockSupportTest extends JSR
68      }
69  
70      /**
71 <     * park is released by interrupt
71 >     * park is released by interrupt
72       */
73 <    public void testPark3() {
73 >    public void testPark3() {
74          Thread t = new Thread(new Runnable() {
75                  public void run() {
76                      try {
77                          LockSupport.park();
77                        threadAssertTrue(Thread.interrupted());
78                      } catch(Exception e){
79                          threadUnexpectedException();
80                      }
# Line 94 | Line 94 | public class LockSupportTest extends JSR
94      /**
95       * park returns if interrupted before park
96       */
97 <    public void testPark4() {
97 >    public void testPark4() {
98          final ReentrantLock lock = new ReentrantLock();
99          lock.lock();
100          Thread t = new Thread(new Runnable() {
# Line 121 | Line 121 | public class LockSupportTest extends JSR
121      /**
122       * parkNanos times out if not unparked
123       */
124 <    public void testParkNanos() {
124 >    public void testParkNanos() {
125          Thread t = new Thread(new Runnable() {
126                  public void run() {
127                      try {
# Line 144 | Line 144 | public class LockSupportTest extends JSR
144      /**
145       * parkUntil times out if not unparked
146       */
147 <    public void testParkUntil() {
147 >    public void testParkUntil() {
148          Thread t = new Thread(new Runnable() {
149                  public void run() {
150                      try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines