Skip to content

Commit 9aeed9c

Browse files
authored
#345: Replace ExitGuard in integration tests (#438)
1 parent ab8d78b commit 9aeed9c

File tree

17 files changed

+855
-656
lines changed

17 files changed

+855
-656
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
version: 2
2-
updates:
3-
# - package-ecosystem: "maven"
4-
# directory: "/"
5-
# schedule:
6-
# interval: "monthly"
72

8-
- package-ecosystem: "github-actions"
9-
directory: "/"
3+
multi-ecosystem-groups:
4+
dependencies:
105
schedule:
116
interval: "monthly"
7+
8+
updates:
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
patterns: ["*"]
12+
multi-ecosystem-group: "dependencies"
13+
14+
- package-ecosystem: "maven"
15+
directory: "/"
16+
patterns: ["*"]
17+
multi-ecosystem-group: "dependencies"

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
include:
1919
- os: ubuntu-latest
2020
java: 21
21+
- os: ubuntu-latest
22+
java: 25
2123

2224
concurrency:
2325
group: ${{ github.workflow }}-${{ github.ref }}-os-${{ matrix.os }}-java-${{ matrix.java }}
@@ -43,6 +45,9 @@ jobs:
4345
distribution: "temurin"
4446
java-version: ${{ matrix.java }}
4547
cache: "maven"
48+
server-id: ossindex
49+
server-username: OSSINDEX_USERNAME
50+
server-password: OSSINDEX_TOKEN
4651

4752
- name: Cache SonarQube packages
4853
if: ${{ env.DEFAULT_OS == matrix.os && env.DEFAULT_JAVA == matrix.java }}
@@ -56,6 +61,9 @@ jobs:
5661
run: |
5762
mvn --batch-mode -T 1C clean org.jacoco:jacoco-maven-plugin:prepare-agent install \
5863
-Djava.version=${{ matrix.java }}
64+
env:
65+
OSSINDEX_USERNAME: ${{ secrets.OSSINDEX_USERNAME }}
66+
OSSINDEX_TOKEN: ${{ secrets.OSSINDEX_TOKEN }}
5967

6068
- name: Sonar analysis
6169
if: ${{ env.DEFAULT_OS == matrix.os && env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
"connectionId": "itsallcode",
2525
"projectKey": "org.itsallcode.openfasttrace:openfasttrace-root"
2626
},
27+
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable",
2728
}

core/src/main/java/org/itsallcode/openfasttrace/core/cli/CliException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ public CliException(final String message)
3030
{
3131
super(message);
3232
}
33-
}
33+
}

core/src/main/java/org/itsallcode/openfasttrace/core/cli/CliStarter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void main(final String[] args)
3838

3939
/**
4040
* Auxiliary entry point to the command line application that allows
41-
* injection of a
41+
* injection of a {@link DirectoryService}.
4242
*
4343
* @param args
4444
* command line arguments.
@@ -63,6 +63,7 @@ public static void main(final String[] args, final DirectoryService directorySer
6363
}
6464
}
6565

66+
@SuppressWarnings("java:S1166") // Exceptions are reported to the user
6667
private static CliArguments parseCommandLineArguments(final String[] args,
6768
final DirectoryService directoryService)
6869
{
@@ -126,6 +127,7 @@ public void run()
126127
}
127128

128129
// [impl->dsn~cli.tracing.exit-status~1]
130+
@SuppressWarnings("java:S1147") // Calling System.exit() intentionally
129131
private static void exit(final ExitStatus exitStatus)
130132
{
131133
System.exit(exitStatus.getCode());

core/src/test/java/org/itsallcode/openfasttrace/core/cli/TestCliStarter.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

doc/developer_guide.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,20 @@ By default, OFT is built with Java 17.
121121

122122
To build and test with a later version, add argument `-Djava.version=17` to the Maven command.
123123

124-
125124
#### Speedup Build
126125

127126
By default, Maven builds the OFT modules sequentially.
128127

129128
To speed up the build and build modules in parallel, add argument `-T 1C` to the Maven command.
130129

130+
#### Run Single Integration Test
131+
132+
Specify test class via system property `it.test` and module via command line option `-projects`:
133+
134+
```sh
135+
mvn -Dit.test=CliStarterIT failsafe:integration-test -projects product
136+
```
137+
131138
### Run Requirements Tracing
132139

133140
```sh

parent/pom.xml

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<properties>
1313
<revision>4.2.1</revision>
1414
<java.version>17</java.version>
15-
<junit.version>5.12.2</junit.version>
16-
<maven.surefire.version>3.5.3</maven.surefire.version>
15+
<junit.version>6.0.1</junit.version>
16+
<maven.surefire.version>3.5.4</maven.surefire.version>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1919
<reproducible.build.timestamp>${git.commit.time}</reproducible.build.timestamp>
@@ -209,7 +209,7 @@
209209
<dependency>
210210
<groupId>org.mockito</groupId>
211211
<artifactId>mockito-junit-jupiter</artifactId>
212-
<version>5.18.0</version>
212+
<version>5.20.0</version>
213213
<scope>test</scope>
214214
</dependency>
215215
<dependency>
@@ -227,7 +227,7 @@
227227
<dependency>
228228
<groupId>nl.jqno.equalsverifier</groupId>
229229
<artifactId>equalsverifier</artifactId>
230-
<version>4.0</version>
230+
<version>4.2.2</version>
231231
<scope>test</scope>
232232
</dependency>
233233
<dependency>
@@ -236,34 +236,20 @@
236236
<version>1.4.8</version>
237237
<scope>test</scope>
238238
</dependency>
239+
<dependency>
240+
<groupId>com.exasol</groupId>
241+
<artifactId>maven-project-version-getter</artifactId>
242+
<version>1.2.2</version>
243+
<scope>test</scope>
244+
</dependency>
245+
<dependency>
246+
<groupId>org.itsallcode</groupId>
247+
<artifactId>simple-process</artifactId>
248+
<version>0.3.1</version>
249+
<scope>test</scope>
250+
</dependency>
239251
</dependencies>
240252
</dependencyManagement>
241-
<profiles>
242-
<profile>
243-
<id>java21</id>
244-
<activation>
245-
<jdk>21</jdk>
246-
<property>
247-
<!-- Prevent activating this profile when running without specifying
248-
-Djava.version.
249-
Tests with JDK 11 fail because it expecteds a class name as value for for
250-
system property "java.security.manager" -->
251-
<name>java.version</name>
252-
<value>21</value>
253-
</property>
254-
</activation>
255-
<properties>
256-
<!-- java.security.manager is required to fix failing tests in TestCliStarter:
257-
UnsupportedOperation The Security Manager is deprecated and will be removed in a future release -->
258-
<!-- EnableDynamicAgentLoading suppresses a warning caused by Mockito dynamically
259-
loading a Java agent:
260-
WARNING: A Java agent has been loaded dynamically
261-
(~/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.11/byte-buddy-agent-1.14.11.jar)
262-
Dynamic loading of agents will be disallowed by default in a future release -->
263-
<test.args>-Djava.security.manager=allow -XX:+EnableDynamicAgentLoading</test.args>
264-
</properties>
265-
</profile>
266-
</profiles>
267253
<build>
268254
<plugins>
269255
<plugin>
@@ -309,7 +295,6 @@
309295
<plugin>
310296
<groupId>org.apache.maven.plugins</groupId>
311297
<artifactId>maven-compiler-plugin</artifactId>
312-
<version>3.14.0</version>
313298
<configuration>
314299
<source>${java.version}</source>
315300
<target>${java.version}</target>
@@ -391,6 +376,19 @@
391376
</execution>
392377
</executions>
393378
</plugin>
379+
<plugin>
380+
<groupId>org.apache.maven.plugins</groupId>
381+
<artifactId>maven-dependency-plugin</artifactId>
382+
<version>3.9.0</version>
383+
<executions>
384+
<execution>
385+
<goals>
386+
<!-- Define ${org.mockito:mockito-core:jar} property required for Mockito agent loading -->
387+
<goal>properties</goal>
388+
</goals>
389+
</execution>
390+
</executions>
391+
</plugin>
394392
<plugin>
395393
<groupId>org.apache.maven.plugins</groupId>
396394
<artifactId>maven-surefire-plugin</artifactId>
@@ -402,7 +400,7 @@
402400
</systemPropertyVariables>
403401
<useModulePath>true</useModulePath>
404402
<argLine>
405-
<!-- Required for Java >= 18 --> ${test.args} </argLine>
403+
<!-- Required for Java >= 18 --> ${test.args} -javaagent:${org.mockito:mockito-core:jar}</argLine>
406404
</configuration>
407405
</plugin>
408406
<plugin>
@@ -416,7 +414,7 @@
416414
<test.coverage>true</test.coverage>
417415
</systemPropertyVariables>
418416
<useModulePath>true</useModulePath>
419-
<argLine><!-- Required for Java >= 18 --> ${test.args} </argLine>
417+
<argLine><!-- Required for Java >= 18 --> ${test.args} -javaagent:${org.mockito:mockito-core:jar}</argLine>
420418
</configuration>
421419
<executions>
422420
<execution>
@@ -431,15 +429,15 @@
431429
<plugin>
432430
<groupId>org.codehaus.mojo</groupId>
433431
<artifactId>flatten-maven-plugin</artifactId>
434-
<version>1.7.0</version>
432+
<version>1.7.3</version>
435433
<configuration>
436434
<flattenMode>oss</flattenMode> <!-- Use 'oss' mode for Maven Central -->
437435
</configuration>
438436
</plugin>
439437
<plugin>
440438
<groupId>org.apache.maven.plugins</groupId>
441439
<artifactId>maven-enforcer-plugin</artifactId>
442-
<version>3.5.0</version>
440+
<version>3.6.2</version>
443441
<executions>
444442
<execution>
445443
<id>enforce-maven</id>
@@ -485,6 +483,9 @@
485483
<groupId>org.sonatype.ossindex.maven</groupId>
486484
<artifactId>ossindex-maven-plugin</artifactId>
487485
<version>3.2.0</version>
486+
<configuration>
487+
<authId>ossindex</authId>
488+
</configuration>
488489
<executions>
489490
<execution>
490491
<id>audit</id>
@@ -498,7 +499,7 @@
498499
<plugin>
499500
<groupId>org.apache.maven.plugins</groupId>
500501
<artifactId>maven-artifact-plugin</artifactId>
501-
<version>3.6.0</version>
502+
<version>3.6.1</version>
502503
<executions>
503504
<execution>
504505
<id>verify-reproducible-build</id>
@@ -515,7 +516,7 @@
515516
<plugin>
516517
<groupId>org.codehaus.mojo</groupId>
517518
<artifactId>versions-maven-plugin</artifactId>
518-
<version>2.18.0</version>
519+
<version>2.19.1</version>
519520
</plugin>
520521
<plugin>
521522
<!-- Deployment of this module not required -->
@@ -532,7 +533,12 @@
532533
<plugin>
533534
<groupId>org.apache.maven.plugins</groupId>
534535
<artifactId>maven-clean-plugin</artifactId>
535-
<version>3.4.1</version>
536+
<version>3.5.0</version>
537+
</plugin>
538+
<plugin>
539+
<groupId>org.apache.maven.plugins</groupId>
540+
<artifactId>maven-compiler-plugin</artifactId>
541+
<version>3.14.1</version>
536542
</plugin>
537543
<plugin>
538544
<groupId>org.apache.maven.plugins</groupId>
@@ -547,12 +553,12 @@
547553
<plugin>
548554
<groupId>org.apache.maven.plugins</groupId>
549555
<artifactId>maven-site-plugin</artifactId>
550-
<version>4.0.0-M16</version>
556+
<version>3.21.0</version>
551557
</plugin>
552558
<plugin>
553559
<groupId>org.apache.maven.plugins</groupId>
554560
<artifactId>maven-shade-plugin</artifactId>
555-
<version>3.6.0</version>
561+
<version>3.6.1</version>
556562
</plugin>
557563
<plugin>
558564
<groupId>org.apache.maven.plugins</groupId>
@@ -567,7 +573,7 @@
567573
<plugin>
568574
<groupId>org.apache.maven.plugins</groupId>
569575
<artifactId>maven-javadoc-plugin</artifactId>
570-
<version>3.11.2</version>
576+
<version>3.12.0</version>
571577
</plugin>
572578
<plugin>
573579
<groupId>org.codehaus.mojo</groupId>
@@ -638,7 +644,7 @@
638644
<dependency>
639645
<groupId>net.sourceforge.plantuml</groupId>
640646
<artifactId>plantuml</artifactId>
641-
<version>1.2025.0</version>
647+
<version>1.2025.10</version>
642648
</dependency>
643649
</dependencies>
644650
</plugin>

0 commit comments

Comments
 (0)