From 7a1592c1eff1b648f2f4b0a8695e8594f080f9d3 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 12 Feb 2014 00:21:01 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 58836: ALF-20584 - FTP: changing case of filename fails with a nonsense error message. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62046 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/filesys/FTPServerTest.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/source/test-java/org/alfresco/filesys/FTPServerTest.java b/source/test-java/org/alfresco/filesys/FTPServerTest.java index 5f197755f3..740f433057 100644 --- a/source/test-java/org/alfresco/filesys/FTPServerTest.java +++ b/source/test-java/org/alfresco/filesys/FTPServerTest.java @@ -490,6 +490,68 @@ public class FTPServerTest extends TestCase } + + /** + * Test of rename case ALF-20584 + * + + */ + public void testRenameCase() throws Exception + { + + logger.debug("Start testRenameCase"); + + FTPClient ftp = connectClient(); + + String PATH1="testRenameCase"; + + try + { + int reply = ftp.getReplyCode(); + + if (!FTPReply.isPositiveCompletion(reply)) + { + fail("FTP server refused connection."); + } + + boolean login = ftp.login(USER_ADMIN, PASSWORD_ADMIN); + assertTrue("admin login successful", login); + + reply = ftp.cwd("/Alfresco/User*Homes"); + assertTrue(FTPReply.isPositiveCompletion(reply)); + + // Delete the root directory in case it was left over from a previous test run + try + { + ftp.removeDirectory(PATH1); + } + catch (IOException e) + { + // ignore this error + } + + // make root directory for this test + boolean success = ftp.makeDirectory(PATH1); + assertTrue("unable to make directory:" + PATH1, success); + + ftp.cwd(PATH1); + + String FILE1_CONTENT_2="That's how it is says Pooh!"; + ftp.storeFile("FileA.txt" , new ByteArrayInputStream(FILE1_CONTENT_2.getBytes("UTF-8"))); + + assertTrue("unable to rename", ftp.rename("FileA.txt", "FILEA.TXT")); + + } + finally + { + // clean up tree if left over from previous run + + ftp.disconnect(); + } + + + } // test Rename Case + /** * Create a user other than "admin" who has access to a set of files.