[jboss-jira] [JBoss JIRA] Closed: (JBAS-4404) Tests testJdbc and testControlFlags in org.jboss.test.security.test.LoginModulesUnitTestCase may fail incorrectly

Anil Saldhana (JIRA) jira-events at lists.jboss.org
Wed Sep 26 16:37:41 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBAS-4404?page=all ]

Anil Saldhana closed JBAS-4404.
-------------------------------

    Resolution: Done

> Tests testJdbc and testControlFlags in org.jboss.test.security.test.LoginModulesUnitTestCase may fail incorrectly
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-4404
>                 URL: http://jira.jboss.com/jira/browse/JBAS-4404
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Test Suite
>    Affects Versions: JBossAS-5.0.0.Beta2, JBossAS-4.2.0.GA
>         Environment: Unisys MCP
>            Reporter: Stephen Burdeau
>         Assigned To: Anil Saldhana
>             Fix For:  JBossAS-5.0.0.Beta3, JBossAS-4.2.2.GA
>
>         Attachments: changes.txt, LoginModulesUnitTestCase.java
>
>
> Suites: org.jboss.test.security.test.LoginModulesUnitTestCase, org.jboss.test.security.test.XMLLoginModulesUnitTestCase
> Tests: testJdbc, testControlFlags
> When running these tests with JBoss AS 4.0.5 on the Unisys MCP system, these tests fail as follows:
> junit.framework.AssertionFailedError: Java is a role
> 	at org.jboss.test.security.test.LoginModulesUnitTestCase.testJdbc(LoginModulesUnitTestCase.java:879)
> and
> junit.framework.AssertionFailedError: Role1 is a role
> 	at org.jboss.test.security.test.LoginModulesUnitTestCase.testControlFlags(LoginModulesUnitTestCase.java:919)
> There appears to be a bug in the test code.  The tests testJdbc and testControlFlags use the org.jboss.security.auth.spi.DatabaseServerLoginModule to query for the roles allowed.  However, the call to subject.getPrincipals(Group.class) returns a Set with two groups: "Roles" and "CallerPrincipal".  Because a Set is unordered, the iterator for the set may return either "Roles" or "CallerPrincipal" first.  However, the test code always just looks at the first group in the Set and assumes it is the "Roles" group.  On the MCP, this first group seems to be the "CallerPrincipal" group, so the test assertions fail.
> I updated the test code to find the "Roles" group first before performing the assertions.  With this change, the tests pass on both the Unisys MCP and Windows systems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list