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

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.14 by jsr166, Sun Nov 6 03:35:25 2016 UTC vs.
Revision 1.16 by jsr166, Sun Nov 6 05:45:09 2016 UTC

# Line 5 | Line 5
5   * http://creativecommons.org/publicdomain/zero/1.0/
6   */
7  
8 + import static java.util.concurrent.TimeUnit.HOURS;
9   import static java.util.concurrent.TimeUnit.MILLISECONDS;
10  
11   import java.util.ArrayList;
# Line 169 | Line 170 | public class Collection8Test extends JSR
170                  () -> d.push(null),
171                  () -> d.descendingIterator().forEachRemaining(null));
172          }
173 <        if (!impl.permitsNulls() && c instanceof BlockingQueue) {
173 >        if (c instanceof BlockingQueue) {
174              BlockingQueue q = (BlockingQueue) c;
175              assertThrows(
176                  NullPointerException.class,
177                  () -> {
178 <                    try { q.offer(null, 1L, MILLISECONDS); }
178 >                    try { q.offer(null, 1L, HOURS); }
179 >                    catch (InterruptedException ex) {
180 >                        throw new AssertionError(ex);
181 >                    }},
182 >                () -> {
183 >                    try { q.put(null); }
184                      catch (InterruptedException ex) {
185                          throw new AssertionError(ex);
186                      }});
187          }
188 <        if (!impl.permitsNulls() && c instanceof BlockingDeque) {
188 >        if (c instanceof BlockingDeque) {
189              BlockingDeque q = (BlockingDeque) c;
190              assertThrows(
191                  NullPointerException.class,
192                  () -> {
193 <                    try { q.offerFirst(null, 1L, MILLISECONDS); }
193 >                    try { q.offerFirst(null, 1L, HOURS); }
194 >                    catch (InterruptedException ex) {
195 >                        throw new AssertionError(ex);
196 >                    }},
197 >                () -> {
198 >                    try { q.offerLast(null, 1L, HOURS); }
199 >                    catch (InterruptedException ex) {
200 >                        throw new AssertionError(ex);
201 >                    }},
202 >                () -> {
203 >                    try { q.putFirst(null); }
204                      catch (InterruptedException ex) {
205                          throw new AssertionError(ex);
206                      }},
207                  () -> {
208 <                    try { q.offerLast(null, 1L, MILLISECONDS); }
208 >                    try { q.putLast(null); }
209                      catch (InterruptedException ex) {
210                          throw new AssertionError(ex);
211                      }});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines