[jboss-jira] [JBoss JIRA] Created: (JBAS-4404) Tests testJdbc and testControlFlags in org.jboss.test.security.test.LoginModulesUnitTestCase may fail incorrectly
Stephen Burdeau (JIRA)
jira-events at lists.jboss.org
Mon May 7 15:04:52 EDT 2007
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-4.0.5.GA
Environment: Unisys MCP
Reporter: Stephen Burdeau
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