mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD (QNames)
7624: QName Refactor Merge 1 of 9 7625: QName Refactor Merge 2 of 9 7626: QName Refactor Merge 3 of 9 7627: QName Refactor Merge 4 of 9 7628: QName Refactor Merge 5 of 9 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8436 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,6 +52,7 @@ import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryException;
|
||||
@@ -1056,6 +1057,43 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a read-only transaction and then looks for a property using a non-existent QName.
|
||||
* The QName persistence must not lazily create QNameEntity instances for queries.
|
||||
*/
|
||||
public void testGetUnknownProperty() throws Exception
|
||||
{
|
||||
// commit to keep the root node
|
||||
setComplete();
|
||||
endTransaction();
|
||||
|
||||
RetryingTransactionCallback<NodeRef> createCallback = new RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
public NodeRef execute() throws Throwable
|
||||
{
|
||||
NodeRef nodeRef = nodeService.createNode(
|
||||
rootNodeRef,
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
QName.createQName("pathA"),
|
||||
ContentModel.TYPE_CONTAINER).getChildRef();
|
||||
return nodeRef;
|
||||
}
|
||||
};
|
||||
final NodeRef nodeRef = retryingTransactionHelper.doInTransaction(createCallback, false, true);
|
||||
|
||||
RetryingTransactionCallback<Object> testCallback = new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
QName ficticiousQName = QName.createQName(GUID.generate(), GUID.generate());
|
||||
Serializable value = nodeService.getProperty(nodeRef, ficticiousQName);
|
||||
assertNull("Didn't expect a value back", value);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
retryingTransactionHelper.doInTransaction(testCallback, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the type you get out of a <b>d:any</b> property is the type that you
|
||||
* put in.
|
||||
|
Reference in New Issue
Block a user