diff --git a/source/java/org/alfresco/filesys/FTPServerTest.java b/source/java/org/alfresco/filesys/FTPServerTest.java index 4a9806f5f2..2d6c29b765 100644 --- a/source/java/org/alfresco/filesys/FTPServerTest.java +++ b/source/java/org/alfresco/filesys/FTPServerTest.java @@ -285,20 +285,24 @@ public class FTPServerTest extends TestCase // Wild card reply = ftp.cwd("/Alfresco/User*Homes"); - assertTrue(FTPReply.isPositiveCompletion(reply)); + assertTrue("unable to change to /Alfresco User*Homes/", FTPReply.isPositiveCompletion(reply)); + +// // Single char pattern match +// reply = ftp.cwd("/Alfre?co"); +// assertTrue("Unable to match single char /Alfre?co", FTPReply.isPositiveCompletion(reply)); // two level folder reply = ftp.cwd("/Alfresco/Data Dictionary"); - assertTrue(FTPReply.isPositiveCompletion(reply)); + assertTrue("unable to change to /Alfresco/Data Dictionary", FTPReply.isPositiveCompletion(reply)); // go up one reply = ftp.cwd(".."); - assertTrue(FTPReply.isPositiveCompletion(reply)); + assertTrue("unable to change to ..", FTPReply.isPositiveCompletion(reply)); reply = ftp.pwd(); ftp.getStatus(); - assertTrue(FTPReply.isPositiveCompletion(reply)); + assertTrue("unable to get status", FTPReply.isPositiveCompletion(reply)); // check we are at the correct point in the tree reply = ftp.cwd("Data Dictionary"); @@ -386,7 +390,7 @@ public class FTPServerTest extends TestCase InputStream is2 = ftp.retrieveFileStream(FILE1_NAME); String content2 = inputStreamToString(is2); - assertEquals("Content is not as expected", content2, FILE1_CONTENT_2); + assertEquals("Content is not as expected", FILE1_CONTENT_2, content2); ftp.completePendingCommand(); // now delete the file we have been using. diff --git a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java index 80276acf3c..9a9057c3f9 100644 --- a/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java +++ b/source/java/org/alfresco/filesys/repo/ContentDiskDriver2.java @@ -1084,7 +1084,7 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD if (logger.isDebugEnabled()) { - logger.debug("Created file: path=" + name + " node=" + nodeRef + " network file=" + netFile); + logger.debug("Created temporary file: path=" + name + " node=" + nodeRef + " network file=" + netFile); } } diff --git a/source/java/org/alfresco/filesys/repo/rules/ScenarioOpenFileInstance.java b/source/java/org/alfresco/filesys/repo/rules/ScenarioOpenFileInstance.java index f568db082d..c84067c019 100644 --- a/source/java/org/alfresco/filesys/repo/rules/ScenarioOpenFileInstance.java +++ b/source/java/org/alfresco/filesys/repo/rules/ScenarioOpenFileInstance.java @@ -192,7 +192,7 @@ class ScenarioOpenFileInstance implements ScenarioInstance if(name.equalsIgnoreCase(c.getName())) { NetworkFile file = c.getNetworkFile(); - if(file.isReadOnly()) + if(isReadOnly(file)) { // Read Only File if(openReadOnlyCount == 1) @@ -410,9 +410,7 @@ class ScenarioOpenFileInstance implements ScenarioInstance state = InternalState.OPEN; - // - if(fileHandle.getGrantedAccess() == NetworkFile.READONLY) - //if(fileHandle.isReadOnly()) + if(isReadOnly(fileHandle)) { openReadOnlyCount++; fileHandleReadOnly=fileHandle; @@ -442,6 +440,9 @@ class ScenarioOpenFileInstance implements ScenarioInstance }; } - + private boolean isReadOnly(NetworkFile file) + { + return (file.getGrantedAccess() == NetworkFile.READONLY); + } }