001: /**
002: *
003: * edtFTPj
004: *
005: * Copyright (C) 2000 Enterprise Distributed Technologies Ltd
006: *
007: * www.enterprisedt.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
022: *
023: * Bug fixes, suggestions and comments should be should posted on
024: * http://www.enterprisedt.com/forums/index.php
025: *
026: * Change Log:
027: *
028: * $Log: TestTools.java,v $
029: * Revision 1.6 2007/04/04 05:34:20 bruceb
030: * made non-abstract
031: *
032: * Revision 1.5 2007/01/15 22:57:06 bruceb
033: * can now modify username, pwd etc
034: *
035: * Revision 1.4 2006/10/27 15:23:12 bruceb
036: * renamed logger
037: *
038: * Revision 1.3 2006/02/16 19:49:14 hans
039: * Fixed comments.
040: *
041: * Revision 1.2 2005/10/15 22:45:36 bruceb
042: * added getters
043: *
044: * Revision 1.1 2005/07/15 14:41:12 bruceb
045: * needed for rework of unit testing structure
046: *
047: */package com.enterprisedt.net.ftp.test;
048:
049: import java.util.Properties;
050:
051: import com.enterprisedt.net.ftp.FTPClientInterface;
052: import com.enterprisedt.util.debug.Logger;
053:
054: /**
055: * Base class for login tools
056: *
057: * @author Bruce Blackshaw
058: * @version $Revision: 1.6 $
059: */
060: public class TestTools {
061:
062: /**
063: * Log stream
064: */
065: protected Logger log = Logger.getLogger("TestTools");
066:
067: /**
068: * Test properties
069: */
070: protected Properties props;
071:
072: /**
073: * Test user
074: */
075: protected String user;
076:
077: /**
078: * User password
079: */
080: protected String password;
081:
082: /**
083: * Remote test host
084: */
085: protected String host;
086:
087: /**
088: * Socket timeout
089: */
090: protected int timeout;
091:
092: /**
093: * Constructor
094: */
095: public TestTools() {
096: }
097:
098: public int getTimeout() {
099: return timeout;
100: }
101:
102: /**
103: * Get password
104: *
105: * @return Password
106: */
107: public String getPassword() {
108: return password;
109: }
110:
111: public void setPassword(String password) {
112: this .password = password;
113: }
114:
115: /**
116: * Get username
117: *
118: * @return User
119: */
120: public String getUser() {
121: return user;
122: }
123:
124: public void setUser(String user) {
125: this .user = user;
126: }
127:
128: /**
129: * Get host
130: *
131: * @return Host
132: */
133: public String getHost() {
134: return host;
135: }
136:
137: public void setHost(String host) {
138: this .host = host;
139: }
140:
141: /**
142: * Set test properties for connecting
143: *
144: * @param props properties obj
145: */
146: public void setProperties(Properties props) {
147: this .props = props;
148:
149: user = props.getProperty("ftptest.user");
150: password = props.getProperty("ftptest.password");
151:
152: host = props.getProperty("ftptest.host");
153:
154: // socket timeout
155: String timeoutStr = props.getProperty("ftptest.timeout");
156: this .timeout = Integer.parseInt(timeoutStr);
157: }
158:
159: /**
160: * Connect to the remote host
161: *
162: * @return connected FTPClient
163: * @throws Exception
164: */
165: public FTPClientInterface connect() throws Exception {
166: throw new Exception("connect() not implemented");
167: }
168: }
|