Package org.apache.jmeter.protocol.http.control

Examples of org.apache.jmeter.protocol.http.control.AuthManager


            manager = man;
        }

        public InnerTableModel()
        {
            manager = new AuthManager();
        }
View Full Code Here


   *
   *@return   !ToDo (Return description)
   ***************************************/
  public TestElement createTestElement()
  {
    AuthManager authMan = tableModel.manager;
    configureTestElement(authMan);
    return (TestElement)authMan.clone();
  }
View Full Code Here

    /****************************************
     * !ToDo (Constructor description)
     ***************************************/
    public InnerTableModel()
    {
      manager = new AuthManager();
    }
View Full Code Here

     * @throws ClientProtocolException
     */
    private HttpResponse executeRequest(final HttpClient httpClient,
            final HttpRequestBase httpRequest, final HttpContext localContext, final URL url)
            throws IOException, ClientProtocolException {
        AuthManager authManager = getAuthManager();
        if (authManager != null) {
            Subject subject = authManager.getSubjectForUrl(url);
            if(subject != null) {
                try {
                    return Subject.doAs(subject,
                            new PrivilegedExceptionAction<HttpResponse>() {
   
View Full Code Here

    private static class InnerTableModel extends AbstractTableModel {
        private static final long serialVersionUID = 4638155137475747946L;
        final AuthManager manager;

        public InnerTableModel() {
            manager = new AuthManager();
        }
View Full Code Here

    public boolean getPostBodyRaw() {
        return getPropertyAsBoolean(POST_BODY_RAW, POST_BODY_RAW_DEFAULT);
    }

    public void setAuthManager(AuthManager value) {
        AuthManager mgr = getAuthManager();
        if (mgr != null) {
            log.warn("Existing AuthManager " + mgr.getName() + " superseded by " + value.getName());
        }
        setProperty(new TestElementProperty(AUTH_MANAGER, value));
    }
View Full Code Here

            // set the auth. thanks to KiYun Roe for contributing the patch
            // I cleaned up the patch slightly. 5-26-05
            if (getAuthManager() != null) {
                if (getAuthManager().getAuthForURL(getUrl()) != null) {
                    AuthManager authmanager = getAuthManager();
                    Authorization auth = authmanager.getAuthForURL(getUrl());
                    spconn.setUserName(auth.getUser());
                    spconn.setPassword(auth.getPass());
                } else {
                    log.warn("the URL for the auth was null." + " Username and password not set");
                }
View Full Code Here

        init();
    }

    @Override
    public TestElement createTestElement() {
        AuthManager authMan = tableModel.manager;
        configureTestElement(authMan);
        authMan.setClearEachIteration(clearEachIteration.isSelected());
        return (TestElement) authMan.clone();
    }
View Full Code Here

     * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
     */
    @Override
    public void modifyTestElement(TestElement el) {
        GuiUtils.stopTableEditing(authTable);
        AuthManager authManager = (AuthManager) el;
        authManager.clear();
        authManager.addTestElement((TestElement) tableModel.manager.clone());
        authManager.setClearEachIteration(clearEachIteration.isSelected());
        configureTestElement(el);
    }
View Full Code Here

    }

    private int getHeaderSize(String method, URL url) {
        HeaderManager headers = getHeaderManager();
        CookieManager cookies = getCookieManager();
        AuthManager auth = getAuthManager();
        int hsz = 1; // Host always
        if(method.equals(HTTPConstants.POST)) {
            HTTPFileArg[] hfa = getHTTPFiles();
            if(hfa.length > 0) {
                hsz += 3;
            } else {
                hsz += 2;
            }
        }
        if(headers != null) {
            hsz += headers.size();
        }
        if(cookies != null) {
            hsz += cookies.getCookieCount();
        }
        if(auth != null) {
                String authHeader = auth.getAuthHeaderForURL(url);
            if(authHeader != null) {
            ++hsz;
            }
        }
        return hsz;
View Full Code Here

TOP

Related Classes of org.apache.jmeter.protocol.http.control.AuthManager

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.