Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31FF3D732 for ; Wed, 12 Dec 2012 12:23:33 +0000 (UTC) Received: (qmail 28875 invoked by uid 500); 12 Dec 2012 12:23:32 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 28704 invoked by uid 500); 12 Dec 2012 12:23:30 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 28676 invoked by uid 99); 12 Dec 2012 12:23:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 12:23:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 12:23:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6360723889BF; Wed, 12 Dec 2012 12:23:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1420637 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java Date: Wed, 12 Dec 2012 12:23:04 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121212122305.6360723889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Wed Dec 12 12:23:03 2012 New Revision: 1420637 URL: http://svn.apache.org/viewvc?rev=1420637&view=rev Log: Update functional test suite Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java?rev=1420637&r1=1420636&r2=1420637&view=diff ============================================================================== --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java (original) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java Wed Dec 12 12:23:03 2012 @@ -39,6 +39,7 @@ public class ListingFunctionalTest exten static final int INVALID_PATH = 3; static final int VALID_FILENAME = 4; static final int VALID_PATH = 5; + static final int PATH_PWD = 6; // response to PWD public static final Test suite() { @@ -47,16 +48,24 @@ public class ListingFunctionalTest exten { "ftp.ibiblio.org", "unix", "vms", "HA!", "javaio.jar", - "pub/languages/java/javafaq" + "pub/languages/java/javafaq", + "/pub/languages/java/javafaq", }, { - "ftp.wacom.com", "windows", "VMS", "HA!", - "wacom97.zip", "pub\\drivers" + "apache.cs.utah.edu", "unix", "vms", + "HA!", "HEADER.html", + "apache.org", + "/apache.org", }, +// { // not available +// "ftp.wacom.com", "windows", "VMS", "HA!", +// "wacom97.zip", "pub\\drivers" +// }, { "ftp.decuslib.com", "vms", "windows", // VMS OpenVMS V8.3 "[.HA!]", "FREEWARE_SUBMISSION_INSTRUCTIONS.TXT;1", - "[.FREEWAREV80.FREEWARE]" + "[.FREEWAREV80.FREEWARE]", + "DECUSLIB:[DECUS.FREEWAREV80.FREEWARE]" }, // { // VMS TCPware V5.7-2 does not return (RWED) permissions // "ftp.process.com", "vms", "windows", @@ -95,6 +104,7 @@ public class ListingFunctionalTest exten private String validFilename; private String validParserKey; private String validPath; + private String pwdPath; /** * Constructor for FTPClientTest. @@ -110,6 +120,7 @@ public class ListingFunctionalTest exten invalidPath = settings[INVALID_PATH]; validFilename = settings[VALID_FILENAME]; validPath = settings[VALID_PATH]; + pwdPath = settings[PATH_PWD]; hostName = settings[HOSTNAME]; } @@ -157,6 +168,7 @@ public class ListingFunctionalTest exten client.connect(hostName); client.login("anonymous", "anonymous"); client.enterLocalPassiveMode(); +// client.addProtocolCommandListener(new PrintCommandListener(System.out)); } /* @@ -285,7 +297,10 @@ public class ListingFunctionalTest exten FTPFile[] files = client.listFiles(validPath); - assertEquals(0, files.length); + assertNotNull(files); + + // This may well fail, e.g. window parser for VMS listing + assertTrue("Expected empty array: "+Arrays.toString(files), Arrays.equals(new FTPFile[]{}, files)); } /* @@ -350,4 +365,12 @@ public class ListingFunctionalTest exten assertNull(names); } + + public void testprintWorkingDirectory() + throws IOException + { + client.changeWorkingDirectory(validPath); + String pwd = client.printWorkingDirectory(); + assertEquals(pwdPath, pwd); + } }