Examples of SampleResult


Examples of org.apache.jmeter.samplers.SampleResult

        assertEquals("Did not find single property for property " + property, 1, listOfPropertyValues.size());
        assertEquals("Unexpected value for property " + property, expectedPropertyValue, listOfPropertyValues.get(0));
    }

    private SampleResult getSampleResultWithSpecifiedResponseCode(String code) {
        SampleResult sampleResult = new SampleResult();
        sampleResult.setResponseCode(code);
        return sampleResult;
    }
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

    private CacheManager.CacheEntry getThreadCacheEntry(String url) throws Exception {
        return getThreadCache().get(url);
    }

    private void saveDetailsWithHttpMethodAndSampleResultWithResponseCode(String responseCode) throws Exception {
        SampleResult sampleResult = getSampleResultWithSpecifiedResponseCode(responseCode);
        this.cacheManager.saveDetails(this.httpMethod, sampleResult);
    }
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

        SampleResult sampleResult = getSampleResultWithSpecifiedResponseCode(responseCode);
        this.cacheManager.saveDetails(this.httpMethod, sampleResult);
    }

    private void saveDetailsWithConnectionAndSampleResultWithResponseCode(String responseCode) {
        SampleResult sampleResult = getSampleResultWithSpecifiedResponseCode(responseCode);
        this.cacheManager.saveDetails(this.urlConnection, sampleResult);
    }
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

     * @see org.apache.jmeter.visualizers.request.RequestView#setSamplerResult(java.lang.Object)
     */
    public void setSamplerResult(Object objectResult) {

        if (objectResult instanceof SampleResult) {
            SampleResult sampleResult = (SampleResult) objectResult;
            // load time label
            String sd = sampleResult.getSamplerData();
            if (sd != null) {
                String rh = sampleResult.getRequestHeaders();
                // Don't display Request headers label if rh is null or empty
                if (rh != null && rh.length() > 0) {
                    StringBuilder sb = new StringBuilder(sd.length()
                            + rh.length() + 20);
                    sb.append(sd);
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

            if (mgr == null) {
                log.error("Problem creating BSF manager");
                return;
            }
            mgr.declareBean("sampleEvent", event, SampleEvent.class);
            SampleResult result = event.getResult();
            mgr.declareBean("sampleResult", result, SampleResult.class);
            processFileOrScript(mgr);
            mgr.terminate();
        } catch (BSFException e) {
            log.warn("Problem in BSF script "+e);
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

    public void setUp() {
        jmctx = JMeterContextService.getContext();
        variables = new HashMap<String, String>();
        variables.put("my_regex", ".*");
        variables.put("server", "jakarta.apache.org");
        result = new SampleResult();
        result.setResponseData("<html>hello world</html> costs: $3.47,$5.67", null);
        transformer = new ReplaceStringWithFunctions(new CompoundVariable(), variables);
        jmctx.setVariables(new JMeterVariables());
        jmctx.setSamplingStarted(true);
        jmctx.setPreviousResult(result);
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

    /**
     * init() will create all the necessary swing panels, labels and icons for
     * the performance panel.
     */
    private void init() {// called from ctor, so must not be overridable
        ROOTSAMPLE = new SampleResult();
        ROOTSAMPLE.setSampleLabel(SERVER_TITLE);
        ROOTSAMPLE.setSuccessful(true);
        ROOTNODE = new DefaultMutableTreeNode(ROOTSAMPLE);
        TREEMODEL = new DefaultTreeModel(ROOTNODE);
        SERVERTREE = new JTree(TREEMODEL);
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

        JMeterContext ctx = getThreadContext();
        Sampler sampler = ctx.getCurrentSampler();
        if (!(sampler instanceof HTTPSamplerBase)) {// Ignore non-HTTP samplers
            return;
        }
        SampleResult responseText = ctx.getPreviousResult();
        if (responseText == null) {
            return;
        }
        initRegex(getArgumentName());
        String text = new String(responseText.getResponseData()); // TODO - charset?
        Perl5Matcher matcher = JMeterUtils.getMatcher();
        String value = "";
        if (isPathExtension() && isPathExtensionNoEquals() && isPathExtensionNoQuestionmark()) {
            if (matcher.contains(text, pathExtensionNoEqualsNoQuestionmarkRegexp)) {
                MatchResult result = matcher.getMatch();
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

     * Modifies an Entry object based on HTML response text.
     */
    public void process() {
        JMeterContext context = getThreadContext();
        Sampler sam = context.getCurrentSampler();
        SampleResult res = context.getPreviousResult();
        HTTPSamplerBase sampler = null;
        HTTPSampleResult result = null;
        if (res == null || !(sam instanceof HTTPSamplerBase) || !(res instanceof HTTPSampleResult)) {
            log.info("Can't apply HTML Link Parser when the previous" + " sampler run is not an HTTP Request.");
            return;
View Full Code Here

Examples of org.apache.jmeter.samplers.SampleResult

     * Perform a sample, and return the results
     *
     * @return results of the sampling
     */
    public SampleResult sample() {
        SampleResult res = null;
        try {
            if (PROTOCOL_FILE.equalsIgnoreCase(getProtocol())){
                res = fileSample(new URI(PROTOCOL_FILE,getPath(),null));
            } else {
                res = sample(getUrl(), getMethod(), false, 0);
            }
            res.setSampleLabel(getName());
            return res;
        } catch (Exception e) {
            return errorResult(e, new HTTPSampleResult());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.