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 posted on the EDT forums at
024: * http://www.enterprisedt.com/forums/index.php
025: *
026: * Change Log:
027: *
028: * $Log: TestBulkTransfer.java,v $
029: * Revision 1.3 2005/07/15 17:30:06 bruceb
030: * rework of unit testing structure
031: *
032: * Revision 1.2 2005/06/03 11:27:05 bruceb
033: * comment update
034: *
035: * Revision 1.2 2005/05/15 19:45:36 bruceb
036: * changes for testing setActivePortRange
037: *
038: * Revision 1.1 2005/01/14 18:07:37 bruceb
039: * bulk test2 TestBulkTransfer.java
040: *
041: *
042: */package com.enterprisedt.net.ftp.test;
043:
044: import junit.framework.Test;
045: import junit.framework.TestSuite;
046:
047: import com.enterprisedt.net.ftp.FTPTransferType;
048:
049: /**
050: * Test get'ing and put'ing of remote files multiple times - stress test
051: *
052: * @author Bruce Blackshaw
053: * @version $Revision: 1.3 $
054: */
055: public class TestBulkTransfer extends FTPTestCase {
056:
057: /**
058: * Revision control id
059: */
060: public static String cvsId = "@(#)$Id: TestBulkTransfer.java,v 1.3 2005/07/15 17:30:06 bruceb Exp $";
061:
062: /**
063: * get name of log file
064: *
065: * @return name of file to log to
066: */
067: protected String getLogName() {
068: return "TestBulkTransfer.log";
069: }
070:
071: /**
072: * Test transfering a binary file
073: */
074: public void testTransferBinary() throws Exception {
075: log.debug("TransferBinary()");
076:
077: connect();
078:
079: // move to test directory
080: ftp.chdir(testdir);
081: ftp.setType(FTPTransferType.BINARY);
082:
083: bulkTransfer(localBinaryFile);
084:
085: ftp.quit();
086: }
087:
088: /**
089: * Test transfering a text file
090: */
091: public void testTransferText() throws Exception {
092: log.debug("TransferText()");
093:
094: connect();
095:
096: // move to test directory
097: ftp.chdir(testdir);
098: ftp.setType(FTPTransferType.ASCII);
099:
100: bulkTransfer(localTextFile);
101:
102: ftp.quit();
103: }
104:
105: /**
106: * Automatic test suite construction
107: *
108: * @return suite of tests for this class
109: */
110: public static Test suite() {
111: return new TestSuite(TestBulkTransfer.class);
112: }
113:
114: /**
115: * Enable our class to be run, doing the
116: * tests
117: */
118: public static void main(String[] args) {
119: junit.textui.TestRunner.run(suite());
120: }
121:
122: }
|