Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5031 Make AS5 compile/run under Java6
  3. JBAS-5498

JDK6: org.jboss.test.security.test.LoginModulesUnitTestCase

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • JBossAS-4.2.3.GA
    • None
    • Test Suite
    • None

      The tests, testJdbc() and testControlFlags() ,fail when run with JDK 6 as the assertions verifying if the role is valid fail. It appears to be the way the test is coded to look up the member in the Set of Groups. Simply backported the change which has been done for similar reasons in AS 5:

      • Group roles = (Group) groups.iterator().next();
        + Group roles = findRolesGroup(groups);
        assertTrue("Java is a role", roles.isMember(new SimplePrincipal("Java")));
        assertTrue("Coder is a role", roles.isMember(new SimplePrincipal("Coder")));
      • Group roles = (Group) groups.iterator().next();
        + Group roles = findRolesGroup(groups);
        // Only the roles from the DatabaseServerLoginModule should exist
        assertTrue("Role1 is a role", roles.isMember(new SimplePrincipal("Role1")));
        assertTrue("Role2 is a role", roles.isMember(new SimplePrincipal("Role2")));

      // Method to find the group named "Roles" in the given Set of groups.
      + private Group findRolesGroup(Set groups)
      + {
      + // Find the "Roles" group:
      + Iterator groupsIter = groups.iterator();
      + Group roles = null;
      + while (groupsIter.hasNext())

      { + roles = (Group)groupsIter.next(); + if (roles.getName().equals("Roles")) + break; + }

      + return roles;
      + }

              smcgowan@redhat.com Shelly McGowan (Inactive)
              smcgowan@redhat.com Shelly McGowan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: