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 javax.json.Json;
|
---|
11 |
|
---|
12 | import org.junit.jupiter.api.Test;
|
---|
13 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
14 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
15 |
|
---|
16 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Integration tests of {@link PlatformHook} class.
|
---|
20 | */
|
---|
21 | class PlatformHookTestIT {
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Setup rule
|
---|
25 | */
|
---|
26 | @RegisterExtension
|
---|
27 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
28 | public JOSMTestRules test = new JOSMTestRules();
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Test that we always support the latest Ubuntu version.
|
---|
32 | * @throws Exception in case of error
|
---|
33 | */
|
---|
34 | @Test
|
---|
35 | void testLatestUbuntuVersion() throws Exception {
|
---|
36 | String latestUbuntuVersion = Json.createReader(new StringReader(HttpClient.create(
|
---|
37 | new URL("https://api.launchpad.net/devel/ubuntu/series")).connect().fetchContent()))
|
---|
38 | .readObject().getJsonArray("entries").getJsonObject(0).getString("name");
|
---|
39 | assertEquals(HttpURLConnection.HTTP_OK, HttpClient.create(
|
---|
40 | new URL("https://josm.openstreetmap.de/apt/dists/" + latestUbuntuVersion + '/')).connect().getResponseCode(),
|
---|
41 | latestUbuntuVersion);
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.