From f6df5ceaced6b050d4b83955a67b572631039a28 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Mon, 6 Oct 2008 14:27:23 +0000 Subject: [PATCH] Fix for ETHREEOH-220 (I18N issue with tag scopes) and readded init-method to async action queues (stopped unit tests dependant on callback from running) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11213 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/action-services-context.xml | 4 +-- .../repo/tagging/TaggingServiceImpl.java | 2 +- .../repo/tagging/TaggingServiceImplTest.java | 29 ++++++++++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/config/alfresco/action-services-context.xml b/config/alfresco/action-services-context.xml index decdaf9bc9..9320d07264 100644 --- a/config/alfresco/action-services-context.xml +++ b/config/alfresco/action-services-context.xml @@ -34,7 +34,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/source/java/org/alfresco/repo/tagging/TaggingServiceImpl.java b/source/java/org/alfresco/repo/tagging/TaggingServiceImpl.java index cf12aa6d68..fbdbc6624c 100644 --- a/source/java/org/alfresco/repo/tagging/TaggingServiceImpl.java +++ b/source/java/org/alfresco/repo/tagging/TaggingServiceImpl.java @@ -674,9 +674,9 @@ public class TaggingServiceImpl implements TaggingService, { List result = new ArrayList(25); - BufferedReader reader = new BufferedReader(new InputStreamReader(is)); try { + BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String nextLine = reader.readLine(); while (nextLine != null) { diff --git a/source/java/org/alfresco/repo/tagging/TaggingServiceImplTest.java b/source/java/org/alfresco/repo/tagging/TaggingServiceImplTest.java index 84059a6d3b..e1f6c3964c 100644 --- a/source/java/org/alfresco/repo/tagging/TaggingServiceImplTest.java +++ b/source/java/org/alfresco/repo/tagging/TaggingServiceImplTest.java @@ -41,6 +41,7 @@ import org.alfresco.repo.policy.PolicyComponent; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.ActionService; +import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; @@ -82,6 +83,7 @@ public class TaggingServiceImplTest extends BaseAlfrescoSpringTest private static final String TAG_3 = "Tag Three"; private static final String TAG_4 = "tag four"; private static final String TAG_5 = "tag five"; + private static final String TAG_I18N = "àâæçéèêëîïôœùûüÿñ"; private static final String UPPER_TAG = "House"; private static final String LOWER_TAG = "house"; @@ -279,7 +281,7 @@ public class TaggingServiceImplTest extends BaseAlfrescoSpringTest assertNotNull(tags); assertEquals(2, tags.size()); assertTrue(tags.contains(TAG_1)); - assertTrue(tags.contains(TAG_2)); + assertTrue(tags.contains(TAG_2)); this.taggingService.removeTag(this.document, TAG_1); tags = this.taggingService.getTags(this.document); @@ -496,6 +498,31 @@ public class TaggingServiceImplTest extends BaseAlfrescoSpringTest assertEquals(1, ts1.getTag(TAG_4).getCount()); } + /* + * https://issues.alfresco.com/jira/browse/ETHREEOH-220 + */ + public void testETHREEOH_220() throws Exception + { + this.taggingService.addTagScope(this.folder);; + this.taggingService.addTag(this.folder, TAG_I18N); + waitForActionExecution(); + + // Get the tag from the node + List tags = this.taggingService.getTags(this.folder); + assertNotNull(tags); + assertEquals(1, tags.size()); + assertEquals(TAG_I18N, tags.get(0)); + + // Get the tag from the tagscope + TagScope tagScope = this.taggingService.findTagScope(this.folder); + assertNotNull(tagScope); + assertEquals(1, tagScope.getTags().size()); + TagDetails tagDetails = tagScope.getTag(TAG_I18N); + assertNotNull(tagDetails); + assertEquals(TAG_I18N, tagDetails.getName()); + assertEquals(1, tagDetails.getCount()); + } + // == Test the JavaScript API == public void testJSAPI() throws Exception