コード例 #1
0
 public void testIsFullAfterPuts() throws InterruptedException {
   SemaphoreBoundedBuffer<Integer> bb = new SemaphoreBoundedBuffer<Integer>(10);
   for (int i = 0; i < 10; i++) bb.put(i);
   assertTrue(bb.isFull());
   assertFalse(bb.isEmpty());
 }
コード例 #2
0
 public void testIsEmptyWhenConstructed() {
   System.out.println("test init");
   SemaphoreBoundedBuffer<Integer> bb = new SemaphoreBoundedBuffer<Integer>(10);
   assertTrue(bb.isEmpty());
   assertFalse(bb.isFull());
 }