@Test public void testMergeSamples_emptyFilename() throws Exception { CorrectedResultCollector crc = new CorrectedResultCollector(); crc.getSaveConfig().setAsXml(false); crc.setFilename(""); MergeResultsService instance = new MergeResultsService(); instance.mergeSamples(crc, SAMPLES); }
public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); } } finalizeFileOutput(); }
MergeResultsService { public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); } } finalizeFileOutput(); } }
MergeResultsService { public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); } } finalizeFileOutput(); }  }
MergeResultsService { public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); } } finalizeFileOutput(); }  void mergeSamples(CorrectedResultCollector crc,
            List<SampleResult> samples); }
MergeResultsService { public void mergeSamples(CorrectedResultCollector crc, List<SampleResult> samples) { SampleEvent event; try { initializeFileOutput(crc.getFilename(), crc.getSaveConfig()); } catch (IOException e) { log.warn("Error trying to initialize output file " + e.toString()); } for (SampleResult result : samples) { SampleSaveConfiguration config = crc.getSaveConfig(); event = new SampleEvent(result, null); try { if (config.saveAsXml()) { SaveService.saveSampleResult(event, out); } else { String savee = CSVSaveService .resultToDelimitedString(event); out.println(savee); } } catch (Exception err) { log.error("Error trying to record a sample", err); } } finalizeFileOutput(); }  void mergeSamples(CorrectedResultCollector crc,
            List<SampleResult> samples); static final String FILENAME; }