KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > config > LoginConfig


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/config/LoginConfig.java,v 1.6 2004/02/13 02:21:36 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * 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 JavaDoc;
22
23 import org.apache.jmeter.testelement.property.StringProperty;
24
25 /**
26  * @author Michael Stover
27  * @version $Revision: 1.6 $
28  */

29 public class LoginConfig extends ConfigTestElement implements Serializable JavaDoc
30     // TODO: move this to components -- the only reason why it's in core is because it's used as a guinea pig by a couple of tests.
31
{
32     /**
33      * Constructor for the LoginConfig object.
34      */

35     public LoginConfig()
36     {
37     }
38
39     /**
40      * Sets the Username attribute of the LoginConfig object.
41      *
42      * @param username the new Username value
43      */

44     public void setUsername(String JavaDoc username)
45     {
46         setProperty(new StringProperty(ConfigTestElement.USERNAME, username));
47     }
48
49     /**
50      * Sets the Password attribute of the LoginConfig object.
51      *
52      * @param password the new Password value
53      */

54     public void setPassword(String JavaDoc password)
55     {
56         setProperty(new StringProperty(ConfigTestElement.PASSWORD, password));
57     }
58
59     /**
60      * Gets the Username attribute of the LoginConfig object.
61      *
62      * @return the Username value
63      */

64     public String JavaDoc getUsername()
65     {
66         return getPropertyAsString(ConfigTestElement.USERNAME);
67     }
68
69     /**
70      * Gets the Password attribute of the LoginConfig object.
71      *
72      * @return the Password value
73      */

74     public String JavaDoc getPassword()
75     {
76         return getPropertyAsString(ConfigTestElement.PASSWORD);
77     }
78     
79     public String JavaDoc toString()
80     {
81         return getUsername() + "=" + getPassword();
82     }
83 }
84
Popular Tags