Author: sebb Date: Mon Nov 26 06:43:37 2007 New Revision: 598291 URL: http://svn.apache.org/viewvc?rev=598291&view=rev Log: CSV files are now fully processed in CSVSaveService Detect additional errors when processing
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java?rev=598291&r1=598290&r2=598291&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java Mon Nov 26 06:43:37 2007 @@ -233,33 +233,18 @@ dataReader = new BufferedReader(new FileReader(file)); // Get the first line, and see if it is XML String line = dataReader.readLine(); + dataReader.close(); + dataReader = null; if (line == null) { log.warn(filename+" is empty"); } else { if (!line.startsWith("<?xml ")){// No, must be CSV //$NON-NLS-1$ - long lineNumber=1; - SampleSaveConfiguration saveConfig = CSVSaveService.getSampleSaveConfiguration(line,filename); - if (saveConfig == null) {// not a valid header - saveConfig = (SampleSaveConfiguration) getSaveConfig().clone(); // CSVSaveService may change the format - } else { // header line has been processed, so read the next - line = dataReader.readLine(); - lineNumber++; - } - while (line != null) { // Already read 1st line - SampleEvent event = CSVSaveService.makeResultFromDelimitedString(line,saveConfig,lineNumber); - if (event != null){ - final SampleResult result = event.getResult(); - if (isSampleWanted(result.isSuccessful())) { - visualizer.add(result); - } - } - line = dataReader.readLine(); - lineNumber++; - } + CSVSaveService.processSamples(filename, visualizer, this); parsedOK = true; } else { // We are processing XML try { // Assume XStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file)); + // TODO change to process samples one by one readSamples(SaveService.loadTestResults(bufferedInputStream), visualizer); parsedOK = true; } catch (Exception e) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]