Program: 69830
Project: 69830
Buggy source:
@Test public void testImport_OpenOLATTest_process() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(4,items.size());
  dbInstance.commitAndCloseSession();
  int sc=0;
  int mc=0;
  int kprim=0;
  int fib=0;
  for (  QuestionItem item : items) {
    Assert.assertEquals(QTIConstants.QTI_12_FORMAT,item.getFormat());
    QItemType itemType=item.getType();
    Assert.assertNotNull(itemType);
    QuestionType type=QuestionType.valueOf(itemType.getType());
    if (type != null) {
switch (type) {
case SC:
        sc++;
      break;
case MC:
    mc++;
  break;
case KPRIM:
kprim++;
break;
case FIB:
fib++;
break;
default :
{
Assert.fail("String_Node_Str");
}
}
}
}
Assert.assertEquals("String_Node_Str",1,sc);
Assert.assertEquals("String_Node_Str",1,mc);
Assert.assertEquals("String_Node_Str",1,kprim);
Assert.assertEquals("String_Node_Str",1,fib);
for (QuestionItem item : items) {
QuestionItemFull itemFull=(QuestionItemFull)item;
String dir=itemFull.getDirectory();
String file=itemFull.getRootFilename();
VFSContainer itemContainer=qpoolFileStorage.getContainer(dir);
Assert.assertNotNull(itemContainer);
VFSItem itemLeaf=itemContainer.resolve(file);
Assert.assertNotNull(itemLeaf);
Assert.assertTrue(itemLeaf instanceof VFSLeaf);
InputStream is=((VFSLeaf)itemLeaf).getInputStream();
XMLParser xmlParser=new XMLParser(new IMSEntityResolver());
Document doc=xmlParser.parse(is,false);
Node itemNode=doc.selectSingleNode("String_Node_Str");
Assert.assertNotNull(itemNode);
}
}

Fixed version (ground truth):
@Test public void testImport_OpenOLATTest_process() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,Locale.ENGLISH,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(4,items.size());
  dbInstance.commitAndCloseSession();
  int sc=0;
  int mc=0;
  int kprim=0;
  int fib=0;
  for (  QuestionItem item : items) {
    Assert.assertEquals(QTIConstants.QTI_12_FORMAT,item.getFormat());
    QItemType itemType=item.getType();
    Assert.assertNotNull(itemType);
    QuestionType type=QuestionType.valueOf(itemType.getType());
    if (type != null) {
switch (type) {
case SC:
        sc++;
      break;
case MC:
    mc++;
  break;
case KPRIM:
kprim++;
break;
case FIB:
fib++;
break;
default :
{
Assert.fail("String_Node_Str");
}
}
}
}
Assert.assertEquals("String_Node_Str",1,sc);
Assert.assertEquals("String_Node_Str",1,mc);
Assert.assertEquals("String_Node_Str",1,kprim);
Assert.assertEquals("String_Node_Str",1,fib);
for (QuestionItem item : items) {
QuestionItemFull itemFull=(QuestionItemFull)item;
String dir=itemFull.getDirectory();
String file=itemFull.getRootFilename();
VFSContainer itemContainer=qpoolFileStorage.getContainer(dir);
Assert.assertNotNull(itemContainer);
VFSItem itemLeaf=itemContainer.resolve(file);
Assert.assertNotNull(itemLeaf);
Assert.assertTrue(itemLeaf instanceof VFSLeaf);
InputStream is=((VFSLeaf)itemLeaf).getInputStream();
XMLParser xmlParser=new XMLParser(new IMSEntityResolver());
Document doc=xmlParser.parse(is,false);
Node itemNode=doc.selectSingleNode("String_Node_Str");
Assert.assertNotNull(itemNode);
}
}