/** * This is Bob's original test, re-written only to allow it to execute as a normal junit test * within Eclipse. */ @Test public void origTestOfRewritingMHLDtoSameBib() throws IOException { String mhldRecFileName = testDataParentPath + File.separator + "summaryHld_1-1000.mrc"; String bibRecFileName = testDataParentPath + File.separator + "u335.mrc"; InputStream inStr = null; ByteArrayOutputStream resultMrcOutStream = new ByteArrayOutputStream(); String[] mergeMhldArgs = new String[] {"-s", mhldRecFileName, bibRecFileName}; // call the code for mhldfile summaryHld_1-1000.mrc and bibfile u335.mrc CommandLineUtils.runCommandLineUtil( MERGE_MHLD_CLASS_NAME, MAIN_METHOD_NAME, inStr, resultMrcOutStream, mergeMhldArgs); RecordTestingUtils.assertMarcRecsEqual(mergedSummaryHoldingsOutput, resultMrcOutStream); // Now merge record again to test the deleting of existing summary holdings info ByteArrayInputStream mergedMarcBibRecAsInStream = new ByteArrayInputStream(resultMrcOutStream.toByteArray()); resultMrcOutStream.close(); resultMrcOutStream = new ByteArrayOutputStream(); // do the merge by piping the bib record in to the merge class CommandLineUtils.runCommandLineUtil( MERGE_MHLD_CLASS_NAME, MAIN_METHOD_NAME, mergedMarcBibRecAsInStream, resultMrcOutStream, new String[] {"-s", mhldRecFileName}); RecordTestingUtils.assertMarcRecsEqual(mergedSummaryHoldingsOutput, resultMrcOutStream); System.out.println("Test origTestOfRewritingMHLDtoSameBib() successful"); }