Tapestry
  1. Tapestry
  2. TAPESTRY-1778

Allow extending the PageTester with extra modules for better integration with tapestry-spring

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.5
    • Fix Version/s: 5.0.11
    • Labels:
      None

      Description

      The problem is that when PageTester creates the registry it does not adds SpringModuleDef to the list of modules and all Spring services are unavailable because of this. Extending the PageTester is not possible as well, so you cannot extend it and provide additional module (like the TapestrySpringFilter does), so you have to copy-paste the complete PageTester and add a single line to include SpringModuleDef module to the list.

      I suggest adding the method similar to the TapestryFilter#provideExtraModuleDefs() to the PageTester.

        Activity

        Hide
        Ivan Dubrov added a comment -

        Simple fix.

        Show
        Ivan Dubrov added a comment - Simple fix.
        Hide
        angerclown added a comment -

        Probably a good idea to have provideExtraModuleDefs() in PageTester, regardless of whether you need Spring or not.

        I think that there should be also a SpringPageTester subclass that already does the work needed for provideExtraModuleDefs(). I am not exactly sure how you would pass in the data you need to providedExtraModuleDefs. For Spring, you would need a list of file paths or Resource objects. Maybe the easiest, if somewhat inelegant way, would be to just read a system parameter and parse the String.

        Show
        angerclown added a comment - Probably a good idea to have provideExtraModuleDefs() in PageTester, regardless of whether you need Spring or not. I think that there should be also a SpringPageTester subclass that already does the work needed for provideExtraModuleDefs(). I am not exactly sure how you would pass in the data you need to providedExtraModuleDefs. For Spring, you would need a list of file paths or Resource objects. Maybe the easiest, if somewhat inelegant way, would be to just read a system parameter and parse the String.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Ivan Dubrov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development