mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added API methods to query AVM store properties by key pattern.
Cleaned up some warnings in AVMInterpreter. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3765 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2477,4 +2477,38 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Store property querying.
|
||||
*/
|
||||
public void testStorePropertyQuerying()
|
||||
{
|
||||
try
|
||||
{
|
||||
fService.setStoreProperty("main", QName.createQName(null, ".dns.alice--preview"),
|
||||
new PropertyValue(null, "alice-preview"));
|
||||
fService.setStoreProperty("main", QName.createQName("", ".other.property"),
|
||||
new PropertyValue(null, "other value"));
|
||||
Map<QName, PropertyValue> result =
|
||||
fService.queryStorePropertyKey("main", QName.createQName("", ".dns.%"));
|
||||
assertEquals(1, result.size());
|
||||
fService.createAVMStore("second");
|
||||
fService.setStoreProperty("second", QName.createQName("", ".dns.alice"),
|
||||
new PropertyValue(null, "alice-space"));
|
||||
Map<String, Map<QName, PropertyValue>> matches =
|
||||
fService.queryStoresPropertyKeys(QName.createQName("", ".dns.%"));
|
||||
assertEquals(2, matches.size());
|
||||
assertEquals(1, matches.get("main").size());
|
||||
assertEquals(1, matches.get("second").size());
|
||||
assertEquals("alice-preview", matches.get("main").get(QName.createQName(null,
|
||||
".dns.alice--preview")).getStringValue());
|
||||
assertEquals("alice-space", matches.get("second").get(QName.createQName(null, ".dns.alice")).
|
||||
getStringValue());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace(System.err);
|
||||
fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user