01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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
26: Serializable
27: // TODO: move this to components -- the only reason why it's in core is because
28: // it's used as a guinea pig by a couple of tests.
29: {
30: /**
31: * Constructor for the LoginConfig object.
32: */
33: public LoginConfig() {
34: }
35:
36: /**
37: * Sets the Username attribute of the LoginConfig object.
38: *
39: * @param username
40: * the new Username value
41: */
42: public void setUsername(String username) {
43: setProperty(new StringProperty(ConfigTestElement.USERNAME,
44: username));
45: }
46:
47: /**
48: * Sets the Password attribute of the LoginConfig object.
49: *
50: * @param password
51: * the new Password value
52: */
53: public void setPassword(String password) {
54: setProperty(new StringProperty(ConfigTestElement.PASSWORD,
55: password));
56: }
57:
58: /**
59: * Gets the Username attribute of the LoginConfig object.
60: *
61: * @return the Username value
62: */
63: public String getUsername() {
64: return getPropertyAsString(ConfigTestElement.USERNAME);
65: }
66:
67: /**
68: * Gets the Password attribute of the LoginConfig object.
69: *
70: * @return the Password value
71: */
72: public String getPassword() {
73: return getPropertyAsString(ConfigTestElement.PASSWORD);
74: }
75:
76: public String toString() {
77: return getUsername() + "=" + getPassword(); //$NON-NLS-1$
78: }
79: }
|