Changeset 18267 in josm for trunk


Ignore:
Timestamp:
2021-10-10T15:21:30+02:00 (3 years ago)
Author:
Don-vip
Message:

PluginHandlerTestIT: Skip unofficial plugins in headless mode, too much work for us for little added-value

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r18211 r18267  
    348348            sb.append(" <a href=\"").append(link).append("\">").append(tr("More info...")).append("</a>");
    349349        }
    350         if (downloadlink != null
    351                 && !downloadlink.startsWith("https://josm.openstreetmap.de/osmsvn/applications/editors/josm/dist/")
    352                 && !downloadlink.startsWith("https://github.com/JOSM/")) {
     350        if (isExternal()) {
    353351            sb.append("<p>&nbsp;</p><p>").append(tr("<b>Plugin provided by an external source:</b> {0}", downloadlink)).append("</p>");
    354352        }
    355353        sb.append("</body></html>");
    356354        return sb.toString();
     355    }
     356
     357    /**
     358     * Determines if this plugin comes from an external, non-official source.
     359     * @return {@code true} if this plugin comes from an external, non-official source.
     360     * @since 18267
     361     */
     362    public boolean isExternal() {
     363        return downloadlink != null
     364                && !downloadlink.startsWith("https://josm.openstreetmap.de/osmsvn/applications/editors/josm/dist/")
     365                && !downloadlink.startsWith("https://github.com/JOSM/");
    357366    }
    358367
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java

    r17857 r18267  
    195195                if (pi.getRequiredPlugins().contains("javafx")) {
    196196                    System.out.println("Ignoring " + pi.name + " (requiring JavaFX and we're using Java < 11 in headless mode)");
     197                    it.remove();
     198                }
     199            }
     200        }
     201
     202        // Skip unofficial plugins in headless mode, too much work for us for little added-value
     203        if (GraphicsEnvironment.isHeadless()) {
     204            for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {
     205                PluginInformation pi = it.next();
     206                if (pi.isExternal()) {
     207                    System.out.println("Ignoring " + pi.name + " (unofficial plugin in headless mode)");
    197208                    it.remove();
    198209                }
Note: See TracChangeset for help on using the changeset viewer.