1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 package org.apache.jmeter.config; 20 21 import java.io.Serializable; 22 23 import org.apache.jmeter.testelement.property.StringProperty; 24 25 public class LoginConfig extends ConfigTestElement implements Serializable 26 // TODO: move this to components -- the only reason why it's in core is because 27 // it's used as a guinea pig by a couple of tests. 28 { 29 /** 30 * Constructor for the LoginConfig object. 31 */ 32 public LoginConfig() { 33 } 34 35 /** 36 * Sets the Username attribute of the LoginConfig object. 37 * 38 * @param username 39 * the new Username value 40 */ 41 public void setUsername(String username) { 42 setProperty(new StringProperty(ConfigTestElement.USERNAME, username)); 43 } 44 45 /** 46 * Sets the Password attribute of the LoginConfig object. 47 * 48 * @param password 49 * the new Password value 50 */ 51 public void setPassword(String password) { 52 setProperty(new StringProperty(ConfigTestElement.PASSWORD, password)); 53 } 54 55 /** 56 * Gets the Username attribute of the LoginConfig object. 57 * 58 * @return the Username value 59 */ 60 public String getUsername() { 61 return getPropertyAsString(ConfigTestElement.USERNAME); 62 } 63 64 /** 65 * Gets the Password attribute of the LoginConfig object. 66 * 67 * @return the Password value 68 */ 69 public String getPassword() { 70 return getPropertyAsString(ConfigTestElement.PASSWORD); 71 } 72 73 public String toString() { 74 return getUsername() + "=" + getPassword(); //$NON-NLS-1$ 75 } 76 }