source: josm/trunk/test/unit/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTaskTest.java@ 8881

Last change on this file since 8881 was 8881, checked in by Don-vip, 9 years ago

add unit test for plugin list download

File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins;
3
4import static org.junit.Assert.assertFalse;
5
6import java.util.List;
7
8import org.junit.BeforeClass;
9import org.junit.Test;
10import org.openstreetmap.josm.JOSMFixture;
11import org.openstreetmap.josm.Main;
12
13/**
14 * Unit tests of {@link ReadRemotePluginInformationTask} class.
15 */
16public class ReadRemotePluginInformationTaskTest {
17
18 /**
19 * Setup test.
20 */
21 @BeforeClass
22 public static void setUp() {
23 JOSMFixture.createUnitTestFixture().init();
24 }
25
26 /**
27 * Test of plugin list download.
28 */
29 @Test
30 public void testDownloadPluginList() {
31 ReadRemotePluginInformationTask pluginInfoDownloadTask = new ReadRemotePluginInformationTask(
32 Main.pref.getOnlinePluginSites());
33 pluginInfoDownloadTask.run();
34 List<PluginInformation> list = pluginInfoDownloadTask.getAvailablePlugins();
35 assertFalse(list.isEmpty());
36 PluginInformation info = list.get(0);
37 assertFalse(info.getName().isEmpty());
38 assertFalse(info.getClass().getName().isEmpty());
39 }
40}
Note: See TracBrowser for help on using the repository browser.