@Test public void testUserGroupNames() throws Exception { final String username = "testuser"; final ImmutableSet<String> singleGroups = ImmutableSet.of("group"); final Configuration conf = HBaseConfiguration.create(); User user = User.createUserForTesting(conf, username, singleGroups.toArray(new String[singleGroups.size()])); assertUserGroup(user, singleGroups); final ImmutableSet<String> multiGroups = ImmutableSet.of("group", "group1", "group2"); user = User.createUserForTesting(conf, username, multiGroups.toArray(new String[multiGroups.size()])); assertUserGroup(user, multiGroups); }
@Override Object writeReplace() { return new SerializedForm(toArray()); }
ImmutableList<E> createAsList() { return new RegularImmutableAsList<E>(this, toArray()); }
@Test public void testUserGroupNames() throws Exception { final String username = "testuser"; final ImmutableSet<String> singleGroups = ImmutableSet.of("group"); final Configuration conf = HBaseConfiguration.create(); User user = User.createUserForTesting(conf, username, singleGroups.toArray(new String[singleGroups.size()])); assertUserGroup(user, singleGroups); final ImmutableSet<String> multiGroups = ImmutableSet.of("group", "group1", "group2"); user = User.createUserForTesting(conf, username, multiGroups.toArray(new String[multiGroups.size()])); assertUserGroup(user, multiGroups); }