Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4757

Improve test coverage and add integration tests to the contentdetection module

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Commons
    • None

    Description

      The new SLING-4694 contentdetection module has reasonable test coverage but there are some gaps, and it's also missing some integration tests to verify that the services provided by the bundle are correctly made available in an OSGI environment.

      I'll take this opportunity to ask our GSoC student petr.shypila to expand these tests, as that's a good example of what we're trying to do with his tests improvement project.

      So petr.shypila here's your "mission"

      Buliding bundles/commons/contentdetection with with -Pjacoco-report and looking at target/site/jacoco/index.html shows that a few things are not tested. The first step is to add the missing unit tests to improve that, maybe provide a first patch with just that.

      Then, we'd like to add integration tests that start this bundle in an OSGi environment and verify that the ContentAwareMimeTypeService and FileNameExtractor services are available and work. No need to duplicate the unit tests, just verify that the services are here and work in a simple case.

      The best way to do this is probably with Pax Exam, the ResourceBundleProviderIT. is a good example of that and there are other examples in our codebase if you search for *IT.java files that contain "pax.exam".

      As usual, try to minimize changes to the pom (except for what's directly related to testing) and to non-test code.

      Feel free to ask if you have any questions of course, either here for minor ones or on the dev list for larger discussions.

      [1] https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/it/ResourceBundleProviderIT.java

      Attachments

        1. week2-part2-integration-tests.patch
          10 kB
          Petr Shypila
        2. week2-part1-unit-tests.patch
          6 kB
          Petr Shypila
        3. FileNameExtractorImpl_Injection_failed__ClassNotFoundException.patch
          6 kB
          Petr Shypila
        4. content-tampering-test.patch
          2 kB
          Satya Deep Maheshwari

        Issue Links

          Activity

            People

              petr.shypila Petr Shypila
              bdelacretaz Bertrand Delacretaz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: