|
1 | 1 | /* |
| 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 | + * |
2 | 26 | * eXist-db Open Source Native XML Database |
3 | 27 | * Copyright (C) 2001 The eXist-db Authors |
4 | 28 | * |
|
21 | 45 | */ |
22 | 46 | package org.exist.start; |
23 | 47 |
|
24 | | -import org.junit.Test; |
| 48 | +import org.junit.jupiter.api.Test; |
25 | 49 |
|
26 | 50 | import java.util.Optional; |
27 | 51 |
|
28 | | -import static org.junit.Assert.*; |
| 52 | +import static org.junit.jupiter.api.Assertions.*; |
29 | 53 |
|
30 | 54 | public class CompatibleJavaVersionCheckTest { |
31 | 55 |
|
@@ -172,34 +196,46 @@ public void checkJava11() throws StartException { |
172 | 196 | CompatibleJavaVersionCheck.checkForCompatibleJavaVersion(Optional.of("11.0.11")); |
173 | 197 | } |
174 | 198 |
|
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 | + ); |
178 | 204 | } |
179 | 205 |
|
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 | + ); |
183 | 211 | } |
184 | 212 |
|
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 | + ); |
188 | 218 | } |
189 | 219 |
|
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 | + ); |
193 | 225 | } |
194 | 226 |
|
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 | + ); |
198 | 232 | } |
199 | 233 |
|
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 | + ); |
203 | 239 | } |
204 | 240 |
|
205 | 241 | @Test |
|
0 commit comments