mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
11008: FileFolderService no longer uses Lucene 11014: Fixed ETWOTWO-569: Regression after ContentStoreCleaner overhaul 11021: Fixed HibernateSessionHelperTest 11028: Fixed unit test's expected values 11035: Made cm:auditable optional and fixed 64K limit on property list sizes 11038: IncompleteNodeTagger handles aspects that are not in the dictionary 11039: Added tests to ensure that QName caching is case-insensitive 11040: Fixed use of mixed-case QNames for aspects 11044: Allow background AND in-transaction indexing to be disabled at the same time. 11046: Removed Lucene use from RegistryServiceImpl 11050: Removal of Lucene usage - ML services finding root using XPath moved to path query - RepoStore now uses simple path query - Remove unused imports on PersonServiceImpl git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11215 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -174,6 +174,60 @@ public class QNameDAOTest extends TestCase
|
||||
retryingTransactionHelper.doInTransaction(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sinces the unique indexes are case-sensitive, we have to ensure that the DAO handles this accordingly.
|
||||
*/
|
||||
public void testNamespaceCaseInsensitivity() throws Throwable
|
||||
{
|
||||
final String guidNs = GUID.generate();
|
||||
final String namespaceUriLower = "aaa-" + guidNs;
|
||||
final String namespaceUriUpper = "AAA-" + guidNs;
|
||||
final QName namespaceUriLowerQName = QName.createQName(namespaceUriLower, "blah");
|
||||
final QName namespaceUriUpperQName = QName.createQName(namespaceUriUpper, "blah");
|
||||
final String localName = GUID.generate();
|
||||
final String localNameLower = "aaa-" + localName;
|
||||
final String localNameUpper = "AAA-" + localName;
|
||||
final QName localNameLowerQName = QName.createQName("blah", localNameLower);
|
||||
final QName localNameUpperQName = QName.createQName("blah", localNameUpper);
|
||||
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
// Create QNames with lowercase values
|
||||
dao.getOrCreateQNameEntity(namespaceUriLowerQName);
|
||||
dao.getOrCreateQNameEntity(localNameLowerQName);
|
||||
// Done
|
||||
return null;
|
||||
}
|
||||
};
|
||||
retryingTransactionHelper.doInTransaction(callback);
|
||||
RetryingTransactionCallback<Object> callback2 = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
// Check namespace case-insensitivity
|
||||
QNameEntity namespaceUriLowerQNameEntity = dao.getQNameEntity(namespaceUriLowerQName);
|
||||
assertNotNull(namespaceUriLowerQNameEntity);
|
||||
QNameEntity namespaceUriUpperQNameEntity = dao.getOrCreateQNameEntity(namespaceUriUpperQName);
|
||||
assertNotNull(namespaceUriUpperQNameEntity);
|
||||
assertEquals(
|
||||
"Didn't resolve case-insensitively on namespace",
|
||||
namespaceUriUpperQNameEntity.getId(), namespaceUriUpperQNameEntity.getId());
|
||||
// Check localname case-insensitivity
|
||||
QNameEntity localNameLowerQNameEntity = dao.getQNameEntity(localNameLowerQName);
|
||||
assertNotNull(localNameLowerQNameEntity);
|
||||
QNameEntity localNameUpperQNameEntity = dao.getOrCreateQNameEntity(localNameUpperQName);
|
||||
assertNotNull(localNameUpperQNameEntity);
|
||||
assertEquals(
|
||||
"Didn't resolve case-insensitively on local-name",
|
||||
localNameLowerQNameEntity.getId(), localNameUpperQNameEntity.getId());
|
||||
// Done
|
||||
return null;
|
||||
}
|
||||
};
|
||||
retryingTransactionHelper.doInTransaction(callback2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forces a bunch of threads to attempt QName creation at exactly the same time
|
||||
* for their first attempt. The subsequent retries should all succeed by
|
||||
|
Reference in New Issue
Block a user