Last change
on this file was 18853, checked in by taylor.smock, 7 months ago |
See #16567: Update to JUnit 5
This removes new JOSMTestRules() with no additional setup and most
JOSMFixture calls.
Removing the bare JOSMTestRules speeds up the test suite since there are two
fewer System.gc() calls per test.
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 |
|
---|
6 | import java.io.StringReader;
|
---|
7 | import java.net.HttpURLConnection;
|
---|
8 | import java.net.URL;
|
---|
9 |
|
---|
10 | import org.junit.jupiter.api.Test;
|
---|
11 |
|
---|
12 | import jakarta.json.Json;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Integration tests of {@link PlatformHook} class.
|
---|
16 | */
|
---|
17 | class PlatformHookTestIT {
|
---|
18 | /**
|
---|
19 | * Test that we always support the latest Ubuntu version.
|
---|
20 | * @throws Exception in case of error
|
---|
21 | */
|
---|
22 | @Test
|
---|
23 | void testLatestUbuntuVersion() throws Exception {
|
---|
24 | String latestUbuntuVersion = Json.createReader(new StringReader(HttpClient.create(
|
---|
25 | new URL("https://api.launchpad.net/devel/ubuntu/series")).connect().fetchContent()))
|
---|
26 | .readObject().getJsonArray("entries").getJsonObject(0).getString("name");
|
---|
27 | assertEquals(HttpURLConnection.HTTP_OK, HttpClient.create(
|
---|
28 | new URL("https://josm.openstreetmap.de/apt/dists/" + latestUbuntuVersion + '/')).connect().getResponseCode(),
|
---|
29 | latestUbuntuVersion);
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.