1 |
|
/* |
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 |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
|
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
– |
|
9 |
|
import junit.framework.*; |
10 |
|
import java.util.*; |
11 |
|
import java.util.concurrent.*; |
14 |
|
|
15 |
|
public class AbstractQueueTest extends JSR166TestCase { |
16 |
|
public static void main(String[] args) { |
17 |
< |
junit.textui.TestRunner.run (suite()); |
17 |
> |
junit.textui.TestRunner.run(suite()); |
18 |
|
} |
19 |
|
public static Test suite() { |
20 |
|
return new TestSuite(AbstractQueueTest.class); |
91 |
|
} catch (NoSuchElementException success) {} |
92 |
|
} |
93 |
|
|
95 |
– |
|
94 |
|
/** |
95 |
|
* element returns normally if peek succeeds |
96 |
|
*/ |
111 |
|
} |
112 |
|
|
113 |
|
/** |
114 |
< |
* addAll(null) throws NPE |
114 |
> |
* addAll(null) throws NPE |
115 |
|
*/ |
116 |
|
public void testAddAll1() { |
117 |
|
try { |
132 |
|
} catch (IllegalArgumentException success) {} |
133 |
|
} |
134 |
|
|
137 |
– |
|
135 |
|
/** |
136 |
< |
* addAll of a collection with null elements throws NPE |
136 |
> |
* addAll of a collection with null elements throws NPE |
137 |
|
*/ |
138 |
|
public void testAddAll2() { |
139 |
|
try { |
143 |
|
shouldThrow(); |
144 |
|
} catch (NullPointerException success) {} |
145 |
|
} |
146 |
+ |
|
147 |
|
/** |
148 |
|
* addAll of a collection with any null elements throws NPE after |
149 |
|
* possibly adding some elements |
158 |
|
shouldThrow(); |
159 |
|
} catch (NullPointerException success) {} |
160 |
|
} |
161 |
+ |
|
162 |
|
/** |
163 |
|
* addAll throws ISE if an add fails |
164 |
|
*/ |