mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
5466, 5471-5475: ModuleManagementTool enhancements git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5487 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
package org.alfresco.repo.admin.registry;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
@@ -73,6 +75,8 @@ public class RegistryServiceImplTest extends TestCase
|
||||
private static final Long VALUE_ONE = 1L;
|
||||
private static final Long VALUE_TWO = 2L;
|
||||
private static final Long VALUE_THREE = 3L;
|
||||
private static final RegistryKey KEY_A_B_0 = new RegistryKey(null, "a", "b", "0");
|
||||
private static final RegistryKey KEY_A_B_1 = new RegistryKey(null, "a", "b", "1");
|
||||
private static final RegistryKey KEY_A_B_C_0 = new RegistryKey(null, "a", "b", "c", "0");
|
||||
private static final RegistryKey KEY_A_B_C_1 = new RegistryKey(null, "a", "b", "c", "1");
|
||||
private static final RegistryKey KEY_A_B_C_2 = new RegistryKey(null, "a", "b", "c", "2");
|
||||
@@ -83,6 +87,7 @@ public class RegistryServiceImplTest extends TestCase
|
||||
private static final RegistryKey KEY_A_B_C_D_3 = new RegistryKey(null, "a", "b", "c", "d", "3");
|
||||
private static final RegistryKey KEY_X_Y_Z_0 = new RegistryKey(null, "x", "y", "z", "0");
|
||||
private static final RegistryKey KEY_SPECIAL = new RegistryKey(null, "me & you", "whatever");
|
||||
private static final RegistryKey KEY_DOES_NOT_EXIST = new RegistryKey(null, "does", "not", "exist");
|
||||
/**
|
||||
* General writing and reading back.
|
||||
*/
|
||||
@@ -107,6 +112,22 @@ public class RegistryServiceImplTest extends TestCase
|
||||
assertNull("Missing key should return null value", registryService.getValue(KEY_X_Y_Z_0));
|
||||
}
|
||||
|
||||
public void testGetElements() throws Exception
|
||||
{
|
||||
registryService.addValue(KEY_A_B_C_1, VALUE_ONE);
|
||||
registryService.addValue(KEY_A_B_C_2, VALUE_TWO);
|
||||
|
||||
// Check that we get an empty list for a random query
|
||||
assertEquals("Excpected empty collection for random query", 0, registryService.getChildElements(KEY_DOES_NOT_EXIST).size());
|
||||
|
||||
// Check that the property part of the key is ignored
|
||||
assertEquals("Incorrect number ofchild elements", 1, registryService.getChildElements(KEY_A_B_0).size());
|
||||
assertEquals("Incorrect number ofchild elements", 1, registryService.getChildElements(KEY_A_B_1).size());
|
||||
|
||||
Collection<String> childElements = registryService.getChildElements(KEY_A_B_0);
|
||||
assertTrue("Incorrect child elements retrieved", childElements.contains("c"));
|
||||
}
|
||||
|
||||
public void testSpecialCharacters()
|
||||
{
|
||||
registryService.addValue(KEY_SPECIAL, VALUE_THREE);
|
||||
|
Reference in New Issue
Block a user