KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > httpunit > HttpTestContainer


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.httpunit;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.Collections JavaDoc;
25
26 /**
27  */

28 public final class HttpTestContainer {
29     private String JavaDoc rootUrl;
30     private int port;
31     private String JavaDoc defaultUsername;
32     private String JavaDoc defaultPassword;
33     private final Collection JavaDoc<HttpTestEntry> entries;
34
35     /**
36      */

37     public HttpTestContainer() {
38         entries = new ArrayList JavaDoc<HttpTestEntry>();
39     }
40
41     String JavaDoc getRootUrl() {
42         return rootUrl;
43     }
44
45     /**
46      * @param url
47      */

48     public void setUrl(String JavaDoc url) {
49         this.rootUrl = url;
50     }
51     
52     /**
53      * @return int
54      */

55     int getPort() {
56         return port;
57     }
58
59     /**
60      * @param port
61      */

62     public void setPort(int port) {
63         this.port = port;
64     }
65
66     /**
67      * @return String
68      */

69     String JavaDoc getDefaultUsername() {
70         return defaultUsername;
71     }
72
73     /**
74      * @param defaultUsername
75      */

76     public void setDefaultUsername(String JavaDoc defaultUsername) {
77         this.defaultUsername = defaultUsername;
78     }
79
80     /**
81      * @return String
82      */

83     String JavaDoc getDefaultPassword() {
84         return defaultPassword;
85     }
86
87     /**
88      * @param defaultPassword
89      */

90     public void setDefaultPassword(String JavaDoc defaultPassword) {
91         this.defaultPassword = defaultPassword;
92     }
93
94     Collection JavaDoc<HttpTestEntry> getEntries() {
95         return Collections.unmodifiableCollection(entries);
96     }
97
98     /**
99      * @param entry
100      */

101     public void addEntry(HttpTestEntry entry) {
102         entries.add(entry);
103     }
104
105     @Override JavaDoc
106     public String JavaDoc toString() {
107         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
108         buffer.append("RootUrl='").append(rootUrl).append("' ");
109         buffer.append("Port='").append(port).append("' ");
110         buffer.append("DefaultUsername='").append(defaultUsername).append("' ");
111         buffer.append("DefaultPassword='").append(defaultPassword).append("' ");
112         buffer.append("TestCount='").append(entries.size()).append("'");
113         return buffer.toString();
114     }
115 }
Popular Tags