mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-8671 When listing Blogs/Lists/Discussions, the tag filter string is encoded before sending, so must be decoded in the webscript before searching. (Plus blog tagging test enhancements)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32146 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -320,7 +320,9 @@ public class BlogServiceImplTest
|
|||||||
|
|
||||||
@Test public void createTaggedDraftBlogPost() throws Exception
|
@Test public void createTaggedDraftBlogPost() throws Exception
|
||||||
{
|
{
|
||||||
final List<String> tags = Arrays.asList(new String[]{"alpha", "beta", "gamma"});
|
// Our tags, which are a mixture of English, Accented European and Chinese
|
||||||
|
final List<String> tags = Arrays.asList(new String[]{
|
||||||
|
"alpha", "beta", "gamma", "fran\u00e7ais", "chinese_\u535a\u5ba2"});
|
||||||
|
|
||||||
// Create a list of Blog Posts, all drafts, each with one of the tags above.
|
// Create a list of Blog Posts, all drafts, each with one of the tags above.
|
||||||
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<List<NodeRef>>()
|
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<List<NodeRef>>()
|
||||||
@@ -344,6 +346,7 @@ public class BlogServiceImplTest
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Check we get the correct tags back
|
||||||
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
|
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@@ -363,13 +366,35 @@ public class BlogServiceImplTest
|
|||||||
NodeRef blogNode = bpi.getNodeRef();
|
NodeRef blogNode = bpi.getNodeRef();
|
||||||
List<String> recoveredTags = TAGGING_SERVICE.getTags(blogNode);
|
List<String> recoveredTags = TAGGING_SERVICE.getTags(blogNode);
|
||||||
assertEquals("Wrong number of tags", 1, recoveredTags.size());
|
assertEquals("Wrong number of tags", 1, recoveredTags.size());
|
||||||
assertTrue("Missing expected tag", expectedTags.remove(recoveredTags.get(0)));
|
|
||||||
|
String tag = recoveredTags.get(0);
|
||||||
|
assertTrue("Tag found on node but not expected: " + tag, expectedTags.remove(tag));
|
||||||
}
|
}
|
||||||
assertTrue("Not all tags were recovered from a blogpost", expectedTags.isEmpty());
|
assertTrue("Not all tags were recovered from a blogpost", expectedTags.isEmpty());
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Check we can find the posts by their tags
|
||||||
|
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Void execute() throws Throwable
|
||||||
|
{
|
||||||
|
PagingRequest pagingReq = new PagingRequest(0, 10, null);
|
||||||
|
RangedDateProperty dates = new RangedDateProperty(null, null, ContentModel.PROP_CREATED);
|
||||||
|
for (String tag : tags)
|
||||||
|
{
|
||||||
|
PagingResults<BlogPostInfo> pagedResults =
|
||||||
|
BLOG_SERVICE.findBlogPosts(BLOG_CONTAINER_NODE, dates, tag, pagingReq);
|
||||||
|
|
||||||
|
// Check we found our post
|
||||||
|
assertEquals("Wrong number of blog posts for " + tag, 1, pagedResults.getPage().size());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user