Ignore:
Timestamp:
2018-09-10T00:04:42+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16682 - On Java 9/10 and headless mode, filter plugins requiring JavaFX as Monocle is not available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java

    r14235 r14239  
    66import static org.junit.Assert.assertTrue;
    77
     8import java.awt.GraphicsEnvironment;
    89import java.util.Arrays;
    910import java.util.Collection;
     
    2930import org.openstreetmap.josm.spi.preferences.Config;
    3031import org.openstreetmap.josm.testutils.JOSMTestRules;
     32import org.openstreetmap.josm.tools.Utils;
    3133
    3234import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    112114            }
    113115        }
     116
     117        // On Java 9/10 and headless mode, filter plugins requiring JavaFX as Monocle is not available
     118        int javaVersion = Utils.getJavaVersion();
     119        if (GraphicsEnvironment.isHeadless() && javaVersion >= 9 && javaVersion <= 10) {
     120            for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {
     121                PluginInformation pi = it.next();
     122                if (pi.getRequiredPlugins().contains("openjfx")) {
     123                    System.out.println("Ignoring " + pi.name + " (requiring JavaFX and we're using Java 9/10 in headless mode)");
     124                    it.remove();
     125                }
     126            }
     127        }
     128
    114129        System.out.println("Filtered plugin list contains " + plugins.size() + " plugins");
    115130
Note: See TracChangeset for help on using the changeset viewer.