Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6645

[classlib][auth]Tidy up and tests of javax.security.auth.Subject.java

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.0M2, 5.0M14
    • None
    • Classlib
    • None
    • All

    Description

      I have investigated Subject.java to understand the differences in behaviour between the RI and Harmony. There are several differences noted in the test files SubjectTest.java and SecurityTest.java which I have investigated and then mades some changes.

      I will attach a patch with my changes which can be divided into the following parts:

      • Change to Subject.toString(): Changed to match RI so that I could write a testcase (there was a FIXME in the code).
      • When invalid Principal objects are put into the Principal set, I have changed the exception from IllegalArgumentException to SecurityException. The message text is unchanged (for example, "Element is not instance of java.security.Principal". My reasoning is that applications would be expecting the SecurityException in this case although it could be argued that an IllegalArgumentException is more suitable for adding to a Set. I have updated the relevant tests.
      • I have added comments to all the tests which show different behaviour on the RI so that it is easy to understand which tests are different and why.

      Attachments

        1. auth-Subject2.patch
          13 kB
          Colin Thorne
        2. auth-Subject.patch
          12 kB
          Colin Thorne

        Activity

          People

            Unassigned Unassigned
            cjthorne Colin Thorne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: