garydgregory commented on code in PR #114:
URL: 
https://github.com/apache/commons-secure-xml/pull/114#discussion_r4237605769


##########
pom.xml:
##########
@@ -391,6 +413,110 @@ limitations under the License.
           </execution>
         </executions>
       </plugin>
+      <!--
+        Writes a fragment manifest into the test output directory,
+        so OsgiIT can install it as an exploded bundle attached to the library.
+        The imports are optional:
+        the test harness (JUnit, Mockito, JAXB) is boot-delegated to the class 
path by OsgiIT.
+      -->
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>test-bundle-manifest</id>
+            <phase>process-test-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+            <configuration>
+              
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+              
<manifestLocation>${project.build.testOutputDirectory}/META-INF</manifestLocation>
+              <instructions>
+                
<Bundle-SymbolicName>${commons.osgi.symbolicName}.tests</Bundle-SymbolicName>
+                <Fragment-Host>${commons.osgi.symbolicName}</Fragment-Host>
+                <Export-Package>!*</Export-Package>
+                <Private-Package>org.apache.commons.xml.*</Private-Package>
+                <Import-Package>*;resolution:=optional</Import-Package>
+                <!-- The java11 test sources would otherwise raise the osgi.ee 
requirement to that of the build JDK. -->
+                <_noee>true</_noee>
+                <!--
+                  bnd looks the host up on the class path to drop its packages 
from Import-Package, but the host is this module's own jar, not built yet.
+                  Harmless: the tests are in the host's packages, so the 
fragment imports none of them anyway.
+                -->
+                <_fixupmessages>"Host ${commons.osgi.symbolicName}= for this 
fragment/require bundle cannot be found on the 
classpath";is:=ignore</_fixupmessages>
+              </instructions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!--
+        OsgiIT runs the unit tests inside an OSGi framework against the 
packaged bundle, once per framework.
+        Each framework jar embeds its own copy of the OSGi API,
+        so each execution keeps exactly one of them on the class path.
+        Saxon is dropped as in test-stockjdk,
+        so provider lookups reach the JDK's built-in implementations, as they 
do for a bundle.
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <!-- The same permissive JDK defaults as the surefire executions. -->
+        <configuration>
+          <systemPropertyVariables>
+            <javax.xml.accessExternalDTD>all</javax.xml.accessExternalDTD>
+            
<javax.xml.accessExternalSchema>all</javax.xml.accessExternalSchema>
+            
<javax.xml.accessExternalStylesheet>all</javax.xml.accessExternalStylesheet>
+          </systemPropertyVariables>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test-osgi-felix</id>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+            <configuration>
+              <includes>
+                <include>**/OsgiIT.java</include>
+              </includes>
+              
<reportsDirectory>${project.build.directory}/failsafe-reports/felix</reportsDirectory>
+              
<summaryFile>${project.build.directory}/failsafe-reports/felix/failsafe-summary.xml</summaryFile>
+              <classpathDependencyExcludes>

Review Comment:
   I'm not sure what that level kind of delegation looks like. Since the PR is 
already complex, maybe this can be proposed in a follow up PR. @ppkarwasz , 
WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to