Package org.apache.jmeter.testelement.property

Examples of org.apache.jmeter.testelement.property.CollectionProperty


     * collection of values for a simulated user. As many different sets of
     * values can be supplied in this fashion to cause JMeter to set different
     * values to variables for different test threads.
     */
    public void setThreadLists(Collection<?> threadLists) {
        setProperty(new CollectionProperty(THREAD_VALUES, threadLists));
    }
View Full Code Here


    public void setThreadLists(CollectionProperty threadLists) {
        setProperty(threadLists);
    }

    private CollectionProperty getValues() {
        CollectionProperty threadValues = (CollectionProperty) getProperty(THREAD_VALUES);
        if (threadValues.size() > 0) {
            return (CollectionProperty) threadValues.get(getThreadContext().getThreadNum() % threadValues.size());
        }
        return new CollectionProperty("noname", new LinkedList<Object>());
    }
View Full Code Here

            = JMeterUtils.getPropDefault("assertion.equals_diff_delta_start", "[[[");
    private static final String DIFF_DELTA_END
            = JMeterUtils.getPropDefault("assertion.equals_diff_delta_end", "]]]");

    public ResponseAssertion() {
        setProperty(new CollectionProperty(TEST_STRINGS, new ArrayList<String>()));
    }
View Full Code Here

    }

    @Override
    public void clear() {
        super.clear();
        setProperty(new CollectionProperty(TEST_STRINGS, new ArrayList<String>()));
    }
View Full Code Here

                    for (Future<AsynSamplerResultHolder> future : retExec) {
                        AsynSamplerResultHolder binRes;
                        try {
                            binRes = future.get(1, TimeUnit.MILLISECONDS);
                            if(cookieManager != null) {
                                CollectionProperty cookies = binRes.getCookies();
                                PropertyIterator iter = cookies.iterator();
                                while (iter.hasNext()) {
                                    Cookie cookie = (Cookie) iter.next().getObjectValue();
                                    cookieManager.add(cookie) ;
                                }
                            }
View Full Code Here

        public AsynSamplerResultHolder call() {
            JMeterContextService.replaceContext(jmeterContextOfParentThread);
            ((CleanerThread) Thread.currentThread()).registerSamplerForEndNotification(sampler);
            HTTPSampleResult httpSampleResult = sampler.sample(url, method, areFollowingRedirect, depth);
            if(sampler.getCookieManager() != null) {
                CollectionProperty cookies = sampler.getCookieManager().getCookies();
                return new AsynSamplerResultHolder(httpSampleResult, cookies);
            } else {
                return new AsynSamplerResultHolder(httpSampleResult, new CollectionProperty());
            }
        }
View Full Code Here

            for (TreeNode node : path) {
                nodePath.add(((JMeterTreeNode) node).getName());
            }
            // nodePath.add(selectedNode.getName());
        }
        setProperty(new CollectionProperty(NODE_PATH, nodePath));
    }
View Full Code Here

     * @param cacheManager the CacheManager (may be null)
     */
    private void setConnectionHeaders(HttpURLConnection conn, URL u, HeaderManager headerManager, CacheManager cacheManager) {
        // Add all the headers from the HeaderManager
        if (headerManager != null) {
            CollectionProperty headers = headerManager.getHeaders();
            if (headers != null) {
                PropertyIterator i = headers.iterator();
                while (i.hasNext()) {
                    Header header = (Header) i.next().getObjectValue();
                    String n = header.getName();
                    String v = header.getValue();
                    conn.addRequestProperty(n, v);
View Full Code Here

            TestElement element = new TestPlan();
            element.setProperty(new StringProperty("domain", "jakarta.apache.org"));
            List<Object> argsin = new ArrayList<Object>();
            argsin.add("username is jack");
            argsin.add("his_password");
            element.setProperty(new CollectionProperty("args", argsin));
            replacer.reverseReplace(element);
            assertEquals("${server}", element.getPropertyAsString("domain"));
            @SuppressWarnings("unchecked")
            List<JMeterProperty> args = (List<JMeterProperty>) element.getProperty("args").getObjectValue();
            assertEquals("username is ${username}", args.get(0).getStringValue());
View Full Code Here

        // Allow Headers to override Host setting
        hbuf.append("Host").append(COLON_SPACE).append(host).append(NEWLINE);//$NON-NLS-1$
        setInt(0xA00b); //Host
        setString(host);
        if(headers != null) {
            CollectionProperty coll = headers.getHeaders();
            PropertyIterator i = coll.iterator();
            while(i.hasNext()) {
                Header header = (Header)i.next().getObjectValue();
                String n = header.getName();
                String v = header.getValue();
                hbuf.append(n).append(COLON_SPACE).append(v).append(NEWLINE);
View Full Code Here

TOP

Related Classes of org.apache.jmeter.testelement.property.CollectionProperty

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.