From b59c91ebe288ded66d35b64175dc94b2b53d01ad Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 6 Feb 2020 15:46:31 +0100 Subject: [PATCH] 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 745ccb1dd..f57700c62 100644 --- a/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java @@ -8,6 +8,8 @@ import com.fasterxml.jackson.module.mrbean.MrBeanModule; 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 class GzippedJsonDownloaderTest { @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 bdb64325f..98555be4d 100644 --- a/app/test/cc/arduino/contributions/JsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/JsonDownloaderTest.java @@ -8,6 +8,8 @@ import com.fasterxml.jackson.module.mrbean.MrBeanModule; 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 class JsonDownloaderTest { @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 59ef009a6..bd7f67292 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -509,7 +509,7 @@ public class BaseNoGui { } } - static protected void initPlatform() { + static public void initPlatform() { try { Class platformClass = Class.forName("processing.app.Platform"); if (OSUtils.isMacOS()) {