mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.3 to HEAD (3180:3203, 3204:3217)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3180 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3203 . svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3204 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3217 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3407 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -417,19 +417,20 @@ public class FileFolderServiceImplTest extends TestCase
|
||||
{
|
||||
// create a completely new path below the root
|
||||
List<String> namePath = new ArrayList<String>(4);
|
||||
namePath.add("A");
|
||||
namePath.add("B");
|
||||
namePath.add("C");
|
||||
namePath.add("D");
|
||||
namePath.add("AAA");
|
||||
namePath.add("BBB");
|
||||
namePath.add("CCC");
|
||||
namePath.add("DDD");
|
||||
|
||||
FileInfo lastFileInfo = fileFolderService.makeFolders(rootNodeRef, namePath, ContentModel.TYPE_FOLDER);
|
||||
assertNotNull("First makeFolder failed", lastFileInfo);
|
||||
// check that a repeat works
|
||||
|
||||
FileInfo lastFileInfoAgain = fileFolderService.makeFolders(rootNodeRef, namePath, ContentModel.TYPE_FOLDER);
|
||||
assertNotNull("Repeat makeFolders failed", lastFileInfoAgain);
|
||||
assertEquals("Repeat created new leaf", lastFileInfo.getNodeRef(), lastFileInfoAgain.getNodeRef());
|
||||
// check that it worked
|
||||
List<FileInfo> checkInfos = fileFolderService.search(rootNodeRef, "D", false, true, true);
|
||||
List<FileInfo> checkInfos = fileFolderService.search(rootNodeRef, "DDD", false, true, true);
|
||||
assertEquals("Expected to find a result", 1, checkInfos.size());
|
||||
// get the path
|
||||
List<FileInfo> checkPathInfos = fileFolderService.getNamePath(rootNodeRef, checkInfos.get(0).getNodeRef());
|
||||
@@ -442,6 +443,27 @@ public class FileFolderServiceImplTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lucene only indexes terms that are 3 characters or more
|
||||
*/
|
||||
public void testMakeFoldersShortNames() throws Exception
|
||||
{
|
||||
// create a completely new path below the root
|
||||
List<String> namePath = new ArrayList<String>(4);
|
||||
namePath.add("A");
|
||||
namePath.add("B");
|
||||
namePath.add("C");
|
||||
namePath.add("D");
|
||||
|
||||
FileInfo lastFileInfo = fileFolderService.makeFolders(rootNodeRef, namePath, ContentModel.TYPE_FOLDER);
|
||||
assertNotNull("First makeFolder failed", lastFileInfo);
|
||||
// check that a repeat works
|
||||
|
||||
FileInfo lastFileInfoAgain = fileFolderService.makeFolders(rootNodeRef, namePath, ContentModel.TYPE_FOLDER);
|
||||
assertNotNull("Repeat makeFolders failed", lastFileInfoAgain);
|
||||
assertEquals("Repeat created new leaf", lastFileInfo.getNodeRef(), lastFileInfoAgain.getNodeRef());
|
||||
}
|
||||
|
||||
public void testGetNamePath() throws Exception
|
||||
{
|
||||
FileInfo fileInfo = getByName(NAME_L1_FILE_A, false);
|
||||
|
Reference in New Issue
Block a user