mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
79277: Merged DEV to HEAD-BUG-FIX 79272 : MNT-11511 : All tags are not displayed in repository when the number of nodes taggable is over 1000 - Fixed failures on V5.0 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82696 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -195,6 +195,7 @@ public class TaggingServiceTest extends BaseWebScriptTest
|
|||||||
|
|
||||||
public void testTagCountSearch() throws Exception
|
public void testTagCountSearch() throws Exception
|
||||||
{
|
{
|
||||||
|
int TAGS_NUM = 1200;
|
||||||
boolean removeTestFolder = false;
|
boolean removeTestFolder = false;
|
||||||
boolean removeTagScope = false;
|
boolean removeTagScope = false;
|
||||||
FileInfo testFolderInfo = null;
|
FileInfo testFolderInfo = null;
|
||||||
@@ -213,7 +214,7 @@ public class TaggingServiceTest extends BaseWebScriptTest
|
|||||||
//generate content with tag
|
//generate content with tag
|
||||||
UserTransaction transaction = transactionService.getUserTransaction();
|
UserTransaction transaction = transactionService.getUserTransaction();
|
||||||
transaction.begin();
|
transaction.begin();
|
||||||
for (int i = 0; i < 1200; i++)
|
for (int i = 0; i < TAGS_NUM; i++)
|
||||||
{
|
{
|
||||||
FileInfo file = this.fileFolderService.create(testFolderInfo.getNodeRef(), "testDoc" + i + ".txt", ContentModel.TYPE_CONTENT);
|
FileInfo file = this.fileFolderService.create(testFolderInfo.getNodeRef(), "testDoc" + i + ".txt", ContentModel.TYPE_CONTENT);
|
||||||
this.taggingService.addTag(file.getNodeRef(), tagName);
|
this.taggingService.addTag(file.getNodeRef(), tagName);
|
||||||
@@ -251,12 +252,22 @@ public class TaggingServiceTest extends BaseWebScriptTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// tag count via tagScope API
|
// tag count via tagScope API
|
||||||
response = sendRequest(new GetRequest("api/tagscopes/node/" + testRoot.toString().replace(":/", "") + "/tags"), 200);
|
int BREAK_COUNT = 80;
|
||||||
jsonObj = new JSONObject(response.getContentAsString());
|
int counter = 1;
|
||||||
tagsArr = jsonObj.getJSONArray("tags");
|
do
|
||||||
number = getTagNumber(tagName, tagsArr);
|
{
|
||||||
assertEquals("Checking a search via tagScope API: Tag number must be 1200, because node is a tag scope.", 1200, number);
|
response = sendRequest(new GetRequest("api/tagscopes/node/" + testRoot.toString().replace(":/", "") + "/tags"), 200);
|
||||||
|
jsonObj = new JSONObject(response.getContentAsString());
|
||||||
|
tagsArr = jsonObj.getJSONArray("tags");
|
||||||
|
number = getTagNumber(tagName, tagsArr);
|
||||||
|
if (number == TAGS_NUM)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Thread.sleep(500);
|
||||||
|
}
|
||||||
|
while (counter ++ <= BREAK_COUNT);
|
||||||
|
assertEquals("Checking a search via tagScope API: Tag number must be "+ TAGS_NUM + ", because node is a tag scope.", TAGS_NUM, number);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user