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.5 by dl, Thu Sep 25 11:02:41 2003 UTC vs.
Revision 1.7 by dl, Thu Jan 8 01:29:46 2004 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 27 | 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