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

Generate SCR metadata required for mock-based unit tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Parent 29
    • Parent 30
    • General
    • None

    Description

      when unit tests are based on osgi-mock the SCR metadata generated for the OSGi components of the project itself needs to be present in the generated classpath before the unit test run.

      the following maven-bundle-plugin configuration is required for this:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
          <!-- Export SCR metadata to classpath to have them available in unit tests -->
          <exportScr>true</exportScr>
      </configuration>
      <executions>
          <!-- Configure extra execution of 'manifest' in process-classes phase to make sure SCR metadata is generated before unit test runs -->
          <execution>
              <id>scr-metadata</id>
              <goals>
                  <goal>manifest</goal>
              </goals>
              <configuration>
                  <supportIncrementalBuild>true</supportIncrementalBuild>
              </configuration>
          </execution>
      </executions>
      

      we should add it by default to the global parent pom.

      Attachments

        Issue Links

          Activity

            People

              sseifert Stefan Seifert
              sseifert Stefan Seifert
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: