--- jsr166/src/test/tck/ThreadLocalTest.java 2009/11/21 02:07:27 1.9 +++ jsr166/src/test/tck/ThreadLocalTest.java 2011/03/15 19:47:07 1.12 @@ -1,7 +1,7 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ * Other contributors include Andrew Wright, Jeffrey Hayes, * Pat Fisher, Mike Judd. */ @@ -39,11 +39,11 @@ public class ThreadLocalTest extends JSR * remove causes next access to return initial value */ public void testRemove() { - assertEquals(tl.get(), one); + assertSame(tl.get(), one); tl.set(two); - assertEquals(tl.get(), two); + assertSame(tl.get(), two); tl.remove(); - assertEquals(tl.get(), one); + assertSame(tl.get(), one); } /** @@ -51,11 +51,11 @@ public class ThreadLocalTest extends JSR * initial value */ public void testRemoveITL() { - assertEquals(itl.get(), zero); + assertSame(itl.get(), zero); itl.set(two); - assertEquals(itl.get(), two); + assertSame(itl.get(), two); itl.remove(); - assertEquals(itl.get(), zero); + assertSame(itl.get(), zero); } private class ITLThread extends Thread { @@ -88,18 +88,14 @@ public class ThreadLocalTest extends JSR /** * InheritableThreadLocal propagates generic values. */ - public void testGenericITL() { + public void testGenericITL() throws InterruptedException { final int threadCount = 10; final int x[] = new int[threadCount]; Thread progenitor = new ITLThread(x); - try { - progenitor.start(); - progenitor.join(); - for (int i = 0; i < threadCount; i++) { - assertEquals(i, x[i]); - } - } catch (InterruptedException e) { - unexpectedException(e); + progenitor.start(); + progenitor.join(); + for (int i = 0; i < threadCount; i++) { + assertEquals(i, x[i]); } } }