Ignore:
Timestamp:
2016-04-09T01:35:58+02:00 (6 years ago)
Author:
Don-vip
Message:

fix unit test failing with clean jenkins workspace

File:
1 edited

Legend:

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

    r9815 r10123  
    77
    88import java.util.Arrays;
     9import java.util.Collection;
    910import java.util.Iterator;
    1011import java.util.List;
     
    6667        System.out.println("Filtered plugin list contains " + plugins.size() + " plugins");
    6768
    68         // Update the locally installed plugins
    69         PluginDownloadTask pluginDownloadTask = new PluginDownloadTask(NullProgressMonitor.INSTANCE, plugins, null);
    70         pluginDownloadTask.run();
    71         assertTrue(pluginDownloadTask.getFailedPlugins().toString(), pluginDownloadTask.getFailedPlugins().isEmpty());
    72         assertEquals(plugins.size(), pluginDownloadTask.getDownloadedPlugins().size());
    73 
    74         // Update Plugin info for downloaded plugins
    75         PluginHandler.refreshLocalUpdatedPluginInfo(pluginDownloadTask.getDownloadedPlugins());
     69        // Download plugins
     70        downloadPlugins(plugins);
    7671
    7772        // Load early plugins
     
    8378        assertTrue(PluginHandler.pluginLoadingExceptions.toString(), PluginHandler.pluginLoadingExceptions.isEmpty());
    8479    }
     80
     81    /**
     82     * Download plugins
     83     * @param plugins plugins to download
     84     */
     85    public static void downloadPlugins(Collection<PluginInformation> plugins) {
     86        // Update the locally installed plugins
     87        PluginDownloadTask pluginDownloadTask = new PluginDownloadTask(NullProgressMonitor.INSTANCE, plugins, null);
     88        pluginDownloadTask.run();
     89        assertTrue(pluginDownloadTask.getFailedPlugins().toString(), pluginDownloadTask.getFailedPlugins().isEmpty());
     90        assertEquals(plugins.size(), pluginDownloadTask.getDownloadedPlugins().size());
     91
     92        // Update Plugin info for downloaded plugins
     93        PluginHandler.refreshLocalUpdatedPluginInfo(pluginDownloadTask.getDownloadedPlugins());
     94    }
    8595}
Note: See TracChangeset for help on using the changeset viewer.