use of org.apache.jmeter.protocol.http.control.AuthManager in project jmeter by apache.
the class HTTPSamplerBase method setAuthManager.
public void setAuthManager(AuthManager value) {
AuthManager mgr = getAuthManager();
if (mgr != null) {
if (log.isWarnEnabled()) {
log.warn("Existing AuthManager {} superseded by {}", mgr.getName(), value.getName());
}
}
setProperty(new TestElementProperty(AUTH_MANAGER, value));
}
use of org.apache.jmeter.protocol.http.control.AuthManager in project jmeter by apache.
the class ProxyControl method setAuthorization.
/**
* Find if there is any AuthManager in JMeterTreeModel
* If there is no one, create and add it to tree
* Add authorization object to AuthManager
* @param authorization {@link Authorization}
* @param target {@link JMeterTreeNode}
*/
private void setAuthorization(Authorization authorization, JMeterTreeNode target) {
JMeterTreeModel jmeterTreeModel = getJmeterTreeModel();
List<JMeterTreeNode> authManagerNodes = jmeterTreeModel.getNodesOfType(AuthManager.class);
if (authManagerNodes.isEmpty()) {
try {
log.debug("Creating HTTP Authentication manager for authorization:" + authorization);
AuthManager authManager = newAuthorizationManager(authorization);
jmeterTreeModel.addComponent(authManager, target);
} catch (IllegalUserActionException e) {
log.error("Failed to add Authorization Manager to target node:" + target.getName(), e);
}
} else {
AuthManager authManager = (AuthManager) authManagerNodes.get(0).getTestElement();
authManager.addAuth(authorization);
}
}
use of org.apache.jmeter.protocol.http.control.AuthManager in project jmeter by apache.
the class ProxyControl method newAuthorizationManager.
/**
* Construct AuthManager
* @param authorization
* @return AuthManager
* @throws IllegalUserActionException
*/
private AuthManager newAuthorizationManager(Authorization authorization) throws IllegalUserActionException {
AuthManager authManager = new AuthManager();
authManager.setProperty(TestElement.GUI_CLASS, AUTH_PANEL);
authManager.setProperty(TestElement.TEST_CLASS, AUTH_MANAGER);
authManager.setName("HTTP Authorization Manager");
authManager.addAuth(authorization);
return authManager;
}
use of org.apache.jmeter.protocol.http.control.AuthManager in project jmeter by apache.
the class AuthPanel method createTestElement.
@Override
public TestElement createTestElement() {
AuthManager authMan = tableModel.manager;
configureTestElement(authMan);
authMan.setClearEachIteration(clearEachIteration.isSelected());
return (TestElement) authMan.clone();
}
use of org.apache.jmeter.protocol.http.control.AuthManager in project jmeter by apache.
the class AuthPanel method modifyTestElement.
/**
* Modifies a given TestElement to mirror the data in the gui components.
*
* @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);
}
Aggregations