Java Code Examples for java.util.concurrent.LinkedBlockingDeque#putLast()
The following examples show how to use
java.util.concurrent.LinkedBlockingDeque#putLast() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LinkedBlockingDequeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * putLast(null) throws NPE */ public void testPutLastNull() throws InterruptedException { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); try { q.putLast(null); shouldThrow(); } catch (NullPointerException success) {} }
Example 2
Source File: LinkedBlockingDequeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * all elements successfully putLast are contained */ public void testPutLast() throws InterruptedException { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); for (int i = 0; i < SIZE; ++i) { Integer x = new Integer(i); q.putLast(x); assertTrue(q.contains(x)); } assertEquals(0, q.remainingCapacity()); }
Example 3
Source File: LinkedBlockingDequeTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * putLast(null) throws NPE */ public void testPutLastNull() throws InterruptedException { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); try { q.putLast(null); shouldThrow(); } catch (NullPointerException success) {} }
Example 4
Source File: LinkedBlockingDequeTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * all elements successfully putLast are contained */ public void testPutLast() throws InterruptedException { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); for (int i = 0; i < SIZE; ++i) { Integer x = new Integer(i); q.putLast(x); assertTrue(q.contains(x)); } assertEquals(0, q.remainingCapacity()); }