//check for a dummy non-existent user (both the implementations should
//return an empty list
testForUser("fooBarBaz1234DoesNotExist");
}
private void testForUser(String user) throws Exception {
GroupMappingServiceProvider g = new ShellBasedUnixGroupsMapping();
List<String> shellBasedGroups = g.getGroups(user);
g = new JniBasedUnixGroupsMapping();
List<String> jniBasedGroups = g.getGroups(user);
String[] shellBasedGroupsArray = shellBasedGroups.toArray(new String[0]);
Arrays.sort(shellBasedGroupsArray);
String[] jniBasedGroupsArray = jniBasedGroups.toArray(new String[0]);
Arrays.sort(jniBasedGroupsArray);