public class SimpleMetaStoreUserPropertyCacheTests {
@Test
public void testAddAllUsers() throws CoreException {
// create a user property cache for a property
SimpleMetaStoreUserPropertyCache userPropertyCache = new SimpleMetaStoreUserPropertyCache();
List<String> propertyKeys = new ArrayList<String>();
propertyKeys.add(UserConstants2.USER_NAME);
userPropertyCache.register(propertyKeys);
assertTrue(userPropertyCache.isRegistered(UserConstants2.USER_NAME));
// add some users to the cache
String users[] = {"anthony", "ahunter", "anthonyh"};
List<String> userList = new ArrayList<String>(Arrays.asList(users));
userPropertyCache.addUsers(userList);
// ensure the users are in the cache
assertEquals("anthony", userPropertyCache.readUserByProperty(UserConstants2.USER_NAME, "anthony", false, false));
assertEquals("ahunter", userPropertyCache.readUserByProperty(UserConstants2.USER_NAME, "ahunter", false, false));
assertEquals("anthonyh", userPropertyCache.readUserByProperty(UserConstants2.USER_NAME, "anthonyh", false, false));
assertNull(userPropertyCache.readUserByProperty(UserConstants2.USER_NAME, "fred", false, false));
}