Package org.apache.jmeter.testelement.property

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


    @Override
    public void configure(TestElement el) {
        initTableModel();
        paramTable.setModel(tableModel);
        UserParameters params = (UserParameters) el;
        CollectionProperty names = params.getNames();
        CollectionProperty threadValues = params.getThreadLists();
        tableModel.setColumnData(0, (List<?>) names.getObjectValue());
        PropertyIterator iter = threadValues.iterator();
        if (iter.hasNext()) {
            tableModel.setColumnData(1, (List<?>) iter.next().getObjectValue());
        }
        int count = 2;
        while (iter.hasNext()) {
View Full Code Here


     */
    @Override
    public void modifyTestElement(TestElement params) {
        GuiUtils.stopTableEditing(paramTable);
        UserParameters userParams = ((UserParameters) params);
        userParams.setNames(new CollectionProperty(UserParameters.NAMES, tableModel.getColumnData(NAME_COL_RESOURCE)));
        CollectionProperty threadLists = new CollectionProperty(UserParameters.THREAD_VALUES, new ArrayList<Object>());
        log.debug("making threadlists from gui");
        for (int col = 1; col < tableModel.getColumnCount(); col++) {
            threadLists.addItem(tableModel.getColumnData(getUserColName(col)));
            if (log.isDebugEnabled()) {
                log.debug("Adding column to threadlist: " + tableModel.getColumnData(getUserColName(col)));
                log.debug("Threadlists now = " + threadLists);
            }
        }
View Full Code Here

        }

        // N.B. this must agree with the save() and cookieToString() methods
        String line;
        try {
            final CollectionProperty cookies = getCookies();
            while ((line = reader.readLine()) != null) {
                try {
                    if (line.startsWith("#") || JOrphanUtils.isBlank(line)) {//$NON-NLS-1$
                        continue;
                    }
                    String[] st = JOrphanUtils.split(line, TAB, false);

                    final int _domain = 0;
                    //final int _ignored = 1;
                    final int _path = 2;
                    final int _secure = 3;
                    final int _expires = 4;
                    final int _name = 5;
                    final int _value = 6;
                    final int _fields = 7;
                    if (st.length!=_fields) {
                        throw new IOException("Expected "+_fields+" fields, found "+st.length+" in "+line);
                    }

                    if (st[_path].length()==0) {
                        st[_path] = "/"; //$NON-NLS-1$
                    }
                    boolean secure = Boolean.parseBoolean(st[_secure]);
                    long expires = Long.parseLong(st[_expires]);
                    if (expires==Long.MAX_VALUE) {
                        expires=0;
                    }
                    //long max was used to represent a non-expiring cookie, but that caused problems
                    Cookie cookie = new Cookie(st[_name], st[_value], st[_domain], st[_path], secure, expires);
                    cookies.addItem(cookie);
                } catch (NumberFormatException e) {
                    throw new IOException("Error parsing cookie line\n\t'" + line + "'\n\t" + e);
                }
            }
        } finally {
View Full Code Here

    /*
     * Remove all the cookies.
     */
    private void clearCookies() {
        log.debug("Clear all cookies from store");
        setProperty(new CollectionProperty(COOKIES, new ArrayList<Object>()));
    }
View Full Code Here

     * @param cacheManager the CacheManager (may be null)
     */
    private void setConnectionHeaders(HttpMethod method, URL u, HeaderManager headerManager, CacheManager cacheManager) {
        // Set all the headers from the HeaderManager
        if (headerManager != null) {
            CollectionProperty headers = headerManager.getHeaders();
            if (headers != null) {
                PropertyIterator i = headers.iterator();
                while (i.hasNext()) {
                    org.apache.jmeter.protocol.http.control.Header header
                    = (org.apache.jmeter.protocol.http.control.Header)
                       i.next().getObjectValue();
                    String n = header.getName();
View Full Code Here

    /**
     * Default Constructor.
     */
    public AuthManager() {
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<Object>()));
    }
View Full Code Here

    /** {@inheritDoc} */
    @Override
    public void clear() {
        super.clear();
        kerberosManager.clearSubjects();
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<Object>()));
    }
View Full Code Here

     *            for this <code>UrlConfig</code>
     * @param cacheManager the CacheManager (may be null)
     */
    protected void setConnectionHeaders(HttpRequestBase request, URL url, HeaderManager headerManager, CacheManager cacheManager) {
        if (headerManager != null) {
            CollectionProperty headers = headerManager.getHeaders();
            if (headers != null) {
                PropertyIterator i = headers.iterator();
                while (i.hasNext()) {
                    org.apache.jmeter.protocol.http.control.Header header
                    = (org.apache.jmeter.protocol.http.control.Header)
                       i.next().getObjectValue();
                    String n = header.getName();
View Full Code Here

    public void setUsername(String username) {
        tfAuthUsername.setText(username);
    }

    public CollectionProperty getHeaderFields() {
        CollectionProperty result = new CollectionProperty();
        result.setName(SmtpSampler.HEADER_FIELDS);
        for (Iterator<JTextField> iterator = headerFields.keySet().iterator(); iterator.hasNext();) {
            JTextField headerName = iterator.next();
            String name = headerName.getText();
            String value = headerFields.get(headerName).getText();
            Argument argument = new Argument(name, value);
            result.addItem(argument);
        }
        return result;
    }
View Full Code Here

     * The list of names of the variables to hold values. This list must come in
     * the same order as the sub lists that are given to
     * {@link #setThreadLists(Collection)}.
     */
    public void setNames(Collection<?> list) {
        setProperty(new CollectionProperty(NAMES, list));
    }
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.