Skip to content

Commit 6b8a553

Browse files
committed
[bugfix] Fix an issue with dependencies
1 parent c4d8189 commit 6b8a553

File tree

2 files changed

+60
-45
lines changed

2 files changed

+60
-45
lines changed

exist-start/pom.xml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,8 @@
7171

7272
<dependencies>
7373
<dependency>
74-
<groupId>junit</groupId>
75-
<artifactId>junit</artifactId>
76-
<scope>test</scope>
77-
</dependency>
78-
<dependency>
79-
<groupId>org.hamcrest</groupId>
80-
<artifactId>hamcrest</artifactId>
74+
<groupId>org.junit.jupiter</groupId>
75+
<artifactId>junit-jupiter-api</artifactId>
8176
<scope>test</scope>
8277
</dependency>
8378
</dependencies>
@@ -117,6 +112,7 @@
117112
<includes>
118113
<include>pom.xml</include>
119114
<include>src/main/java/org/exist/start/CompatibleJavaVersionCheck.java</include>
115+
<include>src/test/java/org/exist/start/CompatibleJavaVersionCheckTest.java</include>
120116
</includes>
121117
</licenseSet>
122118

@@ -130,6 +126,7 @@
130126
<exclude>Mortbay-APACHE-2-license.template.txt</exclude>
131127
<exclude>src/main/java/org/exist/start/Classpath.java</exclude>
132128
<exclude>src/main/java/org/exist/start/CompatibleJavaVersionCheck.java</exclude>
129+
<exclude>src/test/java/org/exist/start/CompatibleJavaVersionCheckTest.java</exclude>
133130
<exclude>src/main/java/org/exist/start/Main.java</exclude>
134131
<exclude>src/main/java/org/exist/start/Version.java</exclude>
135132
</excludes>
@@ -179,24 +176,6 @@ The original license statement is also included below.]]></preamble>
179176

180177
</configuration>
181178
</plugin>
182-
<plugin>
183-
<groupId>org.apache.maven.plugins</groupId>
184-
<artifactId>maven-dependency-plugin</artifactId>
185-
<executions>
186-
<execution>
187-
<id>analyze</id>
188-
<goals>
189-
<goal>analyze-only</goal>
190-
</goals>
191-
<configuration>
192-
<failOnWarning>true</failOnWarning>
193-
<ignoredUnusedDeclaredDependencies>
194-
<ignoredUnusedDeclaredDependency>org.hamcrest:hamcrest:jar</ignoredUnusedDeclaredDependency>
195-
</ignoredUnusedDeclaredDependencies>
196-
</configuration>
197-
</execution>
198-
</executions>
199-
</plugin>
200179
</plugins>
201180
</build>
202181

exist-start/src/test/java/org/exist/start/CompatibleJavaVersionCheckTest.java

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -21,11 +45,11 @@
2145
*/
2246
package org.exist.start;
2347

24-
import org.junit.Test;
48+
import org.junit.jupiter.api.Test;
2549

2650
import java.util.Optional;
2751

28-
import static org.junit.Assert.*;
52+
import static org.junit.jupiter.api.Assertions.*;
2953

3054
public class CompatibleJavaVersionCheckTest {
3155

@@ -172,34 +196,46 @@ public void checkJava11() throws StartException {
172196
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("11.0.11"));
173197
}
174198

175-
@Test(expected = StartException.class)
176-
public void checkJava12() throws StartException {
177-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("12.0.1"));
199+
@Test
200+
public void checkJava12() {
201+
assertThrows(StartException.class, () ->
202+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("12.0.1"))
203+
);
178204
}
179205

180-
@Test(expected = StartException.class)
181-
public void checkJava12_BellSoft() throws StartException {
182-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("12.0.2-BellSoft"));
206+
@Test
207+
public void checkJava12_BellSoft() {
208+
assertThrows(StartException.class, () ->
209+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("12.0.2-BellSoft"))
210+
);
183211
}
184212

185-
@Test(expected = StartException.class)
186-
public void checkJava13() throws StartException {
187-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("13.0.2"));
213+
@Test
214+
public void checkJava13() {
215+
assertThrows(StartException.class, () ->
216+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("13.0.2"))
217+
);
188218
}
189219

190-
@Test(expected = StartException.class)
191-
public void checkJava14() throws StartException {
192-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("14.0.2"));
220+
@Test
221+
public void checkJava14() {
222+
assertThrows(StartException.class, () ->
223+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("14.0.2"))
224+
);
193225
}
194226

195-
@Test(expected = StartException.class)
196-
public void checkJava15_0_0() throws StartException {
197-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("15.0.0"));
227+
@Test
228+
public void checkJava15_0_0() {
229+
assertThrows(StartException.class, () ->
230+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("15.0.0"))
231+
);
198232
}
199233

200-
@Test(expected = StartException.class)
201-
public void checkJava15_0_1() throws StartException {
202-
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("15.0.1"));
234+
@Test
235+
public void checkJava15_0_1() {
236+
assertThrows(StartException.class, () ->
237+
CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("15.0.1"))
238+
);
203239
}
204240

205241
@Test

0 commit comments

Comments
 (0)