Skip to content

Fixed failures in download tests #9727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ant.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Java CI

on: [push]
on:
push:
pull_request:

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions app/test/cc/arduino/contributions/JsonDownloaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion arduino-core/src/processing/app/BaseNoGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down