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

Comparing jsr166/src/test/tck/AtomicIntegerArrayTest.java (file contents):
Revision 1.5 by dl, Thu Sep 25 11:02:41 2003 UTC vs.
Revision 1.8 by dl, Fri Jan 9 20:07:36 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 29 | Line 30 | public class AtomicIntegerArrayTest exte
30      }
31  
32      /**
33 +     * constructor with null array throws NPE
34 +     */
35 +    public void testConstructor2NPE() {
36 +        try {
37 +            int[] a = null;
38 +            AtomicIntegerArray ai = new AtomicIntegerArray(a);
39 +        } catch (NullPointerException success) {
40 +        } catch (Exception ex) {
41 +            unexpectedException();
42 +        }
43 +    }
44 +
45 +    /**
46 +     * constructor with array is of same size and has all elements
47 +     */
48 +    public void testConstructor2() {
49 +        int[] a = { 17, 3, -42, 99, -7};
50 +        AtomicIntegerArray ai = new AtomicIntegerArray(a);
51 +        assertEquals(a.length, ai.length());
52 +        for (int i = 0; i < a.length; ++i)
53 +            assertEquals(a[i], ai.get(i));
54 +    }
55 +
56 +    /**
57       * get and set for out of bound indices throw IndexOutOfBoundsException
58       */
59      public void testIndexing(){
# Line 299 | Line 324 | public class AtomicIntegerArrayTest exte
324          }
325      }
326  
327 +
328 +
329   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines