From a7bf5857274c072e01a2db6f06a2463e609bde41 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Fri, 13 May 2011 20:44:32 +0000 Subject: [PATCH] HADOOP-7290. Unit test failure in TestUserGroupInformation.testGetServerSideGroups. Contributed by Trevor Robison git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1102893 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ .../apache/hadoop/security/TestUserGroupInformation.java | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a89bd515fb..dc0ee80861 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -214,6 +214,8 @@ Trunk (unreleased changes) HADOOP-7268. FileContext.getLocalFSFileContext() behavior needs to be fixed w.r.t tokens. (jitendra) + HADOOP-7290. Unit test failure in TestUserGroupInformation.testGetServerSideGroups. (Trevor Robison via eli) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/src/test/core/org/apache/hadoop/security/TestUserGroupInformation.java b/src/test/core/org/apache/hadoop/security/TestUserGroupInformation.java index 9c0ef6e249..afc49765ed 100644 --- a/src/test/core/org/apache/hadoop/security/TestUserGroupInformation.java +++ b/src/test/core/org/apache/hadoop/security/TestUserGroupInformation.java @@ -24,9 +24,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.security.PrivilegedExceptionAction; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; +import java.util.LinkedHashSet; +import java.util.Set; import javax.security.auth.Subject; import javax.security.auth.login.AppConfigurationEntry; @@ -81,7 +81,7 @@ public void testGetServerSideGroups() throws IOException, String line = br.readLine(); System.out.println(userName + ":" + line); - List groups = new ArrayList (); + Set groups = new LinkedHashSet (); for(String s: line.split("[\\s]")) { groups.add(s); } @@ -91,7 +91,7 @@ public void testGetServerSideGroups() throws IOException, String[] gi = login.getGroupNames(); assertEquals(groups.size(), gi.length); for(int i=0; i < gi.length; i++) { - assertEquals(groups.get(i), gi[i]); + assertTrue(groups.contains(gi[i])); } final UserGroupInformation fakeUser =