Package org.apache.jmeter.samplers

Examples of org.apache.jmeter.samplers.SampleResult$NanoOffset


//        fail("Not yet implemented");
//    }

    @Test
    public void testGetAvgPageBytes() {
        SampleResult res = new SampleResult();
        assertEquals(0,ssc.getAvgPageBytes(),0);
        res.setResponseData("abcdef", "UTF-8");
        ssc.addSample(res);
        res.setResponseData("abcde", "UTF-8");
        ssc.addSample(res);
        res.setResponseData("abcd", "UTF-8");
        ssc.addSample(res);
        assertEquals(5,ssc.getAvgPageBytes(),0);
    }
View Full Code Here


            jmctx = JMeterContextService.getContext();
            vars = new JMeterVariables();
            jmctx.setVariables(vars);
            jmctx.setPreviousResult(result);
            params = new LinkedList<CompoundVariable>();
            result = new SampleResult();
            variable = new TimeFunction();
        }
View Full Code Here

            // be redrawn so no need(shouldn't) use the previousPts.
            previousPtsAlloc = false;
            Iterator<SampleResult> e = model.getList().iterator();

            for (int i = 0; e.hasNext(); i++) {
                SampleResult s = e.next();

                drawSample(i * PLOT_X_WIDTH, s, g);
            }
        }
        log.debug("End : paintComponent1");
View Full Code Here

        // Plot the times of the total times components
        int currPreviousPts = 2;

        if (resultList != null) {
            for (int i = 0; i < resultList.length; i++) {
                SampleResult componentRes = resultList[i];

                if (log.isDebugEnabled()) {
                    log.debug("drawSample1 : componentRes - " + componentRes.getSampleLabel() + " loading time - "
                            + componentRes.getTime());
                }
                data = (int) (componentRes.getTime() * d.height / model.getMax());
                data += lastLevel;
                currColor = ColorHelper.changeColorCyclicIncrement(currColor, 100);
                g.setColor(currColor);
                if (!previousPtsAlloc) {
                    // If first dot, just draw the point
                    g.drawLine(x % width, d.height - data, x % width, d.height - data - 1);
                } else {
                    // Otherwise, draw from previous point
                    g.drawLine((previousPts[currPreviousPts].x) % width, previousPts[currPreviousPts].y, x % width,
                            d.height - data);
                }
                // Store the current plot
                previousPts[currPreviousPts++] = new Point(x % width, d.height - data);
                if (noLegendYet) {
                    gbc.gridx = 0;
                    gbc.gridy = compCount++;
                    gbc.anchor = GridBagConstraints.WEST;
                    gbc.weightx = 1.0;
                    gbc.insets = new Insets(0, 10, 0, 0);
                    JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel());

                    compTimeLabel.setForeground(currColor);
                    gridBag.setConstraints(compTimeLabel, gbc);
                    legendPanel.add(compTimeLabel);
                }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        jmctx = JMeterContextService.getContext();
        assertion = new XPathAssertion();
        assertion.setThreadContext(jmctx);// This would be done by the run command
        result = new SampleResult();
        result.setResponseData(readFile("testfiles/XPathAssertionTest.xml"));
        vars = new JMeterVariables();
        jmctx.setVariables(vars);
        jmctx.setPreviousResult(result);
        //testLog.setPriority(org.apache.log.Priority.DEBUG);
View Full Code Here

        assertTrue("Should be a failure",res.isFailure());
    }

    public void testAssertionNoResult() throws Exception {
        // result.setResponseData - not set
        result = new SampleResult();
        AssertionResult res = assertion.getResult(result);
        testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
        testLog.debug("failure message: " + res.getFailureMessage());
        assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
        assertFalse("Should not be an error", res.isError());
View Full Code Here

    @Override
    public void setUp() throws MalformedURLException {
        jmctx = JMeterContextService.getContext();
        assertion = new ResponseAssertion();
        assertion.setThreadContext(jmctx);
        sample = new SampleResult();
        vars = new JMeterVariables();
        jmctx.setVariables(vars);
        jmctx.setPreviousResult(sample);
        sample.setResponseData("response Data\nline 2\n\nEOF", null);
        sample.setURL(new URL("http://localhost/Sampler/Data/"));
View Full Code Here

        }

        @Override
        public void setUp() {
            variable = new RegexFunction();
            result = new SampleResult();
            jmctx = JMeterContextService.getContext();
            String data = "<company-xmlext-query-ret><row>" + "<value field=\"RetCode\">" + "LIS_OK</value><value"
                    + " field=\"RetCodeExtension\"></value>" + "<value field=\"alias\"></value><value"
                    + " field=\"positioncount\"></value>" + "<value field=\"invalidpincount\">0</value><value"
                    + " field=\"pinposition1\">1</value><value" + " field=\"pinpositionvalue1\"></value><value"
View Full Code Here

        public void run() {
            ResponseAssertion assertion = new ResponseAssertion();
            assertion.setTestFieldResponseData();
            assertion.setToContainsType();
            assertion.addTestString(TEST_PATTERN);
            SampleResult response = new SampleResult();
            response.setResponseData(TEST_STRING, null);
            for (int i = 0; i < 100; i++) {
                AssertionResult result;
                result = assertion.getResult(response);
                if (result.isFailure() || result.isError()) {
                    failed++;
View Full Code Here

        if (bshInterpreter == null) {
            log.error("BeanShell not found");
            return;
        }

        SampleResult samp=se.getResult();
        try {
            bshInterpreter.set("sampleEvent", se);//$NON-NLS-1$
            bshInterpreter.set("sampleResult", samp);//$NON-NLS-1$
            processFileOrScript(bshInterpreter);
        } catch (JMeterException e) {
View Full Code Here

TOP

Related Classes of org.apache.jmeter.samplers.SampleResult$NanoOffset

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.