Exemplo n.º 1
0
  @Test
  public void testSize() {
    final int maxItems = 143;
    final IQueue q = client.getQueue(randomString());

    for (int i = 0; i < maxItems; i++) {
      q.add(i);
    }
    assertEquals(maxItems, q.size());
  }
Exemplo n.º 2
0
  @Test
  public void testRetainEmptyList() throws IOException {
    final int maxItems = 131;
    final IQueue q = client.getQueue(randomString());

    for (int i = 0; i < maxItems; i++) {
      q.add(i);
    }

    List retain = new LinkedList();
    assertTrue(q.retainAll(retain));
    assertEquals(0, q.size());
  }
Exemplo n.º 3
0
  @Test
  public void testRemoveList_whereNotFound() throws IOException {
    final int maxItems = 131;
    final IQueue q = client.getQueue(randomString());

    List removeList = new LinkedList();
    for (int i = 0; i < maxItems; i++) {
      q.add(i);
    }
    removeList.add(maxItems + 1);
    removeList.add(maxItems + 2);

    assertFalse(q.removeAll(removeList));
    assertEquals(maxItems, q.size());
  }
Exemplo n.º 4
0
 @Test
 public void testadd() {
   final IQueue q = client.getQueue(randomString());
   assertTrue(q.add(1));
   assertEquals(1, q.size());
 }