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

Comparing jsr166/src/test/tck/AtomicLongArrayTest.java (file contents):
Revision 1.6 by dl, Sat Dec 27 19:26:43 2003 UTC vs.
Revision 1.7 by dl, Thu Jan 8 01:29:46 2004 UTC

# Line 28 | Line 28 | public class AtomicLongArrayTest extends
28      }
29  
30      /**
31 +     * constructor with null array throws NPE
32 +     */
33 +    public void testConstructor2NPE() {
34 +        try {
35 +            long[] a = null;
36 +            AtomicLongArray ai = new AtomicLongArray(a);
37 +        } catch (NullPointerException success) {
38 +        } catch (Exception ex) {
39 +            unexpectedException();
40 +        }
41 +    }
42 +
43 +    /**
44 +     * constructor with array is of same size and has all elements
45 +     */
46 +    public void testConstructor2() {
47 +        long[] a = { 17L, 3L, -42L, 99L, -7L};
48 +        AtomicLongArray ai = new AtomicLongArray(a);
49 +        assertEquals(a.length, ai.length());
50 +        for (int i = 0; i < a.length; ++i)
51 +            assertEquals(a[i], ai.get(i));
52 +    }
53 +
54 +    /**
55       * get and set for out of bound indices throw IndexOutOfBoundsException
56       */
57      public void testIndexing(){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines