@Test
  public void shouldNotAttemptReQueueIfNoTestHasBeenPulled() {
    final Collection<String> additions = newLinkedList();
    Queue<String> queue =
        new LinkedList<String>() {
          private static final long serialVersionUID = -1L;

          @Override
          public boolean add(String o) {
            return additions.add(o);
          }
        };
    QueueProcessor processor = createMock(QueueProcessor.class);
    processor.close();
    replay(processor);

    ProcessorRunnable runnable =
        new ProcessorRunnable(
            queue, processor, null, 1, createNiceMock(ConcurrencyController.class));
    Thread.currentThread().interrupt();
    runnable.run();
    assertTrue(additions.isEmpty());
    verify(processor);
  }
Esempio n. 2
0
 public void assertTestFailed(String name) {
   assertTestRun(name);
   assertTrue(name + " passed! Expected to fail", testCaseEvents.get(name).failed());
 }