source: josm/trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadOpenChangesetsTaskTest.java@ 14138

Last change on this file since 14138 was 13435, checked in by Don-vip, 6 years ago

see #8039, see #10456 - fix regressions and code style issues

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import static org.junit.Assert.assertNotNull;
5import static org.junit.Assert.assertNull;
6import static org.junit.Assert.assertTrue;
7
8import javax.swing.JPanel;
9
10import org.junit.Rule;
11import org.junit.Test;
12import org.openstreetmap.josm.data.UserIdentityManager;
13import org.openstreetmap.josm.testutils.JOSMTestRules;
14
15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16
17/**
18 * Unit tests of {@link DownloadOpenChangesetsTask} class.
19 */
20public class DownloadOpenChangesetsTaskTest {
21
22 /**
23 * Setup tests
24 */
25 @Rule
26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
27 public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
28
29 /**
30 * Test of {@link DownloadOpenChangesetsTask} class.
31 */
32 @Test
33 public void testDownloadOpenChangesetsTask() {
34 DownloadOpenChangesetsTask task = new DownloadOpenChangesetsTask(new JPanel());
35 assertNull(task.getChangesets());
36
37 assertTrue(UserIdentityManager.getInstance().isAnonymous());
38 task.run();
39 assertNull(task.getChangesets());
40
41 task = new DownloadOpenChangesetsTask(new JPanel());
42 UserIdentityManager.getInstance().setPartiallyIdentified(System.getProperty("osm.username", "josm_test"));
43 assertTrue(UserIdentityManager.getInstance().isPartiallyIdentified());
44 task.run();
45 assertNotNull(task.getChangesets());
46 }
47}
Note: See TracBrowser for help on using the repository browser.