Program: 89920
Project: 89920
Buggy source:
/** 
 * Verify that visit() - throws exception on null message or message that is not ok - returns a non-ok message if handler fails with exception or no handler registered
 */
public void testVisitFailures() throws InterruptedException {
  server=IndexRequestServer.getInstance();
  mmfbc.setMode(MockupMultiFileBasedCache.Mode.FAILING);
  server.setHandler(RequestType.CDX,mmfbc);
  try {
    server.visit((IndexRequestMessage)null);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  IndexRequestMessage irMsg=new IndexRequestMessage(RequestType.CDX,JOB_SET);
  GenericMessageListener listener=new GenericMessageListener();
  JMSConnectionMockupMQ conn=(JMSConnectionMockupMQ)JMSConnectionFactory.getInstance();
  conn.setListener(irMsg.getReplyTo(),listener);
  server.visit(irMsg);
  conn.waitForConcurrentTasksToFinish();
  Thread.sleep(200);
  conn.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,listener.messagesReceived.size());
  assertTrue("String_Node_Str",listener.messagesReceived.get(0) instanceof IndexRequestMessage);
  IndexRequestMessage msg=(IndexRequestMessage)listener.messagesReceived.get(0);
  assertEquals("String_Node_Str",irMsg.getID(),msg.getID());
  assertFalse("String_Node_Str",msg.isOk());
  irMsg=new IndexRequestMessage(RequestType.DEDUP_CRAWL_LOG,JOB_SET);
  server.visit(irMsg);
  conn.waitForConcurrentTasksToFinish();
  Thread.sleep(200);
  conn.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",2,listener.messagesReceived.size());
  assertTrue("String_Node_Str",listener.messagesReceived.get(1) instanceof IndexRequestMessage);
  msg=(IndexRequestMessage)listener.messagesReceived.get(1);
  assertEquals("String_Node_Str",irMsg.getID(),msg.getID());
  assertFalse("String_Node_Str",msg.isOk());
  irMsg=new IndexRequestMessage(RequestType.DEDUP_CRAWL_LOG,JOB_SET);
}

Fixed version (ground truth):
/** 
 * Verify that visit() - throws exception on null message or message that is not ok - returns a non-ok message if handler fails with exception or no handler registered
 */
public void testVisitFailures() throws InterruptedException {
  server=IndexRequestServer.getInstance();
  mmfbc.setMode(MockupMultiFileBasedCache.Mode.FAILING);
  server.setHandler(RequestType.CDX,mmfbc);
  try {
    server.visit((IndexRequestMessage)null);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  IndexRequestMessage irMsg=new IndexRequestMessage(RequestType.CDX,JOB_SET);
  JMSConnectionMockupMQ.updateMsgID(irMsg,"String_Node_Str");
  GenericMessageListener listener=new GenericMessageListener();
  JMSConnectionMockupMQ conn=(JMSConnectionMockupMQ)JMSConnectionFactory.getInstance();
  conn.setListener(irMsg.getReplyTo(),listener);
  server.visit(irMsg);
  conn.waitForConcurrentTasksToFinish();
  Thread.sleep(200);
  conn.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,listener.messagesReceived.size());
  assertTrue("String_Node_Str",listener.messagesReceived.get(0) instanceof IndexRequestMessage);
  IndexRequestMessage msg=(IndexRequestMessage)listener.messagesReceived.get(0);
  assertEquals("String_Node_Str",irMsg.getID(),msg.getID());
  assertFalse("String_Node_Str",msg.isOk());
  irMsg=new IndexRequestMessage(RequestType.DEDUP_CRAWL_LOG,JOB_SET);
  JMSConnectionMockupMQ.updateMsgID(irMsg,"String_Node_Str");
  server.visit(irMsg);
  conn.waitForConcurrentTasksToFinish();
  Thread.sleep(200);
  conn.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",2,listener.messagesReceived.size());
  assertTrue("String_Node_Str",listener.messagesReceived.get(1) instanceof IndexRequestMessage);
  msg=(IndexRequestMessage)listener.messagesReceived.get(1);
  assertEquals("String_Node_Str",irMsg.getID(),msg.getID());
  assertFalse("String_Node_Str",msg.isOk());
  irMsg=new IndexRequestMessage(RequestType.DEDUP_CRAWL_LOG,JOB_SET);
  JMSConnectionMockupMQ.updateMsgID(irMsg,"String_Node_Str");
}