Esempio n. 1
0
  public void testSize() {
    for (int i = 0; i < 5; i++) {
      queue.enqueue(i);
    }

    int size = queue.size();

    testResults.add(new TestResult("testForEach", String.valueOf(5), String.valueOf(size)));
  }
Esempio n. 2
0
  public void testForEach() {

    for (int i = 0; i < 5; i++) {
      queue.enqueue(i);
    }

    int size = queue.size();

    int count = 0;
    for (Object o : queue) {
      count++;
    }

    testResults.add(new TestResult("testForEach", String.valueOf(size), String.valueOf(count)));
  }
Esempio n. 3
0
  public void testDequeue() {
    queue.dequeue();
    queue.dequeue();

    testResults.add(new TestResult("testDequeue", "0", String.valueOf(queue.size())));
  }
Esempio n. 4
0
  public void testEnqueue() {
    queue.enqueue("test1");
    queue.enqueue("test2");

    testResults.add(new TestResult("testEnqueue", "2", String.valueOf(queue.size())));
  }