1 18 19 package org.apache.jmeter.protocol.http.control; 20 21 import java.io.Serializable ; 22 23 import org.apache.jmeter.config.ConfigElement; 24 import org.apache.jmeter.testelement.AbstractTestElement; 25 26 32 public class Authorization extends AbstractTestElement implements Serializable 33 { 34 private static String URL = "Authorization.url"; 35 private static String USERNAME = "Authorization.username"; 36 private static String PASSWORD = "Authorization.password"; 37 40 Authorization(String url, String user, String pass) 41 { 42 setURL(url); 43 setUser(user); 44 setPass(pass); 45 } 46 47 public boolean expectsModification() 48 { 49 return false; 50 } 51 52 public Authorization() 53 { 54 setURL(""); 55 setUser(""); 56 setPass(""); 57 } 58 59 public String getClassLabel() 60 { 61 return "Authorization"; 62 } 63 64 public void addConfigElement(ConfigElement config) 65 { 66 } 67 68 public synchronized String getURL() 69 { 70 return getPropertyAsString(URL); 71 } 72 public synchronized void setURL(String url) 73 { 74 setProperty(URL, url); 75 } 76 public synchronized String getUser() 77 { 78 return getPropertyAsString(USERNAME); 79 } 80 public synchronized void setUser(String user) 81 { 82 setProperty(USERNAME, user); 83 } 84 public synchronized String getPass() 85 { 86 return getPropertyAsString(PASSWORD); 87 } 88 public synchronized void setPass(String pass) 89 { 90 setProperty(PASSWORD, pass); 91 } 92 public String toString() 93 { 94 return getURL() + "\t" + getUser() + "\t" + getPass(); 95 } 96 } 97 | Popular Tags |