Skip to content

Commit 98f7ac4

Browse files
committed
Fix concurrency issues
Add more tests
1 parent 7d5926b commit 98f7ac4

17 files changed

+797
-206
lines changed

.github/workflows/maven.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,17 @@ jobs:
66
build:
77

88
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
java-version: [24, 21, 17, 11]
913

1014
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Java 21
13-
uses: actions/setup-java@v4
15+
- uses: actions/checkout@v5
16+
- name: Set up Java ${{ matrix.java-version }}
17+
uses: actions/setup-java@v5
1418
with:
1519
distribution: 'temurin'
16-
java-version: 21
17-
- name: Build with Java 21
18-
run: ./mvnw -B clean test --file pom.xml
19-
- name: Set up Java 17
20-
uses: actions/setup-java@v4
21-
with:
22-
distribution: 'temurin'
23-
java-version: 17
24-
- name: Build with Java 17
25-
run: ./mvnw -B clean test --file pom.xml
26-
- name: Set up Java 11
27-
uses: actions/setup-java@v4
28-
with:
29-
distribution: 'temurin'
30-
java-version: 11
31-
- name: Build with Java 11
32-
run: ./mvnw -B clean test --file pom.xml
20+
java-version: ${{ matrix.java-version }}
21+
- name: Build and test
22+
run: ./mvnw -B -T 1C clean test --file pom.xml

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ release.properties
1010
dependency-reduced-pom.xml
1111
buildNumber.properties
1212
.mvn/timing.properties
13-
13+
.vscode
1414
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
1515
!/.mvn/wrapper/maven-wrapper.jar

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@
2020
<nature>org.eclipse.jdt.core.javanature</nature>
2121
<nature>org.eclipse.m2e.core.maven2Nature</nature>
2222
</natures>
23+
<filteredResources>
24+
<filter>
25+
<id>1757135049258</id>
26+
<name></name>
27+
<type>30</type>
28+
<matcher>
29+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
30+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31+
</matcher>
32+
</filter>
33+
</filteredResources>
2334
</projectDescription>

Taskfile.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#
2+
# Copyright the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
version: '3'
18+
19+
tasks:
20+
default:
21+
cmds:
22+
- task --list-all
23+
24+
format:
25+
desc: "Format source using Spring Java Format"
26+
cmds:
27+
- cmd: cmd /c "mvnw.cmd spring-javaformat:apply"
28+
platforms: [windows]
29+
- cmd: ./mvnw spring-javaformat:apply
30+
platforms: [linux, darwin]
31+
32+
test:
33+
desc: "Run unit tests"
34+
cmds:
35+
- cmd: cmd /c "mvnw.cmd test"
36+
platforms: [windows]
37+
- cmd: ./mvnw test
38+
platforms: [linux, darwin]
39+
40+
stress:
41+
desc: "Run stress tests via Maven profile 'stress'"
42+
cmds:
43+
- cmd: cmd /c "mvnw.cmd -Pstress test"
44+
platforms: [windows]
45+
- cmd: ./mvnw -Pstress test
46+
platforms: [linux, darwin]
47+
48+
verify:
49+
desc: "Run full verification including JaCoCo report"
50+
cmds:
51+
- cmd: cmd /c "mvnw.cmd verify"
52+
platforms: [windows]
53+
- cmd: ./mvnw verify
54+
platforms: [linux, darwin]
55+
56+
jacoco-report:
57+
desc: "Generate JaCoCo HTML report without running tests"
58+
cmds:
59+
- cmd: cmd /c "mvnw.cmd org.jacoco:jacoco-maven-plugin:0.8.13:report"
60+
platforms: [windows]
61+
- cmd: ./mvnw org.jacoco:jacoco-maven-plugin:0.8.13:report
62+
platforms: [linux, darwin]
63+
64+
show-coverage:
65+
desc: "Generate JaCoCo report (verify) and open the HTML report if possible"
66+
cmds:
67+
- cmd: cmd /c "mvnw.cmd verify"
68+
platforms: [windows]
69+
- cmd: ./mvnw verify
70+
platforms: [linux, darwin]
71+
- cmd: cmd /c "start target/site/jacoco/index.html"
72+
platforms: [windows]
73+
- cmd: xdg-open target/site/jacoco/index.html
74+
platforms: [linux]
75+
- cmd: open target/site/jacoco/index.html
76+
platforms: [darwin]
77+
- cmd: echo "Open the coverage report at target/site/jacoco/index.html"
78+
79+
all:
80+
desc: "Format, run license format, run verify, and open coverage report"
81+
deps: [format, license-format, verify, show-coverage]
82+
83+
license-format:
84+
desc: "Apply license headers to files"
85+
cmds:
86+
- cmd: cmd /c "mvnw.cmd com.mycila:license-maven-plugin:4.6:format"
87+
platforms: [windows]
88+
- cmd: ./mvnw com.mycila:license-maven-plugin:4.6:format
89+
platforms: [linux, darwin]

pom.xml

Lines changed: 92 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,66 @@
6060
</dependency>
6161

6262
<!-- TEST dependencies -->
63+
<dependency>
64+
<groupId>org.junit.jupiter</groupId>
65+
<artifactId>junit-jupiter-api</artifactId>
66+
<version>6.0.0-RC2</version>
67+
<scope>test</scope>
68+
</dependency>
6369
<dependency>
6470
<groupId>org.junit.jupiter</groupId>
6571
<artifactId>junit-jupiter-engine</artifactId>
66-
<version>5.13.1</version>
72+
<version>6.0.0-RC2</version>
6773
<scope>test</scope>
6874
</dependency>
6975

7076
<dependency>
7177
<groupId>org.junit.platform</groupId>
7278
<artifactId>junit-platform-launcher</artifactId>
73-
<version>1.11.4</version>
79+
<version>6.0.0-RC2</version>
7480
<scope>test</scope>
7581
</dependency>
7682

7783
</dependencies>
7884

7985
<build>
8086
<plugins>
87+
<plugin>
88+
<groupId>org.jacoco</groupId>
89+
<artifactId>jacoco-maven-plugin</artifactId>
90+
<version>0.8.13</version>
91+
<executions>
92+
<execution>
93+
<id>prepare-agent</id>
94+
<goals>
95+
<goal>prepare-agent</goal>
96+
</goals>
97+
<phase>initialize</phase>
98+
</execution>
99+
<execution>
100+
<id>report</id>
101+
<goals>
102+
<goal>report</goal>
103+
</goals>
104+
<phase>verify</phase>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
109+
<plugin>
110+
<groupId>io.spring.javaformat</groupId>
111+
<artifactId>spring-javaformat-maven-plugin</artifactId>
112+
<version>0.0.47</version>
113+
<executions>
114+
<execution>
115+
<goals>
116+
<goal>validate</goal>
117+
</goals>
118+
<phase>validate</phase>
119+
</execution>
120+
</executions>
121+
</plugin>
122+
81123
<plugin>
82124
<groupId>org.apache.maven.plugins</groupId>
83125
<artifactId>maven-compiler-plugin</artifactId>
@@ -107,7 +149,16 @@
107149
<plugin>
108150
<groupId>org.apache.maven.plugins</groupId>
109151
<artifactId>maven-surefire-plugin</artifactId>
110-
<version>3.5.2</version>
152+
<version>3.2.5</version>
153+
<configuration>
154+
<includes>
155+
<include>**/*Test.java</include>
156+
<include>**/*Tests.java</include>
157+
</includes>
158+
<excludes>
159+
<exclude>**/*StressTest.java</exclude>
160+
</excludes>
161+
</configuration>
111162
</plugin>
112163

113164
<plugin>
@@ -137,28 +188,32 @@
137188
<artifactId>license-maven-plugin</artifactId>
138189
<version>4.6</version>
139190
<configuration>
140-
<header>${basedir}/src/main/config/header.txt</header>
191+
<licenseSets>
192+
<licenseSet>
193+
<header>${basedir}/src/main/config/header.txt</header>
194+
<excludes>
195+
<exclude>**/*.xml</exclude>
196+
<exclude>**/*.md</exclude>
197+
<exclude>**/*.py</exclude>
198+
<exclude>LICENSE</exclude>
199+
<exclude>.travis.yml</exclude>
200+
<exclude>**/.gitignore</exclude>
201+
<exclude>.factorypath</exclude>
202+
<exclude>.mvn/**/*</exclude>
203+
<exclude>mvnw.cmd</exclude>
204+
<exclude>mvnw</exclude>
205+
<exclude>.apt_generated/**</exclude>
206+
<exclude>.editorconfig</exclude>
207+
<exclude>.github/**</exclude>
208+
</excludes>
209+
</licenseSet>
210+
</licenseSets>
141211
<properties>
142212

143213
<year>${project.inceptionYear}</year>
144214
<currentYear>2022</currentYear>
145215

146216
</properties>
147-
<excludes>
148-
<exclude>**/*.xml</exclude>
149-
<exclude>**/*.md</exclude>
150-
<exclude>**/*.py</exclude>
151-
<exclude>LICENSE</exclude>
152-
<exclude>.travis.yml</exclude>
153-
<exclude>**/.gitignore</exclude>
154-
<exclude>.factorypath</exclude>
155-
<exclude>.mvn/**/*</exclude>
156-
<exclude>mvnw.cmd</exclude>
157-
<exclude>mvnw</exclude>
158-
<exclude>.apt_generated/**</exclude>
159-
<exclude>.editorconfig</exclude>
160-
<exclude>.github/**</exclude>
161-
</excludes>
162217
<strictCheck>true</strictCheck>
163218
</configuration>
164219
<executions>
@@ -173,4 +228,22 @@
173228
</plugin>
174229
</plugins>
175230
</build>
231+
232+
<profiles>
233+
<profile>
234+
<id>stress</id>
235+
<build>
236+
<plugins>
237+
<plugin>
238+
<groupId>org.apache.maven.plugins</groupId>
239+
<artifactId>maven-surefire-plugin</artifactId>
240+
<configuration>
241+
<!-- Do not exclude stress tests when profile 'stress' is active -->
242+
<excludes/>
243+
</configuration>
244+
</plugin>
245+
</plugins>
246+
</build>
247+
</profile>
248+
</profiles>
176249
</project>

0 commit comments

Comments
 (0)