mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
10963: Merged DEV/LARGE_COLLECTION_PROPERTIES_2.2.1 to V2.2 - PersonService: Lucene removal - Lucene optimizations (in progress) - Multi-valued and locale-specific properties persisted in alf_node_properties - Removal of unused AVM tables 10987: Oracle dialects and enhanced SQL patch support - Only support Alfresco's 9i and 10g dialects (with auto-switching) - SQL script patches can now apply selectively to ranges 11007: Test to check cached retrieval of QNames git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11206 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -141,6 +141,39 @@ public class QNameDAOTest extends TestCase
|
||||
retryingTransactionHelper.doInTransaction(callback);
|
||||
}
|
||||
|
||||
public void testGetQNameManyTimes() throws Exception
|
||||
{
|
||||
final String namespaceUri = GUID.generate();
|
||||
final String localName = GUID.generate();
|
||||
final QName qname = QName.createQName(namespaceUri, localName);
|
||||
RetryingTransactionCallback<QNameEntity> callback = new RetryingTransactionCallback<QNameEntity>()
|
||||
{
|
||||
public QNameEntity execute() throws Throwable
|
||||
{
|
||||
QNameEntity qnameEntity = dao.getQNameEntity(qname);
|
||||
assertNull("QName should not exist yet", qnameEntity);
|
||||
// Now make it
|
||||
qnameEntity = dao.newQNameEntity(qname);
|
||||
assertNotNull("QName should now exist", dao.getQNameEntity(qname));
|
||||
// Done
|
||||
return qnameEntity;
|
||||
}
|
||||
};
|
||||
retryingTransactionHelper.doInTransaction(callback);
|
||||
callback = new RetryingTransactionCallback<QNameEntity>()
|
||||
{
|
||||
public QNameEntity execute() throws Throwable
|
||||
{
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
dao.getQNameEntity(qname);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
retryingTransactionHelper.doInTransaction(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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