6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
import junit.framework.*; |
9 |
|
import java.util.ArrayList; |
10 |
|
import java.util.Arrays; |
11 |
|
import java.util.Collection; |
18 |
|
import java.util.Vector; |
19 |
|
import java.util.concurrent.CopyOnWriteArrayList; |
20 |
|
|
21 |
+ |
import junit.framework.Test; |
22 |
+ |
import junit.framework.TestSuite; |
23 |
+ |
|
24 |
|
public class CopyOnWriteArrayListTest extends JSR166TestCase { |
25 |
|
|
26 |
|
public static void main(String[] args) { |
264 |
|
assertTrue(it.hasNext()); |
265 |
|
assertEquals(elements[j], it.next()); |
266 |
|
} |
267 |
< |
assertFalse(it.hasNext()); |
268 |
< |
try { |
269 |
< |
it.next(); |
270 |
< |
shouldThrow(); |
271 |
< |
} catch (NoSuchElementException success) {} |
267 |
> |
assertIteratorExhausted(it); |
268 |
> |
} |
269 |
> |
|
270 |
> |
/** |
271 |
> |
* iterator of empty collection has no elements |
272 |
> |
*/ |
273 |
> |
public void testEmptyIterator() { |
274 |
> |
Collection c = new CopyOnWriteArrayList(); |
275 |
> |
assertIteratorExhausted(c.iterator()); |
276 |
|
} |
277 |
|
|
278 |
|
/** |