mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
Moves to Java11 and OpenJDK via AdoptOpenJDK within the processing4 train using a squash of sampottinger processing fork's java11 branch. **Primary required changes:** Some changes directly support OpenJFX / OpenJDK 11: - Response to image loading changes caused by [JEP 320](https://openjdk.java.net/jeps/320) - Use of jmodules as necessitated by [JEP 261](https://openjdk.java.net/jeps/261) - Reponse to largely changed file paths caused by [JEP 220](https://openjdk.java.net/jeps/220). - Modifications in build system related to AdoptOpenJDK and Java 11 which have a different naming structure for downloads. - Allowing use of non-Oracle Java within internal Processing checks. **Secondary required changes:** There were some secondary required changes that impacted the usability of Processing after having moved to OpenJFX / OpenJDK 11: - Removal of com.apple.eawt calls related to [JEP 272](http://openjdk.java.net/jeps/272) - Response to HiDPI support on Windows and Linux in [JEP 263](https://openjdk.java.net/jeps/263) - Removal of `java.ext.dirs`. Would be forced by [JEP 220](http://openjdk.java.net/jeps/220). - Due to bugs on Windows, updated the JNA jars. - Changes in downloader build tasks to support AdoptOpenJDK and OpenJFX. - Updated org.eclipse.* / equinox jars. - Some optimization around size of distribution. - Update of AppBundler. - Some changes in formulation of classpath and modifications in PreprocessingService given [JEP 261](https://openjdk.java.net/jeps/261). **Incidental changes:** This was (ahem) a bit of a larger PR with the above modifications. So, I wanted to introduce automated tests when possible and convenient along with a few changes for platform sustainability in order to support development: - Addition of cross-building capability (!) made possible by AdoptOpenJDK. - Addition of mockito for testing. - Upgrade of junit. - Addition of ant-contrib. - Standardized nomenclature around JRE / JDK in `build/build.xml` - Deduplication of code in `jre/build.xml`. - Addition of JavaDoc in a few places. - Some refactoring of PImage / Shape to support increased testing and readability in image manipulation code.
129 lines
3.4 KiB
Java
129 lines
3.4 KiB
Java
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
|
|
|
/*
|
|
Part of the Processing project - http://processing.org
|
|
|
|
Copyright (c) 2012-19 The Processing Foundation
|
|
Copyright (c) 2004-12 Ben Fry and Casey Reas
|
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
version 2, as published by the Free Software Foundation.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software Foundation,
|
|
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
public class AdoptOpenJdkDownloadUrlGeneratorTest {
|
|
|
|
private static final String EXPECTED_WIN64_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_windows_hotspot_11.0.1_13.zip";
|
|
private static final String EXPECTED_MAC_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_mac_hotspot_11.0.1_13.tar.gz";
|
|
private static final String EXPECTED_LINUX_URL = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_linux_hotspot_11.0.1_13.tar.gz";
|
|
private static final String EXPECTED_LINUX_URL_ARM = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.1_13.tar.gz";
|
|
|
|
private static final String COMPONENT = "jdk";
|
|
private static final int TRAIN = 11;
|
|
private static final int VERSION = 0;
|
|
private static final int UPDATE = 1;
|
|
private static final int BUILD = 13;
|
|
private static final String FLAVOR_SUFFIX = "-x64.tar.gz";
|
|
private static final String HASH = "";
|
|
|
|
private AdoptOpenJdkDownloadUrlGenerator urlGenerator;
|
|
|
|
@Before
|
|
public void setUp() throws Exception {
|
|
urlGenerator = new AdoptOpenJdkDownloadUrlGenerator();
|
|
}
|
|
|
|
@Test
|
|
public void testBuildUrlWindows() {
|
|
String url = urlGenerator.buildUrl(
|
|
"windows64",
|
|
COMPONENT,
|
|
TRAIN,
|
|
VERSION,
|
|
UPDATE,
|
|
BUILD,
|
|
"windows" + FLAVOR_SUFFIX,
|
|
HASH
|
|
);
|
|
|
|
assertEquals(
|
|
EXPECTED_WIN64_URL,
|
|
url
|
|
);
|
|
}
|
|
|
|
@Test
|
|
public void testBuildUrlMac() {
|
|
String url = urlGenerator.buildUrl(
|
|
"macosx64",
|
|
COMPONENT,
|
|
TRAIN,
|
|
VERSION,
|
|
UPDATE,
|
|
BUILD,
|
|
"mac" + FLAVOR_SUFFIX,
|
|
HASH
|
|
);
|
|
|
|
assertEquals(
|
|
EXPECTED_MAC_URL,
|
|
url
|
|
);
|
|
}
|
|
|
|
@Test
|
|
public void testBuildUrlLinux64() {
|
|
String url = urlGenerator.buildUrl(
|
|
"linux64",
|
|
COMPONENT,
|
|
TRAIN,
|
|
VERSION,
|
|
UPDATE,
|
|
BUILD,
|
|
"linux64" + FLAVOR_SUFFIX,
|
|
HASH
|
|
);
|
|
|
|
assertEquals(
|
|
EXPECTED_LINUX_URL,
|
|
url
|
|
);
|
|
}
|
|
|
|
@Test
|
|
public void testBuildUrlLinuxArm() {
|
|
String url = urlGenerator.buildUrl(
|
|
"linuxArm",
|
|
COMPONENT,
|
|
TRAIN,
|
|
VERSION,
|
|
UPDATE,
|
|
BUILD,
|
|
"linuxArm" + FLAVOR_SUFFIX,
|
|
HASH
|
|
);
|
|
|
|
assertEquals(
|
|
EXPECTED_LINUX_URL_ARM,
|
|
url
|
|
);
|
|
}
|
|
|
|
}
|