mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Further method implementations of ML service
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4738 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -127,5 +127,46 @@ public class MultilingualContentServiceImplTest extends TestCase
|
||||
NodeRef mlContainerNodeRef = multilingualContentService.makeTranslation(contentNodeRef, Locale.CHINESE);
|
||||
// Check it
|
||||
assertNotNull("Container not created", mlContainerNodeRef);
|
||||
// Check the container child count
|
||||
int childCount = nodeService.getChildAssocs(mlContainerNodeRef).size();
|
||||
assertEquals("Incorrect number of child nodes", 1, childCount);
|
||||
}
|
||||
|
||||
public void testAddTranslationUsingContainer() throws Exception
|
||||
{
|
||||
// Make a container with a single translation
|
||||
NodeRef chineseContentNodeRef = createContent();
|
||||
NodeRef mlContainerNodeRef = multilingualContentService.makeTranslation(chineseContentNodeRef, Locale.CHINESE);
|
||||
// Create some more content
|
||||
NodeRef frenchContentNodeRef = createContent();
|
||||
// Make this a translation of the Chinese
|
||||
NodeRef newMLContainerNodeRef = multilingualContentService.addTranslation(
|
||||
frenchContentNodeRef,
|
||||
mlContainerNodeRef,
|
||||
Locale.FRENCH);
|
||||
// Make sure that the original container was used
|
||||
assertEquals("Existing container should have been used", mlContainerNodeRef, newMLContainerNodeRef);
|
||||
// Check the container child count
|
||||
int childCount = nodeService.getChildAssocs(mlContainerNodeRef).size();
|
||||
assertEquals("Incorrect number of child nodes", 2, childCount);
|
||||
}
|
||||
|
||||
public void testAddTranslationUsingContent() throws Exception
|
||||
{
|
||||
// Make a container with a single translation
|
||||
NodeRef chineseContentNodeRef = createContent();
|
||||
NodeRef mlContainerNodeRef = multilingualContentService.makeTranslation(chineseContentNodeRef, Locale.CHINESE);
|
||||
// Create some more content
|
||||
NodeRef frenchContentNodeRef = createContent();
|
||||
// Make this a translation of the Chinese
|
||||
NodeRef newMLContainerNodeRef = multilingualContentService.addTranslation(
|
||||
frenchContentNodeRef,
|
||||
chineseContentNodeRef,
|
||||
Locale.FRENCH);
|
||||
// Make sure that the original container was used
|
||||
assertEquals("Existing container should have been used", mlContainerNodeRef, newMLContainerNodeRef);
|
||||
// Check the container child count
|
||||
int childCount = nodeService.getChildAssocs(mlContainerNodeRef).size();
|
||||
assertEquals("Incorrect number of child nodes", 2, childCount);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user