mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added multi-select for property values
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16542 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,9 +26,11 @@ package org.alfresco.repo.domain.propval;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -36,6 +38,7 @@ import javax.naming.CompositeName;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.alfresco.repo.domain.propval.PropertyValueDAO.PropertyFinderCallback;
|
||||
import org.alfresco.repo.props.PropertyUniqueConstraintViolation;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
@@ -498,6 +501,22 @@ public class PropertyValueDAOTest extends TestCase
|
||||
assertNotNull(entityValueCheck);
|
||||
assertEquals(value, entityValueCheck);
|
||||
|
||||
// Test the callback for multiple IDs
|
||||
final Map<Long, Serializable> propsById = new HashMap<Long, Serializable>();
|
||||
PropertyFinderCallback finderCallback = new PropertyFinderCallback()
|
||||
{
|
||||
public void handleProperty(Long id, Serializable value)
|
||||
{
|
||||
propsById.put(id, value);
|
||||
}
|
||||
};
|
||||
List<Long> entityIds = Collections.singletonList(entityId);
|
||||
propertyValueDAO.getPropertiesByIds(entityIds, finderCallback);
|
||||
|
||||
assertEquals("Should be exactly one value in map", 1, propsById.size());
|
||||
assertTrue("Expected ID to be in map", propsById.containsKey(entityId));
|
||||
assertEquals("Value was not retrieved correctly", value, propsById.get(entityId));
|
||||
|
||||
// Done
|
||||
return entityId;
|
||||
}
|
||||
|
Reference in New Issue
Block a user