diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index a0a91efa9e1..11b9bd1a5ee 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -1,6 +1,8 @@ name: Java CI -on: [push] +on: + push: + pull_request: jobs: build: diff --git a/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java b/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java index 745ccb1dd5b..f57700c621b 100644 --- a/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java @@ -8,6 +8,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; + +import processing.app.BaseNoGui; import processing.app.helpers.FileUtils; import java.io.File; @@ -38,6 +40,7 @@ public void tearDown() throws Exception { @Test public void testJsonDownload() throws Exception { + BaseNoGui.initPlatform(); new GZippedJsonDownloader(downloader, new URL("http://downloads.arduino.cc/libraries/library_index.json"), new URL("http://downloads.arduino.cc/libraries/library_index.json.gz")) .download(tempFile, new MultiStepProgress(1), "", new NoopProgressListener(), true); diff --git a/app/test/cc/arduino/contributions/JsonDownloaderTest.java b/app/test/cc/arduino/contributions/JsonDownloaderTest.java index bdb64325f59..98555be4d60 100644 --- a/app/test/cc/arduino/contributions/JsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/JsonDownloaderTest.java @@ -8,6 +8,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; + +import processing.app.BaseNoGui; import processing.app.helpers.FileUtils; import java.io.File; @@ -38,6 +40,7 @@ public void tearDown() throws Exception { @Test public void testJsonDownload() throws Exception { + BaseNoGui.initPlatform(); new JsonDownloader(downloader, new URL("http://downloads.arduino.cc/libraries/library_index.json")) .download(tempFile, new MultiStepProgress(1), "", new NoopProgressListener(), true); diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 59ef009a60b..bd7f672925e 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -509,7 +509,7 @@ static public void initPackages() throws Exception { } } - static protected void initPlatform() { + static public void initPlatform() { try { Class platformClass = Class.forName("processing.app.Platform"); if (OSUtils.isMacOS()) {