source: josm/trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java@ 11691

Last change on this file since 11691 was 10067, checked in by Don-vip, 8 years ago

see #12652 - rework bug report classes to improve unit tests coverage

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools.bugreport;
3
4import static org.junit.Assert.assertFalse;
5import static org.junit.Assert.assertNotNull;
6import static org.junit.Assert.assertNull;
7
8import org.junit.Before;
9import org.junit.Test;
10import org.openstreetmap.josm.JOSMFixture;
11import org.openstreetmap.josm.actions.ShowStatusReportAction;
12
13/**
14 * Unit tests of {@link BugReportSender} class.
15 */
16public class BugReportSenderTest {
17
18 /**
19 * Setup tests.
20 */
21 @Before
22 public void setUp() {
23 JOSMFixture.createUnitTestFixture().init();
24 }
25
26 /**
27 * Unit test for {@link BugReportSender#BugReportSender}.
28 * @throws InterruptedException if the thread is interrupted
29 */
30 @Test
31 public void testBugReportSender() throws InterruptedException {
32 BugReportSender sender = BugReportSender.reportBug(ShowStatusReportAction.getReportHeader());
33 assertNotNull(sender);
34 synchronized (sender) {
35 while (sender.isAlive()) {
36 sender.wait();
37 }
38 }
39 assertFalse(sender.isAlive());
40 assertNull(sender.getErrorMessage(), sender.getErrorMessage());
41 }
42}
Note: See TracBrowser for help on using the repository browser.