directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn McKinney (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FC-199) GroupMgrImplTest.testRoleGroups fails apacheds
Date Thu, 27 Oct 2016 04:13:58 GMT

     [ https://issues.apache.org/jira/browse/FC-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shawn McKinney resolved FC-199.
-------------------------------
    Resolution: Fixed

> GroupMgrImplTest.testRoleGroups fails apacheds
> ----------------------------------------------
>
>                 Key: FC-199
>                 URL: https://issues.apache.org/jira/browse/FC-199
>             Project: FORTRESS
>          Issue Type: Sub-task
>    Affects Versions: 1.0.1
>            Reporter: Shawn McKinney
>            Assignee: Shawn McKinney
>            Priority: Minor
>             Fix For: 2.0.0-RC1
>
>
> The assertEquals cannot be used to compare collections as it is dependent on processing
order:
> for ( String[] roleArray : roles )
> {
>   Role role = RoleTestData.getRole(roleArray);
>   List<Group> actualGroups = groupMgr.roleGroups(role);
>   assertEquals( CLS_NM + ".roleGroups failed", expectedGroups, actualGroups);
> }
> change it to iterate over each group found and compare one by one:
> for ( String[] roleArray : roles )
> {
>    Role role = RoleTestData.getRole(roleArray);
>    List<Group> actualGroups = groupMgr.roleGroups(role);
>    assertNotNull( actualGroups );
>    // The two list sizes better match or fail the test case.
>    assertTrue( CLS_NM + "roleGroups list size test case",  actualGroups.size() == expectedGroups.size()
);
>   for ( Group actualGroup : actualGroups )
>   {
>       assertTrue( CLS_NM + "...."] not found", expectedGroups.contains( actualGroup )
);
>   }
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message