Program: 90162
Project: 90162
Buggy source:
/** 
 * Simple test that construction works as intended with or without verification.
 */
public void testHeritrixTemplate(){
  Document doc=null;
  try {
    new HeritrixTemplate(doc);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  doc=DocumentFactory.getInstance().createDocument();
  try {
    new HeritrixTemplate(doc);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  try {
    new HeritrixTemplate(doc,false);
  }
 catch (  ArgumentNotValid e) {
    fail("String_Node_Str" + e);
  }
  File f=new File(TestInfo.TOPDATADIR,"String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  try {
    new HeritrixTemplate(doc,true);
  }
 catch (  ArgumentNotValid e) {
    fail("String_Node_Str" + e);
  }
  doc=XmlUtils.getXmlDoc(f);
  List<Node> nodes=doc.selectNodes(HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH);
  for (  Node n : nodes) {
    n.detach();
    doc.remove(n);
  }
  try {
    new HeritrixTemplate(doc,true);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.GROUP_MAX_ALL_KB_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.GROUP_MAX_ALL_KB_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.DECIDERULES_MAP_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_USER_AGENT_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_USER_AGENT_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_FROM_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_FROM_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Simple test that construction works as intended with or without verification.
 */
public void testHeritrixTemplate(){
  Document doc=null;
  try {
    new HeritrixTemplate(doc);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  doc=DocumentFactory.getInstance().createDocument();
  try {
    new HeritrixTemplate(doc);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  try {
    new HeritrixTemplate(doc,false);
  }
 catch (  ArgumentNotValid e) {
    fail("String_Node_Str" + e);
  }
  File f=new File(TestInfo.TOPDATADIR,"String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  try {
    new HeritrixTemplate(doc,true);
  }
 catch (  ArgumentNotValid e) {
    fail("String_Node_Str" + e);
  }
  doc=XmlUtils.getXmlDoc(f);
  List<Node> nodes=doc.selectNodes(HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH);
  for (  Node n : nodes) {
    n.detach();
    doc.remove(n);
  }
  try {
    new HeritrixTemplate(doc,true);
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.GROUP_MAX_ALL_KB_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.GROUP_MAX_ALL_KB_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.DECIDERULES_MAP_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_USER_AGENT_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_USER_AGENT_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_FROM_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.HERITRIX_FROM_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
  doc=XmlUtils.getXmlDoc(f);
  checkLegalValues("String_Node_Str",doc,HeritrixTemplate.ARCHIVER_PATH_XPATH,dk.netarkivet.common.Constants.ARCDIRECTORY_NAME);
  checkIllegalValues("String_Node_Str",doc,HeritrixTemplate.ARCHIVER_PATH_XPATH,"String_Node_Str","String_Node_Str","String_Node_Str");
}