mirror of
https://github.com/apple/pkl.git
synced 2026-05-22 23:07:07 +02:00
Support building with JDK 21 (#234)
- Update google-java-format to a version compatible with JDK 21 and run "gw spotlessApply". - Fix wrong test assumption JavaCodeGenerator writes a properties file using java.util.Properties, which doesn't guarantee order of entries. - Fix most deprecation warnings - Add CI job for JDK 21
This commit is contained in:
@@ -7,7 +7,6 @@ import org.junit.jupiter.api.assertThrows
|
||||
import org.pkl.commons.test.FakeHttpResponse
|
||||
import java.io.IOException
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
|
||||
class HttpUtilsTest {
|
||||
@Test
|
||||
@@ -17,10 +16,10 @@ class HttpUtilsTest {
|
||||
assertThat(HttpUtils.isHttpUrl(URI("HtTpS://example.com"))).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URI("file://example.com"))).isFalse
|
||||
|
||||
assertThat(HttpUtils.isHttpUrl(URL("http://example.com"))).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URL("https://example.com"))).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URL("HtTpS://example.com"))).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URL("file://example.com"))).isFalse
|
||||
assertThat(HttpUtils.isHttpUrl(URI("http://example.com").toURL())).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URI("https://example.com").toURL())).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URI("HtTpS://example.com").toURL())).isTrue
|
||||
assertThat(HttpUtils.isHttpUrl(URI("file://example.com").toURL())).isFalse
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -415,20 +415,20 @@ class IoUtilsTest {
|
||||
@Test
|
||||
fun `readBytes(URL) does not support HTTP URLs`() {
|
||||
assertThrows<IllegalArgumentException> {
|
||||
IoUtils.readBytes(URL("https://example.com"))
|
||||
IoUtils.readBytes(URI("https://example.com"))
|
||||
}
|
||||
assertThrows<IllegalArgumentException> {
|
||||
IoUtils.readBytes(URL("http://example.com"))
|
||||
IoUtils.readBytes(URI("http://example.com"))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `readString(URL) does not support HTTP URLs`() {
|
||||
assertThrows<IllegalArgumentException> {
|
||||
IoUtils.readString(URL("https://example.com"))
|
||||
IoUtils.readString(URI("https://example.com").toURL())
|
||||
}
|
||||
assertThrows<IllegalArgumentException> {
|
||||
IoUtils.readString(URL("http://example.com"))
|
||||
IoUtils.readString(URI("http://example.com").toURL())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user