Package org.apache.jmeter.samplers

Examples of org.apache.jmeter.samplers.SampleEvent


            // TODO: does it matter that an empty line will terminate the loop?
            // CSV output files should never contain empty lines, so probably not
            // If so, then need to check whether the reader is at EOF
            while ((parts = csvReadFile(dataReader, delim)).length != 0) {
                lineNumber++;
                SampleEvent event = CSVSaveService.makeResultFromDelimitedString(parts,saveConfig,lineNumber);
                if (event != null){
                    final SampleResult result = event.getResult();
                    if (ResultCollector.isSampleWanted(result.isSuccessful(),errorsOnly, successOnly)) {
                        visualizer.add(result);
                    }
                }
            }
View Full Code Here


            throw new JMeterError(e);
        } catch (ArrayIndexOutOfBoundsException e){
            log.warn("Insufficient columns to parse field '" + field + "' at line " + lineNumber);
            throw new JMeterError(e);
        }
        return new SampleEvent(result,"",hostname);
    }
View Full Code Here

            }
        }
    }

    private void notifyListeners(List<SampleListener> listeners, SampleResult result) {
        SampleEvent event = new SampleEvent(result, threadGroup.getName(), threadVars);
        notifier.notifyListeners(event, listeners);

    }
View Full Code Here

                log.debug("Sample excluded based on url or content-type: " + result.getUrlAsString() + " - " + result.getContentType());
            }
            result.setSampleLabel("["+result.getSampleLabel()+"]");
        }
        // SampleEvent is not passed JMeterVariables, because they don't make sense for Proxy Recording
        notifySampleListeners(new SampleEvent(result, "WorkBench")); // TODO - is this the correct threadgroup name?
    }
View Full Code Here

            // TODO: does it matter that an empty line will terminate the loop?
            // CSV output files should never contain empty lines, so probably not
            // If so, then need to check whether the reader is at EOF
            while ((parts = csvReadFile(dataReader, delim)).length != 0) {
                lineNumber++;
                SampleEvent event = CSVSaveService.makeResultFromDelimitedString(parts,saveConfig,lineNumber);
                if (event != null){
                    final SampleResult result = event.getResult();
                    if (ResultCollector.isSampleWanted(result.isSuccessful(),errorsOnly, successOnly)) {
                        visualizer.add(result);
                    }
                }
            }
View Full Code Here

            throw new JMeterError(e);
        } catch (ArrayIndexOutOfBoundsException e){
            log.warn("Insufficient columns to parse field '" + field + "' at line " + lineNumber);
            throw new JMeterError(e);
        }
        return new SampleEvent(result,"",hostname);
    }
View Full Code Here

        }
        if (save.saveThreadCounts()){
           writer.addAttribute(ATT_GRP_THRDS, String.valueOf(res.getGroupThreads()));
           writer.addAttribute(ATT_ALL_THRDS, String.valueOf(res.getAllThreads()));
        }
        SampleEvent event = (SampleEvent) context.get(SaveService.SAMPLE_EVENT_OBJECT);
        if (save.saveHostname()){
            if (event != null) {
                writer.addAttribute(ATT_HOSTNAME, event.getHostname());
            }
        }
        if (event != null) {
            for (int i = 0; i < SampleEvent.getVarCount(); i++){
               writer.addAttribute(SampleEvent.getVarName(i), ConversionHelp.encode(event.getVarValue(i)));
            }
        }
    }
View Full Code Here

                log.debug("Sample excluded based on url or content-type: " + result.getUrlAsString() + " - " + result.getContentType());
            }
            result.setSampleLabel("["+result.getSampleLabel()+"]");
        }
        // SampleEvent is not passed JMeterVariables, because they don't make sense for Proxy Recording
        notifySampleListeners(new SampleEvent(result, "WorkBench")); // TODO - is this the correct threadgroup name?
    }
View Full Code Here

    }

    // TODO save hostname; save sample type (plain or http)
    public void marshal(Object source, HierarchicalStreamWriter writer,
            MarshallingContext context) {
        SampleEvent evt = (SampleEvent) source;
        Object res = evt.getResult();
        context.convertAnother(res);
    }
View Full Code Here

    }

    // TODO does not work yet; need to determine the sample type
    public Object unmarshal(HierarchicalStreamReader reader,
            UnmarshallingContext context) {
        SampleEvent evt = new SampleEvent();
        return evt;
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.samplers.SampleEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.