Merged BRANCHES/DEV/V3.4-BUG-FIX to HEAD:

32244: Fix for ALF-11435:
   32246: Fix for ALF-11435 (part 2)
   32247: Fix for ALF-11435 (part 3)
   plus make sure that hidden files have the noindex aspect applied

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32388 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2011-11-29 14:28:39 +00:00
parent 56e64bd627
commit ea53ffea50
13 changed files with 446 additions and 150 deletions

View File

@@ -33,6 +33,7 @@ import javax.transaction.UserTransaction;
import junit.framework.TestCase;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.jlan.server.FileFilterMode;
import org.alfresco.model.ContentModel;
import org.alfresco.model.ForumModel;
import org.alfresco.query.PagingRequest;
@@ -1277,6 +1278,35 @@ public class FileFolderServiceImplTest extends TestCase
beforeSleep.compareTo((Date)nodeService.getProperty(destinationFolderNodeRef, ContentModel.PROP_MODIFIED)) < 0);
}
public void testHiddenFiles()
{
FileFilterMode.setMode(FileFilterMode.Mode.ENHANCED);
NodeRef parent = fileFolderService.create(rootNodeRef, "New Folder", ContentModel.TYPE_FOLDER).getNodeRef();
NodeRef child = fileFolderService.create(parent, "file.tmp", ContentModel.TYPE_CONTENT).getNodeRef();
assertTrue(nodeService.hasAspect(child, ContentModel.ASPECT_TEMPORARY));
assertTrue(!nodeService.hasAspect(child, ContentModel.ASPECT_HIDDEN));
NodeRef parent1 = fileFolderService.create(rootNodeRef, ".TemporaryItems", ContentModel.TYPE_FOLDER).getNodeRef();
NodeRef child1 = fileFolderService.create(parent1, "file1", ContentModel.TYPE_CONTENT).getNodeRef();
assertTrue(nodeService.hasAspect(child1, ContentModel.ASPECT_TEMPORARY));
assertTrue(nodeService.hasAspect(child1, ContentModel.ASPECT_HIDDEN));
NodeRef parent2 = fileFolderService.create(rootNodeRef, "Folder 2", ContentModel.TYPE_FOLDER).getNodeRef();
NodeRef child2 = fileFolderService.create(parent2, "Thumbs.db", ContentModel.TYPE_CONTENT).getNodeRef();
assertTrue(!nodeService.hasAspect(child2, ContentModel.ASPECT_TEMPORARY));
assertTrue(nodeService.hasAspect(child2, ContentModel.ASPECT_HIDDEN));
List<FileInfo> children = fileFolderService.list(parent);
assertEquals(1, children.size());
children = fileFolderService.list(parent1);
assertEquals(1, children.size());
children = fileFolderService.list(parent2);
assertEquals(1, children.size());
}
public void testPatterns()
{
// sanity checks only (see also GetChildrenCannedQueryTest)