--- jsr166/src/test/tck/AtomicReferenceArrayTest.java 2015/02/22 04:34:44 1.31 +++ jsr166/src/test/tck/AtomicReferenceArrayTest.java 2018/01/07 22:59:17 1.38 @@ -14,7 +14,7 @@ import junit.framework.TestSuite; public class AtomicReferenceArrayTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); + main(suite(), args); } public static Test suite() { return new TestSuite(AtomicReferenceArrayTest.class); @@ -24,7 +24,7 @@ public class AtomicReferenceArrayTest ex * constructor creates array of given size with all elements null */ public void testConstructor() { - AtomicReferenceArray aa = new AtomicReferenceArray(SIZE); + AtomicReferenceArray aa = new AtomicReferenceArray<>(SIZE); for (int i = 0; i < SIZE; i++) { assertNull(aa.get(i)); } @@ -46,7 +46,7 @@ public class AtomicReferenceArrayTest ex */ public void testConstructor2() { Integer[] a = { two, one, three, four, seven }; - AtomicReferenceArray aa = new AtomicReferenceArray(a); + AtomicReferenceArray aa = new AtomicReferenceArray<>(a); assertEquals(a.length, aa.length()); for (int i = 0; i < a.length; i++) assertEquals(a[i], aa.get(i)); @@ -57,7 +57,7 @@ public class AtomicReferenceArrayTest ex */ public void testConstructorSubClassArray() { Integer[] a = { two, one, three, four, seven }; - AtomicReferenceArray aa = new AtomicReferenceArray(a); + AtomicReferenceArray aa = new AtomicReferenceArray<>(a); assertEquals(a.length, aa.length()); for (int i = 0; i < a.length; i++) { assertSame(a[i], aa.get(i)); @@ -71,7 +71,7 @@ public class AtomicReferenceArrayTest ex * get and set for out of bound indices throw IndexOutOfBoundsException */ public void testIndexing() { - AtomicReferenceArray aa = new AtomicReferenceArray(SIZE); + AtomicReferenceArray aa = new AtomicReferenceArray<>(SIZE); for (int index : new int[] { -1, SIZE }) { try { aa.get(index); @@ -193,7 +193,7 @@ public class AtomicReferenceArrayTest ex } /** - * a deserialized serialized array holds same values + * a deserialized/reserialized array holds same values in same order */ public void testSerialization() throws Exception { AtomicReferenceArray x = new AtomicReferenceArray(SIZE); @@ -213,7 +213,8 @@ public class AtomicReferenceArrayTest ex */ public void testToString() { Integer[] a = { two, one, three, four, seven }; - AtomicReferenceArray aa = new AtomicReferenceArray(a); + AtomicReferenceArray aa = new AtomicReferenceArray<>(a); assertEquals(Arrays.toString(a), aa.toString()); } + }