Changeset 19109 in josm for trunk/test
- Timestamp:
- 2024-06-17T21:36:37+02:00 (5 months ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r19056 r19109 496 496 // See https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/ClassFileVersion.java 497 497 // for currently supported Java versions. 498 if (Utils.getJavaVersion() >= 19) {498 if (Utils.getJavaVersion() >= 22) { 499 499 // Byte Buddy often supports new class file versions for current EA releases if its experimental flag is set to true 500 500 System.setProperty("net.bytebuddy.experimental", "true"); -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r18893 r19109 247 247 } 248 248 249 // On Java < 11 and headless mode, filter plugins requiring JavaFX as Monocle is not available250 int javaVersion = Utils.getJavaVersion();251 if (GraphicsEnvironment.isHeadless() && javaVersion < 11) {252 for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {253 PluginInformation pi = it.next();254 if (pi.getRequiredPlugins().contains("javafx")) {255 System.out.println("Ignoring " + pi.name + " (requiring JavaFX and we're using Java < 11 in headless mode)");256 it.remove();257 }258 }259 }260 261 249 // Skip unofficial plugins in headless mode, too much work for us for little added-value 262 250 if (GraphicsEnvironment.isHeadless()) { -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r18893 r19109 3 3 4 4 import java.awt.Color; 5 import java.awt.GraphicsEnvironment;6 import java.awt.Toolkit;7 5 import java.awt.Window; 8 6 import java.awt.event.WindowEvent; … … 17 15 import java.lang.annotation.RetentionPolicy; 18 16 import java.lang.annotation.Target; 19 import java.lang.reflect.Method;20 17 import java.nio.charset.StandardCharsets; 21 18 import java.security.GeneralSecurityException; … … 26 23 import java.util.concurrent.TimeUnit; 27 24 import java.util.logging.Handler; 28 import java.util.logging.Level;29 25 30 26 import org.awaitility.Awaitility; … … 78 74 import org.openstreetmap.josm.tools.Logging; 79 75 import org.openstreetmap.josm.tools.MemoryManagerTest; 80 import org.openstreetmap.josm.tools.PlatformManager;81 import org.openstreetmap.josm.tools.Utils;82 76 import org.openstreetmap.josm.tools.bugreport.ReportedException; 83 77 import org.openstreetmap.josm.tools.date.DateUtils; … … 646 640 } 647 641 648 workaroundJdkBug8159956();649 642 new MainApplication(); 650 643 JOSMFixture.initContentPane(); … … 653 646 JOSMFixture.initMainMenu(); 654 647 } 655 }656 }657 658 private void workaroundJdkBug8159956() {659 // Note: This has been backported to Java 8u381 (2023-07-18)660 try {661 if (PlatformManager.isPlatformWindows() && Utils.getJavaVersion() == 8 && GraphicsEnvironment.isHeadless()) {662 // https://bugs.openjdk.java.net/browse/JDK-8159956663 Method initIDs = Toolkit.class.getDeclaredMethod("initIDs");664 initIDs.setAccessible(true);665 initIDs.invoke(Toolkit.getDefaultToolkit());666 }667 } catch (Exception e) {668 Logging.log(Level.WARNING, "Failed to Toolkit.initIDs", e);669 648 } 670 649 }
Note:
See TracChangeset
for help on using the changeset viewer.