From efdd341e0e3d6ad0f7cedb779c33470fbc2b3a38 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 6 Feb 2020 16:04:07 +0100 Subject: [PATCH 1/2] Run github actions on pull request --- .github/workflows/ant.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: From b59c91ebe288ded66d35b64175dc94b2b53d01ad Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 6 Feb 2020 15:46:31 +0100 Subject: [PATCH 2/2] Fixed failures in download tests --- .../cc/arduino/contributions/GzippedJsonDownloaderTest.java | 3 +++ app/test/cc/arduino/contributions/JsonDownloaderTest.java | 3 +++ arduino-core/src/processing/app/BaseNoGui.java | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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()) {