javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-917

add a JUnit test to make sure that classes implementing FacesWrapper do wrap all public and protected methods of the wrapped class

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1, 2.2
    • Component/s: Uncategorized
    • Labels:
      None

      Description

      Often it gets forgotten to change the wrapper classes whe a method is changed or added to the wrapped class. This can result in unexpected behavior.

      Therfore I developed the attached JUnit test to scan all classes implementing FacesWrapper and make sure the wrappers do wrap all public and protected methods of the wrapped class.

      On the current 2.1.0 development stage as of 23. dec 2010, the following missing wrapper methods where detected:

      ResourceWrapper:

      • getContentType()
      • getLibraryName()
      • getResourceName()
      • setContentType(String)
      • setLibraryName(String)
      • setResourceName(String)

      ExternalContextWrapper:

      • getSessionMaxInactiveInterval()
      • isSecure()
      • setSessionMaxInactiveInterval()

      PartialViewContextWrapper

      • setPartialRequest(boolean)

      Since the above methods would cause API change and 2.1 closed, this has to be planned for 2.2.

      See also attached patch file providing the FacesWrapperTestCase and the minimal change for the wrapper classes.

      1. spec-917-FacesWrapper-testcase.patch
        13 kB
        Hanspeter Duennenberger
      2. spec-917-FacesWrapper-testcase-ready-for-commit.patch
        21 kB
        Hanspeter Duennenberger
      3. spec-917-FacesWrapper-testcase-with-docs.patch
        16 kB
        Hanspeter Duennenberger

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Hanspeter Duennenberger
              Reporter:
              Hanspeter Duennenberger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: