01: /**
02: *
03: * edtFTPj
04: *
05: * Copyright (C) 2000 Enterprise Distributed Technologies Ltd
06: *
07: * www.enterprisedt.com
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: *
23: * Bug fixes, suggestions and comments should be should posted on
24: * http://www.enterprisedt.com/forums/index.php
25: *
26: * Change Log:
27: *
28: * $Log: FileTransferClientTestTools.java,v $
29: * Revision 1.1 2007-12-18 07:55:19 bruceb
30: * prepare for FileTransferClient
31: *
32: * Revision 1.4 2006/10/27 15:21:37 bruceb
33: * renamed logger
34: *
35: * Revision 1.3 2006/02/16 19:58:43 hans
36: * Fixed comments
37: *
38: * Revision 1.2 2005/08/26 17:52:06 bruceb
39: * passive ip address setting
40: *
41: * Revision 1.1 2005/07/22 10:29:38 bruceb
42: * test framework changes
43: *
44: */package com.enterprisedt.net.ftp.test;
45:
46: import java.util.Properties;
47:
48: import com.enterprisedt.net.ftp.FTPClientInterface;
49: import com.enterprisedt.net.ftp.FileTransferClient;
50: import com.enterprisedt.util.debug.Logger;
51:
52: /**
53: * Base class for login tools
54: *
55: * @author Bruce Blackshaw
56: * @version $Revision: 1.1 $
57: */
58: public class FileTransferClientTestTools extends FTPTestTools {
59:
60: /**
61: * Log stream
62: */
63: protected Logger log = Logger
64: .getLogger("FileTransferClientTestTools");
65:
66: /**
67: * Set test properties for connecting
68: *
69: * @param props properties obj
70: */
71: public void setProperties(Properties props) {
72: super .setProperties(props);
73: }
74:
75: /**
76: * Connect to the remote host
77: *
78: * @return connected FTPClientInterface
79: * @throws Exception
80: */
81: public FTPClientInterface connect() throws Exception {
82: // connect
83: FileTransferClient client = new FileTransferClient();
84: client.setRemoteHost(host);
85: client.setTimeout(timeout);
86: client.getAdvancedFTPSettings().setConnectMode(connectMode);
87: client.setUserName(user);
88: client.setPassword(password);
89: client.connect();
90: return new FileTransferClientAdapter(client);
91: }
92:
93: }
|