Skip to content

Commit

Permalink
apacheGH-2771: Add mockito to as a javaagent in surefire
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Oct 14, 2024
1 parent 204fac3 commit 461f5f1
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jena-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,26 @@
<artifactId>maven-resources-plugin</artifactId>
</plugin>

<!-- Contract tests use mockito -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-javaagent:${org.mockito:mockito-core:jar}</argLine>
<includes>
<include>org/apache/jena/test/TestPackage_core.java</include>
<include>**/*_CS.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<!-- Set resolved artifact properties -->
<executions>
<execution><goals><goal>properties</goal></goals></execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
26 changes: 26 additions & 0 deletions jena-extras/jena-querybuilder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<properties>
<automatic.module.name>org.apache.jena.querybuilder</automatic.module.name>
<argLine></argLine>
</properties>

<dependencies>
Expand Down Expand Up @@ -88,6 +89,31 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<!--
sets a property for the artifact file
groupId:artifactId:type:[classifier]
Used with mockito.
Also - define a default value for argLine in <properties>
-->
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
10 changes: 10 additions & 0 deletions jena-fuseki2/jena-fuseki-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<properties>
<build.time.xsd>${maven.build.timestamp}</build.time.xsd>
<automatic.module.name>org.apache.jena.fuseki.core</automatic.module.name>
<argLine></argLine>
</properties>

<dependencies>
Expand Down Expand Up @@ -165,11 +166,20 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
<includes>
<include>**/TS_*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<!-- Set groupId:artifactId:type:[classifier] -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution><goals><goal>properties</goal></goals></execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
26 changes: 26 additions & 0 deletions jena-permissions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,33 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<!--
sets a property for the artifact file
groupId:artifactId:type:[classifier]
Used with mockito.
Also - define a default value for argLine in <properties>
-->
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
Expand Down

0 comments on commit 461f5f1

Please sign in to comment.