Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24493

Use Tomcat instead of old Jetty 6 for tests

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.2
    • Component/s: Tests
    • Tags:
    • Upgrade notes:
      Hide

      Various Jetty* test classes are renamed to ServletContainer*:

      • JettyFeature -> ServletContainerFeature
      • JettyTransactionalFeature -> ServletContainerTransactionalFeature
      • @Jetty(port = ...) -> @ServletContainer(port = ...)

      Configuring the servlet container to add servlets, filters or listeners is now done through extension points. The syntax is based on the standard web.xml, with an additional context attribute:

        <extension target="org.nuxeo.runtime.server" point="servlet">
          <servlet context="/">
            <servlet-name>My Servlet</servlet-name>
            <servlet-class>org.nuxeo.example.MyServlet</servlet-class>
            <url-pattern>/*</url-pattern>
            <init-param>
              <param-name>myparam</param-name>
              <param-value>myvalue</param-value>
            </init-param>
          </servlet>
        </extension>
      
        <extension target="org.nuxeo.runtime.server" point="filter">
          <filter context="/">
            <filter-name>My Filter</filter-name>
            <filter-class>org.nuxeo.example.MyFilter</filter-class>
            <filter-mapping>
              <url-pattern>/*</url-pattern>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
            </filter-mapping>
            <init-param>
              <param-name>myparam</param-name>
              <param-value>myvalue</param-value>
            </init-param>
          </filter>
        </extension>
      
        <extension target="org.nuxeo.runtime.server" point="listener">
          <listener context="/">
            <listener-class>org.nuxeo.example.MyListener</listener-class>
          </listener>
        </extension>
      
      Show
      Various Jetty* test classes are renamed to ServletContainer*: JettyFeature -> ServletContainerFeature JettyTransactionalFeature -> ServletContainerTransactionalFeature @Jetty(port = ...) -> @ServletContainer(port = ...) Configuring the servlet container to add servlets, filters or listeners is now done through extension points. The syntax is based on the standard web.xml, with an additional context attribute: <extension target= "org.nuxeo.runtime.server" point= "servlet" > <servlet context= "/" > <servlet-name> My Servlet </servlet-name> <servlet-class> org.nuxeo.example.MyServlet </servlet-class> <url-pattern> /* </url-pattern> <init-param> <param-name> myparam </param-name> <param-value> myvalue </param-value> </init-param> </servlet> </extension> <extension target= "org.nuxeo.runtime.server" point= "filter" > <filter context= "/" > <filter-name> My Filter </filter-name> <filter-class> org.nuxeo.example.MyFilter </filter-class> <filter-mapping> <url-pattern> /* </url-pattern> <dispatcher> REQUEST </dispatcher> <dispatcher> FORWARD </dispatcher> </filter-mapping> <init-param> <param-name> myparam </param-name> <param-value> myvalue </param-value> </init-param> </filter> </extension> <extension target= "org.nuxeo.runtime.server" point= "listener" > <listener context= "/" > <listener-class> org.nuxeo.example.MyListener </listener-class> </listener> </extension>
    • Sprint:
      nxFG 10.1.2, nxFG 10.2.1, nxFG 10.2.2, nxFG 10.2.3, nxFG 10.2.4, nxFG 10.2.5
    • Story Points:
      5

      Description

      For our embedded integration tests we currently use Jetty 6.1.26, which is EOL since November 2010 (http://www.eclipse.org/jetty/documentation/current/what-jetty-version.html) and does not support Servlet 3.1(NXP-24386).

      We should upgrade to a newer embedded server. We currently use Tomcat Embedded in CMIS and WebDAV tests so this could be a good switch, instead of upgrading to Jetty 9. In addition we run in a Tomcat so this would make some debugging more consistent.

      • rename all the various Jetty* features and classes to a more generic ServletContainer* naming
      • switch the underlying implementation to Tomcat (TomcatServerConfigurator)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 1 week
                  1w

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.