jersey
  1. jersey
  2. JERSEY-1893

JerseyTest prevents filters from handling forwarded requests

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.17, 2.0-rc2
    • Fix Version/s: 1.18
    • Component/s: test-framework
    • Labels:
      None

      Description

      In version 1.17.1, com.sun.jersey.test.framework.spi.container.grizzly2.web.GrizzlyWebTestContainerFactory.java line 235 invokes

      freg.addMappingForUrlPatterns(null, servletPathLocal);

      . The first argument denotes the type of dispatches that the filter will respond to. A value of "null" denotes only REQUEST dispatches are handled.

      If the application needs to handle FORWARD dispatches (and mine does) there is absolutely no way to configure JerseyTest to do so.

      It's not clear whether this has changed in 2.x because I can't find a way to configure filters at all in the new API.

        Activity

        Hide
        Jakub Podlesak added a comment -

        O.K., JERSEY-2173 is irrelevant to this one, but maybe the following could help you:

        Before building Jersey 1.x, set environment variables JERSEY_HTTP_PORT and JETTY_STOP_PORT
        so that they represent available port numbers in your system. Doe's it help you to build Jersey 1.x
        without getting these Bind Address already in use errors?
        Another port number that is required for running OSGi tests in Jersey 1.x is 1099,
        but that one is unfortunately not configurable.

        Show
        Jakub Podlesak added a comment - O.K., JERSEY-2173 is irrelevant to this one, but maybe the following could help you: Before building Jersey 1.x, set environment variables JERSEY_HTTP_PORT and JETTY_STOP_PORT so that they represent available port numbers in your system. Doe's it help you to build Jersey 1.x without getting these Bind Address already in use errors? Another port number that is required for running OSGi tests in Jersey 1.x is 1099, but that one is unfortunately not configurable.
        Hide
        cowwoc added a comment -

        It looks like I'm getting different build errors in Jersey 1.x and 2.x. I've filed JERSEY-2219 to discuss the Jersey 1.x build errors. Once that's solved, I'll submit the unit test you suggested.

        Show
        cowwoc added a comment - It looks like I'm getting different build errors in Jersey 1.x and 2.x. I've filed JERSEY-2219 to discuss the Jersey 1.x build errors. Once that's solved, I'll submit the unit test you suggested.
        Hide
        Jakub Podlesak added a comment -

        Never mind, i have just submitted an internal review request, that includes tests for Grizzly Web Container factory and Servlet RequestDispatcher forward/include features.
        Going to cancel your pull request.

        Regarding the build issues, i will discuss that in the respective bug reports.

        Show
        Jakub Podlesak added a comment - Never mind, i have just submitted an internal review request, that includes tests for Grizzly Web Container factory and Servlet RequestDispatcher forward/include features. Going to cancel your pull request. Regarding the build issues, i will discuss that in the respective bug reports.
        Hide
        Jakub Podlesak added a comment - - edited

        2.x version is missing test web container factory, i.e. the fix is not applicable there.

        Show
        Jakub Podlesak added a comment - - edited 2.x version is missing test web container factory, i.e. the fix is not applicable there.
        Hide
        cowwoc added a comment -

        We need to open a separate bug report for 2.x then (is there one already?) because I need to be able to pass servlet init parameters into the server. The real server requires these init parameters, so the test server needs them as well.

        Does this functionality exist in 2.x or was it removed (used to exist in 1.x)?

        Show
        cowwoc added a comment - We need to open a separate bug report for 2.x then (is there one already?) because I need to be able to pass servlet init parameters into the server. The real server requires these init parameters, so the test server needs them as well. Does this functionality exist in 2.x or was it removed (used to exist in 1.x)?

          People

          • Assignee:
            Jakub Podlesak
            Reporter:
            cowwoc
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 6 hours
              6h