57 |
|
/** |
58 |
|
* get and set for out of bound indices throw IndexOutOfBoundsException |
59 |
|
*/ |
60 |
< |
public void testIndexing(){ |
60 |
> |
public void testIndexing() { |
61 |
|
AtomicIntegerArray ai = new AtomicIntegerArray(SIZE); |
62 |
|
try { |
63 |
|
ai.get(SIZE); |
64 |
< |
} catch (IndexOutOfBoundsException success){ |
64 |
> |
} catch (IndexOutOfBoundsException success) { |
65 |
|
} |
66 |
|
try { |
67 |
|
ai.get(-1); |
68 |
< |
} catch (IndexOutOfBoundsException success){ |
68 |
> |
} catch (IndexOutOfBoundsException success) { |
69 |
|
} |
70 |
|
try { |
71 |
|
ai.set(SIZE, 0); |
72 |
< |
} catch (IndexOutOfBoundsException success){ |
72 |
> |
} catch (IndexOutOfBoundsException success) { |
73 |
|
} |
74 |
|
try { |
75 |
|
ai.set(-1, 0); |
76 |
< |
} catch (IndexOutOfBoundsException success){ |
76 |
> |
} catch (IndexOutOfBoundsException success) { |
77 |
|
} |
78 |
|
} |
79 |
|
|
334 |
|
for (int i = 0; i < SIZE; ++i) { |
335 |
|
assertEquals(l.get(i), r.get(i)); |
336 |
|
} |
337 |
< |
} catch (Exception e){ |
337 |
> |
} catch (Exception e) { |
338 |
|
e.printStackTrace(); |
339 |
|
unexpectedException(); |
340 |
|
} |